Files
Krow-workspace/apps/mobile/apps/staff/lib/main.dart
Achintha Isuru 3b11c49d90 Refactor navigation and remove unused navigator extensions across staff features
- Removed background color from CreateOrderView, OneTimeOrderView, and RapidOrderView.
- Updated navigation paths in OneTimeOrderView and other staff authentication pages to use new constants.
- Deleted unused navigator extensions for staff authentication, home, profile, and shifts.
- Refactored navigation in StaffMainModule to use new path constants.
- Cleaned up imports and adjusted navigation calls in various staff-related pages and widgets.
2026-02-04 18:22:39 -05:00

75 lines
2.7 KiB
Dart

import 'package:core_localization/core_localization.dart' as core_localization;
import 'package:design_system/design_system.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krowwithus_staff/firebase_options.dart';
import 'package:staff_authentication/staff_authentication.dart'
as staff_authentication;
import 'package:staff_main/staff_main.dart' as staff_main;
import 'package:krow_core/core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(ModularApp(module: AppModule(), child: const AppWidget()));
}
/// The main application module.
class AppModule extends Module {
@override
List<Module> get imports => <Module>[core_localization.LocalizationModule()];
@override
void routes(RouteManager r) {
// Set the initial route to the authentication module
r.module(StaffPaths.root, module: staff_authentication.StaffAuthenticationModule());
r.module(StaffPaths.main, module: staff_main.StaffMainModule());
}
}
class AppWidget extends StatelessWidget {
const AppWidget({super.key});
@override
Widget build(BuildContext context) {
return WebMobileFrame(
appName: 'KROW Staff\nApplication',
logo: Image.asset('assets/logo.png'),
child: BlocProvider<core_localization.LocaleBloc>(
create: (BuildContext context) =>
Modular.get<core_localization.LocaleBloc>(),
child:
BlocBuilder<
core_localization.LocaleBloc,
core_localization.LocaleState
>(
builder:
(BuildContext context, core_localization.LocaleState state) {
return core_localization.TranslationProvider(
child: MaterialApp.router(
title: "KROW Staff",
theme: UiTheme.light,
routerConfig: Modular.routerConfig,
locale: state.locale,
supportedLocales: state.supportedLocales,
localizationsDelegates:
const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
),
);
},
),
),
);
}
}