This repository has been archived on 2025-08-25. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Seshat/lib/main.dart
2025-08-18 23:06:25 +02:00

92 lines
2.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import 'package:seshat/config/dependencies.dart';
import 'package:seshat/routing/router.dart';
void main() async {
Logger.root.level = Level.ALL;
WidgetsFlutterBinding.ensureInitialized();
runApp(MultiProvider(providers: providers, child: const MyApp()));
// runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp.router(
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [const Locale("fr")],
routerConfig: router(context.read()),
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
themeMode: ThemeMode.system,
);
}
}
// class Root extends StatefulWidget {
// const Root({super.key});
// @override
// State<Root> createState() => _RootState();
// }
// class _RootState extends State<Root> {
// var selectedIndex = 1;
// @override
// Widget build(BuildContext context) {
// final theme = Theme.of(context);
// return AnnotatedRegion(
// value: SystemUiOverlayStyle(
// statusBarBrightness: Brightness.light,
// statusBarIconBrightness: Brightness.light,
// ),
// child: Scaffold(
// appBar: null,
// bottomNavigationBar: NavigationBar(
// destinations: const <Widget>[
// NavigationDestination(icon: Icon(Icons.home), label: "Home"),
// NavigationDestination(
// icon: Icon(Icons.plus_one_outlined),
// label: "Ajout",
// ),
// NavigationDestination(icon: Icon(Icons.sell), label: "Vente"),
// ],
// selectedIndex: selectedIndex,
// onDestinationSelected: (int index) {
// setState(() {
// selectedIndex = index;
// });
// },
// indicatorColor: theme.highlightColor,
// ),
// body: switch (selectedIndex) {
// 0 => Add(title: "Home Page"),
// 1 => MultiProvider(
// providers: [
// ChangeNotifierProvider(
// create: (context) => TabScreen("scanPage"),
// ),
// ChangeNotifierProvider(
// create: (context) =>
// Owner("UEAuvergne", "unionetudianteauvergne@gmail.com"),
// ),
// ],
// child: Add(title: "Ajout"),
// ),
// _ => Add(title: "Wildcard"),
// },
// ),
// );
// }
// }