Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d2b01fd

Browse files
Added Expanded view with flex
1 parent 4230441 commit d2b01fd

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

‎simple_form/lib/main.dart‎

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,32 @@ class HomePage extends StatelessWidget {
1818
backgroundColor: Colors.green[400],
1919
),
2020
body: Row(
21-
mainAxisAlignment:MainAxisAlignment.spaceEvenly,
21+
2222
children: <Widget>[
23-
Text('Hello Text'),
24-
RaisedButton(
25-
onPressed: (){},
26-
color: Colors.green,
27-
child: Text('Mail me', style: TextStyle(color: Colors.white),),
28-
elevation: 40,
23+
Expanded(
24+
flex: 2,
25+
child: Container(
26+
color: Colors.cyan,
27+
padding: EdgeInsets.all(30),
28+
child: Text('1', style: TextStyle(fontFamily: 'Indie', fontSize: 20, color: Colors.white),),
29+
),
30+
),
31+
Expanded(
32+
flex: 1,
33+
child: Container(
34+
color: Colors.amber,
35+
padding: EdgeInsets.all(30),
36+
child: Text('2', style: TextStyle(fontFamily: 'Indie', fontSize: 20, color: Colors.white),),
37+
),
2938
),
30-
Container(
31-
padding: EdgeInsets.all(20),
32-
margin: EdgeInsets.all(20),
33-
color: Colors.green,
34-
child: Text('Text with padding', style: TextStyle(color: Colors.white),),
39+
Expanded(
40+
flex: 1,
41+
child: Container(
42+
color: Colors.pink,
43+
padding: EdgeInsets.all(30),
44+
child: Text('3', style: TextStyle(fontFamily: 'Indie', fontSize: 20, color: Colors.white),),
45+
),
3546
),
36-
// Padding(
37-
// padding: EdgeInsets.all(20),
38-
// child: FlatButton(
39-
// textColor: Colors.white,
40-
// child: Text('Button with padding'),
41-
// ),
42-
// ),
4347
],
4448
),
4549
floatingActionButton: FloatingActionButton(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /