2026-03-08 21:55:52 +05:30
|
|
|
import 'package:firebase_core/firebase_core.dart';
|
2026-01-12 14:12:41 +05:30
|
|
|
import 'package:flutter/material.dart';
|
2026-02-23 19:23:30 +05:30
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
import 'package:real_estate_mobile/config/app_config.dart';
|
2026-03-09 06:04:54 +05:30
|
|
|
import 'package:real_estate_mobile/config/firebase_config.dart';
|
2026-02-23 19:23:30 +05:30
|
|
|
import 'package:real_estate_mobile/core/theme/app_theme.dart';
|
|
|
|
|
import 'package:real_estate_mobile/routing/app_router.dart';
|
|
|
|
|
|
|
|
|
|
Future<void> mainCommon(Flavor flavor) async {
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
await AppConfig.init(flavor);
|
2026-03-09 06:04:54 +05:30
|
|
|
|
|
|
|
|
// Initialize Firebase — iOS may fail if no iOS app configured in Firebase Console
|
|
|
|
|
try {
|
|
|
|
|
await Firebase.initializeApp(options: FirebaseConfig.currentOptions);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
debugPrint('[Firebase] Init failed (expected on iOS without config): $e'); // ignore: avoid_print
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-23 19:23:30 +05:30
|
|
|
runApp(const ProviderScope(child: MyApp()));
|
2026-01-12 14:12:41 +05:30
|
|
|
}
|
|
|
|
|
|
2026-02-24 03:19:55 +05:30
|
|
|
class MyApp extends ConsumerWidget {
|
2026-01-12 14:12:41 +05:30
|
|
|
const MyApp({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
2026-02-24 03:19:55 +05:30
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
final router = ref.watch(routerProvider);
|
|
|
|
|
|
2026-02-23 19:23:30 +05:30
|
|
|
return MaterialApp.router(
|
|
|
|
|
title: 'RE-QuestN',
|
|
|
|
|
theme: AppTheme.light,
|
2026-02-24 03:19:55 +05:30
|
|
|
routerConfig: router,
|
2026-02-23 19:23:30 +05:30
|
|
|
debugShowCheckedModeBanner: false,
|
2026-01-12 14:12:41 +05:30
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|