mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00

Refactor HTTPInterceptor to handle error responses and add a CustomSnackBar helper to display snack bars. This will improve error handling and user feedback in the application.
44 lines
1.6 KiB
Dart
44 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
|
|
import 'package:syncrow_app/navigation/navigation_service.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/theme_manager.dart';
|
|
import 'navigation/router.dart' as router;
|
|
import 'navigation/routing_constants.dart';
|
|
|
|
class MyApp extends StatelessWidget {
|
|
final Locale locale;
|
|
|
|
const MyApp(this.locale, {super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Constants.appBarHeight =
|
|
MediaQuery.sizeOf(context).height * Constants.appBarHeightPercentage;
|
|
Constants.bottomNavBarHeight = MediaQuery.sizeOf(context).height *
|
|
Constants.bottomNavBarHeightPercentage;
|
|
return BlocProvider(
|
|
create: (context) => AuthCubit(),
|
|
child: MaterialApp(
|
|
navigatorKey: NavigationService.navigatorKey,
|
|
scaffoldMessengerKey: NavigationService.snackbarKey,
|
|
debugShowCheckedModeBanner: false,
|
|
color: ColorsManager.primaryColor,
|
|
title: 'Syncrow App',
|
|
onGenerateRoute: router.Router.generateRoute,
|
|
initialRoute: Routes.splash,
|
|
themeMode: ThemeMode.system,
|
|
theme: ThemeManager.selectTheme(),
|
|
supportedLocales: const [
|
|
Locale('en', ''), // English, no country code
|
|
Locale('ar', ''), // Arabic, no country code
|
|
],
|
|
// locale: locale,
|
|
locale: const Locale('en', ''),
|
|
),
|
|
);
|
|
}
|
|
}
|