This commit is contained in:
parent
b428e996f0
commit
a957126d90
@ -1 +1 @@
|
||||
const String app_title = "Repertory Management Portal";
|
||||
const String appTitle = "Repertory Management Portal";
|
||||
|
@ -4,6 +4,7 @@ import 'package:provider/provider.dart';
|
||||
import 'package:repertory/constants.dart' as constants;
|
||||
import 'package:repertory/models/mount_list.dart';
|
||||
import 'package:repertory/widgets/mount_list_widget.dart';
|
||||
import 'package:repertory/widgets/mount_settings.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
@ -15,11 +16,23 @@ class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: constants.app_title,
|
||||
title: constants.appTitle,
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
||||
),
|
||||
home: const MyHomePage(title: constants.app_title),
|
||||
initialRoute: '/',
|
||||
routes: {'/': (context) => const MyHomePage(title: constants.appTitle)},
|
||||
onGenerateRoute: (settings) {
|
||||
if (settings.name == '/settings') {
|
||||
// final args = settings.arguments as ScreenArguments;
|
||||
return MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return MountSettingsWidget(title: constants.appTitle);
|
||||
},
|
||||
);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
38
web/repertory/lib/widgets/mount_settings.dart
Normal file
38
web/repertory/lib/widgets/mount_settings.dart
Normal file
@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:settings_ui/settings_ui.dart';
|
||||
|
||||
class MountSettingsWidget extends StatelessWidget {
|
||||
final String title;
|
||||
const MountSettingsWidget({super.key, required this.title});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
||||
title: Text(title),
|
||||
),
|
||||
body: SettingsList(
|
||||
shrinkWrap: false,
|
||||
sections: [
|
||||
SettingsSection(
|
||||
title: Text('Common'),
|
||||
tiles: <SettingsTile>[
|
||||
SettingsTile.navigation(
|
||||
leading: Icon(Icons.language),
|
||||
title: Text('Language'),
|
||||
value: Text('English'),
|
||||
),
|
||||
SettingsTile.switchTile(
|
||||
onToggle: (value) {},
|
||||
initialValue: true,
|
||||
leading: Icon(Icons.format_paint),
|
||||
title: Text('Enable custom theme'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -34,7 +34,9 @@ class _MountWidgetState extends State<MountWidget> {
|
||||
isThreeLine: isActive,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.settings, color: textColor),
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, '/settings');
|
||||
},
|
||||
),
|
||||
subtitle:
|
||||
isActive
|
||||
|
@ -171,6 +171,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
settings_ui:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: settings_ui
|
||||
sha256: d9838037cb554b24b4218b2d07666fbada3478882edefae375ee892b6c820ef3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
@ -37,6 +37,7 @@ dependencies:
|
||||
collection: ^1.19.1
|
||||
http: ^1.3.0
|
||||
provider: ^6.1.2
|
||||
settings_ui: ^2.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
x
Reference in New Issue
Block a user