Richard
Richard

Reputation: 23

How to get Flutter container to start at the left edge of the screen?

I would like my container to start from the left edge, so that you only see three sides of the container: the top, bottom, and right. I've tried making the margins (0, x, y, z) from LTRB, but the container is still floating out farther right than I'd like. must shift mentions left

My code:

return Scaffold(
      body: Column(
        children: <Widget>[
          Container(
            decoration: BoxDecoration(
                color: Colors.black,
                border: Border.all(
                  color: Colors.black,
                ),
                borderRadius: BorderRadius.all(Radius.circular(10))
            ),
            padding: EdgeInsets.all(10),
            margin: EdgeInsets.fromLTRB(0, 30, 170, 0),
            child: Text('MENTIONS', 
...

Upvotes: 1

Views: 1030

Answers (1)

L&#39;homme Sage
L&#39;homme Sage

Reputation: 23

    return Scaffold(
      body: Column(
   crossAxisAlignment: CrossAxisAlignment.start, // <=== try this maybe
        children: <Widget>[
          Container(
            decoration: BoxDecoration(
                color: Colors.black,
                border: Border.all(
                  color: Colors.black,
                ),
                borderRadius: BorderRadius.all(Radius.circular(10))
            ),
            
            margin: EdgeInsets.fromLTRB(0, 30, 170, 0),
            child: Text('MENTIONS', 

Upvotes: 1

Related Questions