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.
9191 grid)
929217 . circle position
939318 . e-index(event dispatch order, default is z-index)
94+ 19 . self wrapContent
9495
9596Coming soon:
9697
97981 . chain
98992 . constraints visualization
99- 3 . self wrapContent
100- 4 . more...
100+ 3 . more...
101101
102102Support platform:
103103
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import 'guideline.dart';
1212import 'horizontal_list.dart' ;
1313import 'percentage_layout.dart' ;
1414import 'relative_id.dart' ;
15+ import 'self_wrap_content.dart' ;
1516import 'staggered_grid.dart' ;
1617import 'summary.dart' ;
1718import 'vertical_list.dart' ;
@@ -35,6 +36,7 @@ class ExampleHome extends StatelessWidget {
3536 'Vertical List' : const VerticalListExample (),
3637 'Staggered Grid' : const StaggeredGridExample (),
3738 'Circle Position' : const CirclePositionExample (),
39+ 'Self wrapContent' : const SelfWrapContentExample (),
3840 'Chain (Coming soon)' : const ComingSoonWidget (),
3941 };
4042
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