mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-23 16:00:41 +00:00
hide DynamicColorListTile
if unavailable
This commit is contained in:
parent
8a4f141cf2
commit
ca5b30a026
2 changed files with 7 additions and 18 deletions
|
@ -9,20 +9,6 @@ class DynamicColorListTile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (context.read<DynamicColorState>() == DynamicColorState.unavailable) {
|
||||
return Opacity(
|
||||
opacity: 0.5,
|
||||
child: IgnorePointer(
|
||||
child: SwitchListTile(
|
||||
secondary: const Icon(Icons.colorize),
|
||||
title: Text(S.of(context).dynamicColor),
|
||||
value: false,
|
||||
enableFeedback: false,
|
||||
onChanged: (value) {},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return SwitchListTile(
|
||||
secondary: const Icon(Icons.colorize),
|
||||
title: Text(S.of(context).dynamicColor),
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:lightmeter/data/models/dynamic_colors_state.dart';
|
||||
import 'package:lightmeter/generated/l10n.dart';
|
||||
import 'package:lightmeter/res/dimens.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'components/calibration/widget_list_tile_calibration.dart';
|
||||
import 'components/haptics/provider_list_tile_haptics.dart';
|
||||
|
@ -64,10 +66,11 @@ class SettingsScreen extends StatelessWidget {
|
|||
),
|
||||
SettingsSection(
|
||||
title: S.of(context).theme,
|
||||
children: const [
|
||||
ThemeTypeListTile(),
|
||||
PrimaryColorListTile(),
|
||||
DynamicColorListTile(),
|
||||
children: [
|
||||
const ThemeTypeListTile(),
|
||||
const PrimaryColorListTile(),
|
||||
if (context.read<DynamicColorState>() != DynamicColorState.unavailable)
|
||||
const DynamicColorListTile(),
|
||||
],
|
||||
),
|
||||
SettingsSection(
|
||||
|
|
Loading…
Reference in a new issue