mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 08:54:54 +00:00
- Refactor device control logic in the app to improve readability and maintainability. - Add temperature modes (hot, cold, wind) and fan speeds (auto, low, middle, high) enums. - Update icon mappings and utility functions for temperature modes and fan speeds.
41 lines
1.4 KiB
Dart
41 lines
1.4 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/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(
|
|
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', ''),
|
|
),
|
|
);
|
|
}
|
|
}
|