diff --git a/lib/res/dimens.dart b/lib/res/dimens.dart index 0e03b22..30d064d 100644 --- a/lib/res/dimens.dart +++ b/lib/res/dimens.dart @@ -68,4 +68,7 @@ class Dimens { paddingL, ); static const EdgeInsets dialogMargin = EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0); + + // TODO(@vodemn) constrain dialogs with this value + static const double tabletMaxWidth = 600; } diff --git a/lib/screens/timer/screen_timer.dart b/lib/screens/timer/screen_timer.dart index ca42577..065c064 100644 --- a/lib/screens/timer/screen_timer.dart +++ b/lib/screens/timer/screen_timer.dart @@ -79,15 +79,18 @@ class TimerScreenState extends State with TickerProviderStateMixin const Spacer(), Padding( padding: const EdgeInsets.all(Dimens.paddingL), - child: SizedBox.fromSize( - size: Size.square(MediaQuery.sizeOf(context).width - Dimens.paddingL * 4), - child: ValueListenableBuilder( - valueListenable: timelineAnimation, - builder: (_, value, child) => TimerTimeline( - progress: value, - child: TimerText( - timeLeft: Duration(milliseconds: (widget.duration.inMilliseconds * value).toInt()), - duration: widget.duration, + child: ConstrainedBox( + constraints: const BoxConstraints(maxHeight: Dimens.tabletMaxWidth, maxWidth: Dimens.tabletMaxWidth), + child: SizedBox.fromSize( + size: Size.square(MediaQuery.sizeOf(context).width - Dimens.paddingL * 4), + child: ValueListenableBuilder( + valueListenable: timelineAnimation, + builder: (_, value, child) => TimerTimeline( + progress: value, + child: TimerText( + timeLeft: Duration(milliseconds: (widget.duration.inMilliseconds * value).toInt()), + duration: widget.duration, + ), ), ), ),