added Equipment section placeholder

This commit is contained in:
Vadim 2023-02-19 19:55:12 +03:00
parent 59287d06bc
commit a2f1e1b2df
9 changed files with 108 additions and 16 deletions

View file

@ -34,6 +34,10 @@
"calibrationMessageCameraOnly": "The accuracy of the readings measured by this application depends entirely on the rear camera of the device. Therefore, consider testing this application and setting up an EV calibration value that will give you the desired measurement results.", "calibrationMessageCameraOnly": "The accuracy of the readings measured by this application depends entirely on the rear camera of the device. Therefore, consider testing this application and setting up an EV calibration value that will give you the desired measurement results.",
"camera": "Camera", "camera": "Camera",
"lightSensor": "Light sensor", "lightSensor": "Light sensor",
"equipment": "Equipment",
"isoValues": "ISO values",
"ndFilters": "ND filters",
"equipmentProfiles": "Equipment profiles",
"general": "General", "general": "General",
"keepScreenOn": "Keep screen on", "keepScreenOn": "Keep screen on",
"haptics": "Haptics", "haptics": "Haptics",

View file

@ -26,6 +26,9 @@ class Dimens {
static const Duration durationML = Duration(milliseconds: 250); static const Duration durationML = Duration(milliseconds: 250);
static const Duration durationL = Duration(milliseconds: 300); static const Duration durationL = Duration(milliseconds: 300);
static const double enabledOpacity = 1.0;
static const double disabledOpacity = 0.38;
// TopBar // TopBar
/// Probably this is a bad practice, but with text size locked, the height is always 212 /// Probably this is a bad practice, but with text size locked, the height is always 212
static const double readingContainerHeight = 212; static const double readingContainerHeight = 212;

View file

@ -0,0 +1,14 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
class EquipmentProfilesListTile extends StatelessWidget {
const EquipmentProfilesListTile({super.key});
@override
Widget build(BuildContext context) {
return ListTile(
leading: const Icon(Icons.camera),
title: Text(S.of(context).equipmentProfiles),
);
}
}

View file

@ -0,0 +1,14 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
class IsoValuesListTile extends StatelessWidget {
const IsoValuesListTile({super.key});
@override
Widget build(BuildContext context) {
return ListTile(
leading: const Icon(Icons.iso),
title: Text(S.of(context).isoValues),
);
}
}

View file

@ -0,0 +1,14 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
class NdFiltersListTile extends StatelessWidget {
const NdFiltersListTile({super.key});
@override
Widget build(BuildContext context) {
return ListTile(
leading: const Icon(Icons.filter_b_and_w),
title: Text(S.of(context).ndFilters),
);
}
}

View file

@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/screens/settings/components/shared/settings_section/widget_settings_section.dart';
import 'components/equipment_profiles/widget_list_tile_equipment_profiles.dart';
import 'components/iso_values/widget_list_tile_iso_values.dart';
import 'components/nd_filters/widget_list_tile_nd_filters.dart';
class EquipmentSettingsSection extends StatelessWidget {
const EquipmentSettingsSection({super.key});
@override
Widget build(BuildContext context) {
return SettingsSection(
enabled: false,
title: S.of(context).equipment,
children: const [
IsoValuesListTile(),
NdFiltersListTile(),
EquipmentProfilesListTile(),
],
);
}
}

View file

@ -4,10 +4,12 @@ import 'package:lightmeter/res/dimens.dart';
class SettingsSection extends StatelessWidget { class SettingsSection extends StatelessWidget {
final String title; final String title;
final List<Widget> children; final List<Widget> children;
final bool enabled;
const SettingsSection({ const SettingsSection({
required this.title, required this.title,
required this.children, required this.children,
this.enabled = true,
super.key, super.key,
}); });
@ -23,22 +25,35 @@ class SettingsSection extends StatelessWidget {
child: Card( child: Card(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: Dimens.paddingM), padding: const EdgeInsets.symmetric(vertical: Dimens.paddingM),
child: Column( child: Opacity(
crossAxisAlignment: CrossAxisAlignment.start, opacity: enabled ? Dimens.enabledOpacity : Dimens.disabledOpacity,
mainAxisSize: MainAxisSize.min, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Padding( mainAxisSize: MainAxisSize.min,
padding: const EdgeInsets.only(left: Dimens.paddingM), children: [
child: Text( Padding(
title, padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
style: Theme.of(context) child: Row(
.textTheme children: [
.labelLarge Text(
?.copyWith(color: Theme.of(context).colorScheme.onSurface), title,
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(color: Theme.of(context).colorScheme.onSurface),
),
const Spacer(),
if (!enabled)
const Icon(
Icons.lock,
size: Dimens.grid16,
),
],
),
), ),
), ...children,
...children, ],
], ),
), ),
), ),
), ),

View file

@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:lightmeter/data/models/dynamic_colors_state.dart'; import 'package:lightmeter/data/models/dynamic_colors_state.dart';
import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/providers/theme_provider.dart'; import 'package:lightmeter/providers/theme_provider.dart';
import 'package:lightmeter/res/dimens.dart';
import 'components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart'; import 'components/primary_color_picker_dialog/widget_dialog_picker_primary_color.dart';
@ -13,7 +14,7 @@ class PrimaryColorListTile extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (context.watch<DynamicColorState>() == DynamicColorState.enabled) { if (context.watch<DynamicColorState>() == DynamicColorState.enabled) {
return Opacity( return Opacity(
opacity: 0.5, opacity: Dimens.disabledOpacity,
child: IgnorePointer( child: IgnorePointer(
child: ListTile( child: ListTile(
leading: const Icon(Icons.palette), leading: const Icon(Icons.palette),

View file

@ -3,6 +3,7 @@ import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/res/dimens.dart';
import 'components/about/widget_settings_section_about.dart'; import 'components/about/widget_settings_section_about.dart';
import 'components/equipment/widget_settings_section_equipment.dart';
import 'components/general/widget_settings_section_general.dart'; import 'components/general/widget_settings_section_general.dart';
import 'components/metering/widget_settings_section_metering.dart'; import 'components/metering/widget_settings_section_metering.dart';
import 'components/theme/widget_settings_section_theme.dart'; import 'components/theme/widget_settings_section_theme.dart';
@ -44,6 +45,7 @@ class SettingsScreen extends StatelessWidget {
delegate: SliverChildListDelegate( delegate: SliverChildListDelegate(
<Widget>[ <Widget>[
const MeteringSettingsSection(), const MeteringSettingsSection(),
const EquipmentSettingsSection(),
const GeneralSettingsSection(), const GeneralSettingsSection(),
const ThemeSettingsSection(), const ThemeSettingsSection(),
const AboutSettingsSection(), const AboutSettingsSection(),