mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
constrained timer screen timeline for tablets
This commit is contained in:
parent
e1a056733c
commit
0a7a1425ee
2 changed files with 15 additions and 9 deletions
|
@ -68,4 +68,7 @@ class Dimens {
|
||||||
paddingL,
|
paddingL,
|
||||||
);
|
);
|
||||||
static const EdgeInsets dialogMargin = EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0);
|
static const EdgeInsets dialogMargin = EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0);
|
||||||
|
|
||||||
|
// TODO(@vodemn) constrain dialogs with this value
|
||||||
|
static const double tabletMaxWidth = 600;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,15 +79,18 @@ class TimerScreenState extends State<TimerScreen> with TickerProviderStateMixin
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(Dimens.paddingL),
|
padding: const EdgeInsets.all(Dimens.paddingL),
|
||||||
child: SizedBox.fromSize(
|
child: ConstrainedBox(
|
||||||
size: Size.square(MediaQuery.sizeOf(context).width - Dimens.paddingL * 4),
|
constraints: const BoxConstraints(maxHeight: Dimens.tabletMaxWidth, maxWidth: Dimens.tabletMaxWidth),
|
||||||
child: ValueListenableBuilder(
|
child: SizedBox.fromSize(
|
||||||
valueListenable: timelineAnimation,
|
size: Size.square(MediaQuery.sizeOf(context).width - Dimens.paddingL * 4),
|
||||||
builder: (_, value, child) => TimerTimeline(
|
child: ValueListenableBuilder(
|
||||||
progress: value,
|
valueListenable: timelineAnimation,
|
||||||
child: TimerText(
|
builder: (_, value, child) => TimerTimeline(
|
||||||
timeLeft: Duration(milliseconds: (widget.duration.inMilliseconds * value).toInt()),
|
progress: value,
|
||||||
duration: widget.duration,
|
child: TimerText(
|
||||||
|
timeLeft: Duration(milliseconds: (widget.duration.inMilliseconds * value).toInt()),
|
||||||
|
duration: widget.duration,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue