Files
rasadyar_application/lib/main.dart

69 lines
2.0 KiB
Dart
Raw Normal View History

2025-03-12 14:09:03 +03:30
import 'package:flutter/material.dart';
import 'package:rasadyar_app/presentation/routes/app_pages.dart';
2025-05-18 09:32:43 +03:30
import 'package:rasadyar_auth/auth.dart';
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
2025-05-17 17:07:44 +03:30
import 'package:rasadyar_core/core.dart';
2025-05-14 11:44:46 +03:30
import 'infrastructure/di/di.dart';
2025-05-17 17:07:44 +03:30
import 'infrastructure/service/auth_service.dart';
2025-05-14 11:44:46 +03:30
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
2025-05-14 11:44:46 +03:30
await setupInjection();
2025-05-18 09:32:43 +03:30
Get.put(TokenStorageService());
var tokenService = Get.find<TokenStorageService>();
await tokenService.init();
Get.put(AuthMiddleware());
2025-05-17 17:07:44 +03:30
Get.put(AuthService());
runApp(MyApp());
2025-04-26 16:50:19 +03:30
// runApp(DevicePreview(builder: (context) => ForDevicePreview(),));
2025-04-21 15:45:15 +03:30
}
2025-04-26 09:45:28 +03:30
/*class ForDevicePreview extends StatelessWidget {
2025-04-21 15:45:15 +03:30
const ForDevicePreview({super.key});
@override
Widget build(BuildContext context) {
return GetMaterialApp(
useInheritedMediaQuery: true,
locale: DevicePreview.locale(context),
builder: DevicePreview.appBuilder,
title: 'رصدیار',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: AppColor.blueNormal),
),
initialRoute: AppPages.initRoutes,
initialBinding: BindingsBuilder.put(() => UserService()),
getPages: AppPages.pages,
);
}
2025-04-26 09:45:28 +03:30
}*/
2025-03-12 14:09:03 +03:30
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'رصدیار',
2025-03-12 14:09:03 +03:30
theme: ThemeData(
fontFamily: 'yekan',
colorScheme: ColorScheme.fromSeed(seedColor: AppColor.blueNormal),
),
initialRoute: AppPages.initRoutes,
getPages: AppPages.pages,
locale: const Locale("fa", "IR"),
2025-05-14 11:44:46 +03:30
supportedLocales: const [Locale("fa", "IR")],
2025-04-26 16:50:19 +03:30
localizationsDelegates: [
PersianMaterialLocalizations.delegate,
PersianCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
2025-04-26 16:50:19 +03:30
],
);
}
}