Skip to content

Commit

Permalink
🐛 Fix Feriencountdown overflowing on some devices
Browse files Browse the repository at this point in the history
Close #99
  • Loading branch information
strifel committed Jul 19, 2020
1 parent 7a8ae9f commit e06c654
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/Views/Home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,31 +167,32 @@ class HomeState extends State<Home> {
}

Widget _createFerienCountdownNumber(double screenSizeWidth, String char, ) {
return Container(
margin: EdgeInsets.fromLTRB(10, 0, screenSizeWidth / 50, 0),
child: Column(
return Column(
children: <Widget>[
kIsWeb ?
Text(_getFerienValue(char).toString(), style: TextStyle(fontSize: countDownSize),)
: FlipPanel<int>.stream(
itemStream: Stream.periodic(
Duration(milliseconds: 1000), (count) => _getFerienValue(char)),
itemBuilder: (context, value) => Container(
color: Colors.black,
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Text(
betterNumber(value),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: countDownSize,
color: Colors.white),
// The width has to be calculated like this to fit on mobile and tablet. But there should be a better way I do not know.
width: MediaQuery.of(context).size.longestSide > 1000 ? MediaQuery.of(context).size.width / 3 / 7 : MediaQuery.of(context).size.width / 7,
color: Colors.black,
padding: const EdgeInsets.symmetric(horizontal: 8),
child: FittedBox(
fit: BoxFit.contain,
child: Text(
betterNumber(value),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
),
),
initValue: _getFerienValue(char),
),
Text(char)
],
),
);
}

Expand Down

0 comments on commit e06c654

Please sign in to comment.