File tree Expand file tree Collapse file tree 5 files changed +624
-286
lines changed Expand file tree Collapse file tree 5 files changed +624
-286
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ insult him.
91
91
grid)
92
92
17 . circle position
93
93
18 . e-index(event dispatch order, default is z-index)
94
+ 19 . self wrapContent
94
95
95
96
Coming soon:
96
97
97
98
1 . chain
98
99
2 . constraints visualization
99
- 3 . self wrapContent
100
- 4 . more...
100
+ 3 . more...
101
101
102
102
Support platform:
103
103
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import 'guideline.dart';
12
12
import 'horizontal_list.dart' ;
13
13
import 'percentage_layout.dart' ;
14
14
import 'relative_id.dart' ;
15
+ import 'self_wrap_content.dart' ;
15
16
import 'staggered_grid.dart' ;
16
17
import 'summary.dart' ;
17
18
import 'vertical_list.dart' ;
@@ -35,6 +36,7 @@ class ExampleHome extends StatelessWidget {
35
36
'Vertical List' : const VerticalListExample (),
36
37
'Staggered Grid' : const StaggeredGridExample (),
37
38
'Circle Position' : const CirclePositionExample (),
39
+ 'Self wrapContent' : const SelfWrapContentExample (),
38
40
'Chain (Coming soon)' : const ComingSoonWidget (),
39
41
};
40
42
Original file line number Diff line number Diff line change
1
+ import 'package:flutter/material.dart' ;
2
+ import 'package:flutter_constraintlayout/src/constraint_layout.dart' ;
3
+
4
+ import 'custom_app_bar.dart' ;
5
+
6
+ class SelfWrapContentExample extends StatelessWidget {
7
+ const SelfWrapContentExample ({Key ? key}) : super (key: key);
8
+
9
+ @override
10
+ Widget build (BuildContext context) {
11
+ return Scaffold (
12
+ appBar: const CustomAppBar (
13
+ title: 'Self wrapContent' ,
14
+ codePath: 'example/self_wrap_content.dart' ,
15
+ ),
16
+ body: Center (
17
+ child: ConstraintLayout (
18
+ width: wrapContent,
19
+ height: wrapContent,
20
+ children: [
21
+ Container (
22
+ color: Colors .blue,
23
+ ).applyConstraint (
24
+ width: matchParent,
25
+ height: matchParent,
26
+ ),
27
+ Container (
28
+ color: Colors .yellow,
29
+ ).applyConstraint (
30
+ width: 300 ,
31
+ height: 150 ,
32
+ topLeftTo: parent,
33
+ margin: const EdgeInsets .only (
34
+ top: 10 ,
35
+ left: 10 ,
36
+ ),
37
+ ),
38
+ Container (
39
+ color: Colors .orange,
40
+ ).applyConstraint (
41
+ width: 50 ,
42
+ height: 50 ,
43
+ topRightTo: parent,
44
+ ),
45
+ const Text (
46
+ 'Self wrapContent' ,
47
+ ).applyConstraint (
48
+ outBottomRightTo: rId (1 ),
49
+ margin: const EdgeInsets .only (
50
+ left: 20 ,
51
+ right: 20 ,
52
+ ),
53
+ ),
54
+ Container (
55
+ color: Colors .cyan,
56
+ ).applyConstraint (
57
+ width: 50 ,
58
+ height: 50 ,
59
+ centerVerticalTo: parent,
60
+ left: rId (1 ).right,
61
+ right: rId (2 ).left,
62
+ )
63
+ ],
64
+ ),
65
+ ),
66
+ );
67
+ }
68
+ }
You can’t perform that action at this time.
0 commit comments