forked from qwertypool/flutter-code-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flex.dart
106 lines (104 loc) · 2.36 KB
/
flex.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Responsive app '),
backgroundColor: Colors.greenAccent[400],
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {},
tooltip: 'Menu',
) //IconButton
), //AppBar
body: Center(
child: Container(
child: Padding(
padding: const EdgeInsets.all(14.0),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Flexible(
flex: 1,
fit: FlexFit.tight,
child: Container(
height: 175,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.red,
), //BoxDecoration
), //Container
), //Flexible
SizedBox(
width: 20,
), //SizedBox
Flexible(
flex: 1,
fit: FlexFit.loose,
child: Container(
height: 175,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.red,
) //BoxDecoration
), //Container
) //Flexible
], //<Widget>[]
mainAxisAlignment: MainAxisAlignment.center,
), //Row
Flexible(
flex: 1,
fit: FlexFit.loose,
child: Container(
width: 380,
height: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.blue), //BoxDecoration
), //Container
), //Flexible
Row(
children: <Widget>[
Flexible(
flex: 2,
fit: FlexFit.tight,
child: Container(
width: 180,
height: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.cyan,
), //BoxDecoration
), //Container
), //Flexible
SizedBox(
width: 20,
), //SixedBox
Flexible(
flex: 2,
fit: FlexFit.tight,
child: Container(
width: 180,
height: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.cyan,
) //BoxDecoration
) //Conatiner,
) //Flexible
], //<widget>[]
mainAxisAlignment: MainAxisAlignment.center,
), //Row
], //<Widget>[]
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
), //Column
) //Padding
), //Container
) //Center
), //Scaffold
debugShowCheckedModeBanner: false,
)); //MaterialApp
}