flutter(rider): rebuild lib on Cubit/Bloc + Tripz backend (core + auth slice)
- keep store identity (com.mobileapp.store.ride, shorebird, firebase, fonts); old lib -> lib_old_getx - core: config/di/router(go_router)/theme/api_client(dio+tenant+bearer)/token_store(secure) - auth: repo + AuthCubit + OTP phone/otp screens; home: flutter_map (OSM placeholder, انطلق TODO) - android usesCleartextTraffic=true for http API; maps=flutter_map (no Google), state=Cubit Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'core/di.dart';
|
||||
import 'core/router.dart';
|
||||
import 'core/theme.dart';
|
||||
import 'features/auth/cubit/auth_cubit.dart';
|
||||
import 'features/auth/data/auth_repository.dart';
|
||||
|
||||
class TripzApp extends StatelessWidget {
|
||||
const TripzApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (_) => AuthCubit(getIt<AuthRepository>())..checkAuth(),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
final router = buildRouter(context.read<AuthCubit>());
|
||||
return MaterialApp.router(
|
||||
title: 'Tripz',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: buildTheme(),
|
||||
locale: const Locale('ar'),
|
||||
supportedLocales: const [Locale('ar'), Locale('en')],
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
builder: (context, child) => Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: child!,
|
||||
),
|
||||
routerConfig: router,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user