mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
Compare commits
2 commits
6566108994
...
e340327e32
Author | SHA1 | Date | |
---|---|---|---|
|
e340327e32 | ||
|
19fc039723 |
4 changed files with 140 additions and 129 deletions
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
|
||||
|
@ -34,18 +35,20 @@ class _DialogFilterState<T> extends State<DialogFilter<T>> {
|
|||
bool get _hasAnySelected => checkboxValues.contains(true);
|
||||
bool get _hasAnyUnselected => checkboxValues.contains(false);
|
||||
|
||||
late final ScrollController _scrollController;
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
int i = 0;
|
||||
for (; i < checkboxValues.length; i++) {
|
||||
if (checkboxValues[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
_scrollController = ScrollController(initialScrollOffset: Dimens.grid56 * i);
|
||||
_scrollController.jumpTo((Dimens.grid56 * i).clamp(0, _scrollController.position.maxScrollExtent));
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -61,7 +64,9 @@ class _DialogFilterState<T> extends State<DialogFilter<T>> {
|
|||
titlePadding: Dimens.dialogIconTitlePadding,
|
||||
title: Text(widget.title),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: Column(
|
||||
content: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: Dimens.dialogIconTitlePadding,
|
||||
|
@ -106,9 +111,7 @@ class _DialogFilterState<T> extends State<DialogFilter<T>> {
|
|||
padding: EdgeInsets.zero,
|
||||
icon: Icon(_hasAnyUnselected ? Icons.select_all : Icons.deselect),
|
||||
onPressed: _toggleAll,
|
||||
tooltip: _hasAnyUnselected
|
||||
? S.of(context).tooltipSelectAll
|
||||
: S.of(context).tooltipDesecelectAll,
|
||||
tooltip: _hasAnyUnselected ? S.of(context).tooltipSelectAll : S.of(context).tooltipDesecelectAll,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
|
@ -135,6 +138,7 @@ class _DialogFilterState<T> extends State<DialogFilter<T>> {
|
|||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,10 @@ class _DialogPickerState<T> extends State<DialogPicker<T>> {
|
|||
titlePadding: Dimens.dialogIconTitlePadding,
|
||||
title: Text(widget.title),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: Column(
|
||||
content: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: widget.values
|
||||
.map(
|
||||
|
@ -51,6 +54,7 @@ class _DialogPickerState<T> extends State<DialogPicker<T>> {
|
|||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
actionsPadding: Dimens.dialogActionsPadding,
|
||||
actions: [
|
||||
TextButton(
|
||||
|
|
|
@ -36,7 +36,9 @@ class _DialogRangePickerState<T extends PhotographyValue> extends State<DialogRa
|
|||
titlePadding: Dimens.dialogIconTitlePadding,
|
||||
title: Text(widget.title),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: Column(
|
||||
content: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
|
@ -78,6 +80,7 @@ class _DialogRangePickerState<T extends PhotographyValue> extends State<DialogRa
|
|||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actionsPadding: Dimens.dialogActionsPadding,
|
||||
actions: [
|
||||
TextButton(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: lightmeter
|
||||
description: Lightmeter app inspired by Material 3 design system.
|
||||
publish_to: "none"
|
||||
version: 0.15.3+44
|
||||
version: 0.16.0+45
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
Loading…
Reference in a new issue