more refactors and logs page handling
This commit is contained in:
@@ -5,18 +5,18 @@ import 'package:material_symbols_icons/symbols.dart';
|
||||
|
||||
enum SettingSection {
|
||||
general._(
|
||||
icon: Symbols.interests_rounded,
|
||||
labelKey: 'settings.sections.general',
|
||||
icon: Symbols.interests_rounded,
|
||||
destination: GeneralSettingsRoute(),
|
||||
),
|
||||
advance._(
|
||||
icon: Symbols.build_rounded,
|
||||
labelKey: 'settings.sections.advance',
|
||||
icon: Symbols.build_rounded,
|
||||
destination: AdvanceSettingsRoute(),
|
||||
),
|
||||
about._(
|
||||
icon: Symbols.help_rounded,
|
||||
labelKey: 'settings.sections.about',
|
||||
icon: Symbols.help_rounded,
|
||||
destination: AboutSettingsRoute(),
|
||||
);
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ class AboutSettingsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const ImAdaptiveRouteSecondaryAppBar(),
|
||||
appBar: const ImAdaptiveRouteAppBar(isPrimary: false),
|
||||
body: ListTile(
|
||||
title: Text(context.t.settings.about.third_party_title),
|
||||
subtitle: Text(context.t.settings.about.third_party_sub_title),
|
||||
onTap: () => showLicensePage(
|
||||
context: context,
|
||||
applicationName: context.t.immich,
|
||||
applicationIcon: const ImLogo(width: SizeConstants.xl),
|
||||
applicationIcon: const ImLogo(dimension: SizeConstants.xl),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ class AdvanceSettingsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
appBar: ImAdaptiveRouteSecondaryAppBar(),
|
||||
appBar: ImAdaptiveRouteAppBar(isPrimary: false),
|
||||
body: Center(child: Text('Advanced Settings')),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ class GeneralSettingsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
appBar: ImAdaptiveRouteSecondaryAppBar(),
|
||||
appBar: ImAdaptiveRouteAppBar(isPrimary: false),
|
||||
body: Center(child: Text('General Settings')),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:immich_mobile/i18n/strings.g.dart';
|
||||
@@ -15,32 +17,31 @@ class SettingsWrapperPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ImAdaptiveRouteWrapper(
|
||||
primaryBody: (_) => const SettingsPage(),
|
||||
primaryRoute: SettingsRoute.name,
|
||||
bodyRatio: BodyRatioConstants.oneThird,
|
||||
primaryBody: (_) => const SettingsPage(),
|
||||
bodyRatio: RatioConstants.oneThird,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@RoutePage()
|
||||
// ignore: prefer-single-widget-per-file
|
||||
class SettingsPage extends StatelessWidget {
|
||||
const SettingsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const ImAdaptiveRoutePrimaryAppBar(),
|
||||
appBar: const ImAdaptiveRouteAppBar(isPrimary: true),
|
||||
body: ListView.builder(
|
||||
itemCount: SettingSection.values.length,
|
||||
itemBuilder: (_, index) {
|
||||
final section = SettingSection.values.elementAt(index);
|
||||
return ListTile(
|
||||
title: Text(context.t[section.labelKey]),
|
||||
onTap: () => context.navigateRoot(section.destination),
|
||||
leading: Icon(section.icon),
|
||||
title: Text(context.t[section.labelKey]),
|
||||
onTap: () => unawaited(context.navigateRoot(section.destination)),
|
||||
);
|
||||
},
|
||||
itemCount: SettingSection.values.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user