Skip to content

Commit a037d88

Browse files
author
fbchen
committed
add baseline alignment
1 parent 81464e4 commit a037d88

File tree

3 files changed

+348
-330
lines changed

3 files changed

+348
-330
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class ExampleState extends State<Example> {
130130
zIndex: 100,
131131
translate: Offset(x, y),
132132
clickPadding: const EdgeInsets.all(30),
133-
translateDependency: true,
133+
translateConstraint: true,
134134
child: GestureDetector(
135135
child: Container(
136136
color: Colors.pink,
@@ -184,6 +184,26 @@ class ExampleState extends State<Example> {
184184
alignment: Alignment.center,
185185
child: const Text('child[7] pinned to the top right'),
186186
),
187+
),
188+
const Constrained(
189+
id: 'box9',
190+
width: CL.wrapContent,
191+
height: CL.wrapContent,
192+
baselineToBaseline: 'box7',
193+
194+
/// when setting baseline alignment, height must be wrap_content or fixed size
195+
/// other vertical constraints will be ignored
196+
/// Warning:
197+
/// Due to a bug in the flutter framework, baseline alignment may not take effect in debug mode
198+
/// See https://github.com/flutter/flutter/issues/101179
199+
200+
leftToLeft: 'box7',
201+
child: Text(
202+
'box9 baseline to box7',
203+
style: TextStyle(
204+
color: Colors.white,
205+
),
206+
),
187207
)
188208
],
189209
),

0 commit comments

Comments
 (0)