Skip to content

Commit 13db5de

Browse files
fix(example): prevent widget overflow in tile builder demo (#2129)
1 parent 7d9dd32 commit 13db5de

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

example/lib/pages/tile_builder.dart

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,27 @@ class TileBuilderPageState extends State<TileBuilderPage> {
3232
children: [
3333
tileWidget,
3434
if (showLoadingTime || showCoordinates)
35-
Column(
36-
mainAxisAlignment: MainAxisAlignment.center,
37-
children: [
38-
if (showCoordinates)
39-
Text(
40-
'${coords.x} : ${coords.y} : ${coords.z}',
41-
style: Theme.of(context).textTheme.headlineSmall,
42-
),
43-
if (showLoadingTime)
44-
Text(
45-
tile.loadFinishedAt == null
46-
? 'Loading'
47-
// sometimes result is negative which shouldn't happen, abs() corrects it
48-
: '${(tile.loadFinishedAt!.millisecond - tile.loadStarted!.millisecond).abs()} ms',
49-
style: Theme.of(context).textTheme.headlineSmall,
50-
),
51-
],
35+
FittedBox(
36+
fit: BoxFit.scaleDown,
37+
alignment: Alignment.center,
38+
child: Column(
39+
mainAxisAlignment: MainAxisAlignment.center,
40+
children: [
41+
if (showCoordinates)
42+
Text(
43+
'${coords.x} : ${coords.y} : ${coords.z}',
44+
style: Theme.of(context).textTheme.headlineSmall,
45+
),
46+
if (showLoadingTime)
47+
Text(
48+
tile.loadFinishedAt == null
49+
? 'Loading'
50+
// sometimes result is negative which shouldn't happen, abs() corrects it
51+
: '${(tile.loadFinishedAt!.millisecond - tile.loadStarted!.millisecond).abs()} ms',
52+
style: Theme.of(context).textTheme.headlineSmall,
53+
),
54+
],
55+
),
5256
),
5357
],
5458
),

0 commit comments

Comments
 (0)