Update codebase

This commit is contained in:
Hamza-Ayed
2026-08-05 14:12:41 +03:00
parent 58928cd258
commit 95e2e4f35d
51 changed files with 3141 additions and 390 deletions
+15 -1
View File
@@ -25,6 +25,8 @@ import 'api/antlaq_api.dart';
import 'api/api_client.dart';
import 'build_config.dart';
import 'location/location_service.dart';
import '../features/trip/data/recent_places_store.dart';
import 'notifications/notification_store.dart';
import 'notifications/push_service.dart';
import 'realtime/realtime_service.dart';
import 'session/session_cubit.dart';
@@ -79,7 +81,12 @@ Future<void> setupInjector() async {
sl.registerSingleton<RealtimeService>(RealtimeService(tokens));
sl.registerSingleton<TenantCubit>(TenantCubit(sl(), prefs));
sl.registerSingleton<PushService>(PushService(sl()));
// الصندوق يُحمَّل قبل `PushService` كي لا يضيع إشعارٌ يصل أثناء الإقلاع.
final notifications = NotificationStore();
await notifications.load();
sl.registerSingleton<NotificationStore>(notifications);
sl.registerSingleton<PushService>(PushService(sl(), notifications));
sl.registerSingleton<HistoryRepository>(HistoryRepository(sl()));
sl.registerFactory<HistoryCubit>(() => HistoryCubit(sl()));
@@ -105,11 +112,18 @@ Future<void> setupInjector() async {
sl.registerFactory<WalletCubit>(() => WalletCubit(sl()));
}
// الأماكن الأخيرة تُحمَّل مرة واحدة عند الإقلاع: الشاشة الرئيسية تقرأها
// في أول إطار، وقراءةُ القرص وقتها تعني صفّاً يقفز بعد الرسم.
final recents = RecentPlacesStore();
await recents.load();
sl.registerSingleton<RecentPlacesStore>(recents);
sl.registerFactory<RideCubit>(() => RideCubit(
trips: sl(),
maps: sl(),
location: sl(),
realtime: sl(),
recents: sl(),
));
}