Issue
Hello i have some problem with my flutter design
i want to make a box with rounded border using container
and on the top of this box i want to make a text and text looks like this
but when i wrote the code the text is cannot be up look like this
this is my code
height: 440.0,
color: Colors.transparent,
child: new Container(
decoration: new BoxDecoration(
color: Colors.blue,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(40.0),
topRight: const Radius.circular(40.0),
)),
child: new Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 0),
child: Text('Email'),
),
),
),
)
Solution
Just use Align
for keeping always on head.
Container(
decoration: new BoxDecoration(
color: Colors.blue,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(40.0),
topRight: const Radius.circular(40.0),
)),
child: new Align(
alignment: Alignment.topCenter,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 0),
child: Text('Email'),
),
),
),
output:
Answered By - Jahidul Islam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.