feat: Refactor code structure and optimize performance across multiple modules
This commit is contained in:
37
mobile-apps/staff-app/lib/app.dart
Normal file
37
mobile-apps/staff-app/lib/app.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:krow/core/application/routing/routes.dart';
|
||||
import 'package:krow/core/presentation/styles/theme.dart';
|
||||
|
||||
import 'core/presentation/widgets/restart_widget.dart';
|
||||
BuildContext? appContext;
|
||||
class KrowApp extends StatefulWidget {
|
||||
const KrowApp({super.key});
|
||||
|
||||
@override
|
||||
State<KrowApp> createState() => _KrowAppState();
|
||||
}
|
||||
|
||||
class _KrowAppState extends State<KrowApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp.router(
|
||||
localizationsDelegates: context.localizationDelegates,
|
||||
supportedLocales: context.supportedLocales,
|
||||
locale: context.locale,
|
||||
routerConfig: appRouter.config(),
|
||||
theme: KWTheme.lightTheme,
|
||||
builder: (context, child) {
|
||||
appContext = context;
|
||||
return RestartWidget(child: child!);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final appRouter = AppRouter();
|
||||
Reference in New Issue
Block a user