m3_lightmeter/lib/screens/settings/screen_settings.dart

84 lines
2.9 KiB
Dart
Raw Permalink Normal View History

2022-10-30 18:23:06 +00:00
import 'package:flutter/material.dart';
2022-10-30 18:59:33 +00:00
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/res/dimens.dart';
import 'components/haptics/provider_list_tile_haptics.dart';
2023-01-23 17:57:26 +00:00
import 'components/report_issue/widget_list_tile_report_issue.dart';
import 'components/shared/settings_section/widget_settings_section.dart';
2023-01-23 10:28:36 +00:00
import 'components/source_code/widget_list_tile_source_code.dart';
2023-01-23 18:39:55 +00:00
import 'components/dynamic_color/widget_list_tile_dynamic_color.dart';
2023-01-23 18:00:11 +00:00
import 'components/theme_type/widget_list_tile_theme_type.dart';
2023-01-23 17:36:40 +00:00
import 'components/version/widget_list_tile_version.dart';
2023-01-23 18:38:03 +00:00
import 'components/fractional_stops/widget_list_tile_fractional_stops.dart';
2023-01-23 18:35:47 +00:00
import 'components/write_email/widget_list_tile_write_email.dart';
2022-10-30 18:23:06 +00:00
class SettingsScreen extends StatelessWidget {
const SettingsScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
2022-12-17 18:05:50 +00:00
body: SafeArea(
top: false,
child: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
pinned: true,
automaticallyImplyLeading: false,
expandedHeight: Dimens.grid168,
flexibleSpace: FlexibleSpaceBar(
centerTitle: false,
titlePadding: const EdgeInsets.all(Dimens.paddingM),
title: Text(
S.of(context).settings,
style: TextStyle(color: Theme.of(context).colorScheme.onSurface, fontSize: 24),
),
2022-10-30 18:59:33 +00:00
),
2022-12-17 18:05:50 +00:00
actions: [
IconButton(
onPressed: Navigator.of(context).pop,
icon: const Icon(Icons.close),
),
],
2022-10-30 18:59:33 +00:00
),
2022-12-17 18:05:50 +00:00
SliverList(
delegate: SliverChildListDelegate(
2023-01-23 17:57:26 +00:00
<SettingsSection>[
SettingsSection(
title: S.of(context).metering,
2023-01-23 18:00:11 +00:00
children: const [
StopTypeListTile(),
2023-01-23 17:36:40 +00:00
],
),
2023-01-23 17:57:26 +00:00
SettingsSection(
title: S.of(context).general,
2023-01-23 18:00:11 +00:00
children: const [
HapticsListTileProvider(),
2023-01-23 17:36:40 +00:00
],
),
2023-01-23 17:57:26 +00:00
SettingsSection(
2023-01-23 17:36:40 +00:00
title: S.of(context).theme,
2023-01-23 17:57:26 +00:00
children: const [
ThemeTypeListTile(),
2023-01-23 18:39:55 +00:00
DynamicColorListTile(),
2023-01-23 17:36:40 +00:00
],
),
2023-01-23 17:57:26 +00:00
SettingsSection(
2023-01-23 17:36:40 +00:00
title: S.of(context).about,
2023-01-23 17:57:26 +00:00
children: const [
SourceCodeListTile(),
ReportIssueListTile(),
2023-01-23 18:35:47 +00:00
WriteEmailListTile(),
2023-01-23 17:57:26 +00:00
VersionListTile(),
2023-01-23 17:36:40 +00:00
],
),
2022-12-17 18:05:50 +00:00
],
),
),
],
),
2022-10-30 18:23:06 +00:00
),
);
}
}