Solian/lib/main.dart

45 lines
1.3 KiB
Dart
Raw Normal View History

2024-05-18 10:17:16 +00:00
import 'package:flutter/material.dart';
2024-05-18 14:23:36 +00:00
import 'package:get/get.dart';
import 'package:solian/providers/auth.dart';
2024-05-18 10:17:16 +00:00
import 'package:solian/router.dart';
import 'package:solian/theme.dart';
import 'package:solian/translations.dart';
void main() {
runApp(const SolianApp());
}
class SolianApp extends StatelessWidget {
const SolianApp({super.key});
@override
Widget build(BuildContext context) {
return GetMaterialApp.router(
title: 'Solian',
theme: SolianTheme.build(Brightness.light),
darkTheme: SolianTheme.build(Brightness.dark),
themeMode: ThemeMode.system,
routerDelegate: AppRouter.instance.routerDelegate,
routeInformationParser: AppRouter.instance.routeInformationParser,
routeInformationProvider: AppRouter.instance.routeInformationProvider,
translations: SolianMessages(),
locale: Get.deviceLocale,
fallbackLocale: const Locale('en', 'US'),
2024-05-18 14:23:36 +00:00
onInit: () {
Get.lazyPut(() => AuthProvider());
},
2024-05-18 10:17:16 +00:00
builder: (context, child) {
return Overlay(
initialEntries: [
OverlayEntry(
builder: (context) => ScaffoldMessenger(
child: child ?? Container(),
),
),
],
);
},
);
}
}