2024-02-10 18:29:41 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2024-02-11 01:08:51 +01:00
|
|
|
import 'package:provider/provider.dart';
|
2024-02-10 18:29:41 +01:00
|
|
|
|
2024-02-10 19:57:17 +01:00
|
|
|
import 'nav_layout.dart';
|
2024-02-11 01:08:51 +01:00
|
|
|
import 'state/app_theme.dart';
|
|
|
|
import 'state/user_account.dart';
|
2024-02-10 19:57:17 +01:00
|
|
|
|
2024-02-10 18:29:41 +01:00
|
|
|
void main() {
|
2024-02-11 01:08:51 +01:00
|
|
|
runApp(
|
|
|
|
MultiProvider(
|
|
|
|
providers: [
|
|
|
|
ChangeNotifierProvider(create: (context) => UserAccount()),
|
|
|
|
ChangeNotifierProvider(create: (context) => AppTheme()),
|
|
|
|
],
|
|
|
|
child: const SCNApp(),
|
|
|
|
),
|
|
|
|
);
|
2024-02-10 18:29:41 +01:00
|
|
|
}
|
|
|
|
|
2024-02-10 19:57:17 +01:00
|
|
|
class SCNApp extends StatelessWidget {
|
|
|
|
const SCNApp({super.key});
|
2024-02-10 18:29:41 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-02-18 16:23:10 +01:00
|
|
|
Provider.of<UserAccount>(context); // ensure UserAccount is loaded
|
|
|
|
|
2024-02-11 01:08:51 +01:00
|
|
|
return Consumer<AppTheme>(
|
|
|
|
builder: (context, appTheme, child) => MaterialApp(
|
|
|
|
title: 'SimpleCloudNotifier',
|
|
|
|
theme: ThemeData(
|
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue, brightness: appTheme.darkMode ? Brightness.dark : Brightness.light),
|
|
|
|
useMaterial3: true,
|
|
|
|
),
|
|
|
|
home: const SCNNavLayout(),
|
2024-02-10 18:29:41 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|