Skip to content

Commit

Permalink
Fixes #17
Browse files Browse the repository at this point in the history
By wrapping each `Text` widget in an `Expandable` widget and aligning the text centrally this issue is fixed as the `Text` widgets that contain the numbers now occoupy the maxiumum possilbe space.
  • Loading branch information
REDACTED-REDACTED committed Aug 4, 2018
1 parent 704d842 commit 467c0f7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ fabric.properties
.dart_tool/
.packages
.pub/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
Expand Down
68 changes: 60 additions & 8 deletions lib/widgets/countdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,66 @@ class _CountdownState extends State<Countdown> with TickerProviderStateMixin {
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
new Text(times["days"].toString(), style: Theme.of(context).textTheme.headline,),
new Text("days", style: Theme.of(context).textTheme.body1,),
new Text(times["hours"].toString(), style: Theme.of(context).textTheme.headline,),
new Text("hours", style: Theme.of(context).textTheme.body1,),
new Text(times["minutes"].toString(), style: Theme.of(context).textTheme.headline,),
new Text("minutes", style: Theme.of(context).textTheme.body1,),
new Text(times["seconds"].toString(), style: Theme.of(context).textTheme.headline,),
new Text("seconds", style: Theme.of(context).textTheme.body1,),
new Flexible(
fit: FlexFit.tight,
child: new Text(
times["days"].toString(),
style: Theme.of(context).textTheme.headline,
textAlign: TextAlign.center,
),
),
new Flexible(
fit: FlexFit.loose,
child: new Text(
"days",
style: Theme.of(context).textTheme.body1,
),
),
new Flexible(
fit: FlexFit.tight,
child: new Text(
times["hours"].toString(),
style: Theme.of(context).textTheme.headline,
textAlign: TextAlign.center,
),
),
new Flexible(
fit: FlexFit.loose,
child: new Text(
"hours",
style: Theme.of(context).textTheme.body1,
),
),
new Flexible(
fit: FlexFit.tight,
child: new Text(
times["minutes"].toString(),
style: Theme.of(context).textTheme.headline,
textAlign: TextAlign.center,
),
),
new Flexible(
fit: FlexFit.loose,
child: new Text(
"minutes",
style: Theme.of(context).textTheme.body1,
),
),
new Flexible(
fit: FlexFit.tight,
child: new Text(
times["seconds"].toString(),
style: Theme.of(context).textTheme.headline,
textAlign: TextAlign.center,
),
),
new Flexible(
fit: FlexFit.loose,
child: new Text(
"seconds",
style: Theme.of(context).textTheme.body1,
),
),
],
),
);
Expand Down

0 comments on commit 467c0f7

Please sign in to comment.