chnages has been made
This commit is contained in:
@@ -5,13 +5,36 @@ import 'core/di/injection_container.dart';
|
||||
import 'presentation/screens/splash_screen.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||
try {
|
||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||
|
||||
// Initialize dependency injection
|
||||
await initializeDependencies();
|
||||
// Initialize dependency injection
|
||||
await initializeDependencies();
|
||||
|
||||
runApp(const CodaApp());
|
||||
runApp(const CodaApp());
|
||||
} catch (e) {
|
||||
debugPrint('CRITICAL INITIALIZATION ERROR: $e');
|
||||
// If initialization fails, show a simple error screen instead of a broken app
|
||||
runApp(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Text(
|
||||
'Failed to start the app. Please try: \n1. flutter clean\n2. flutter pub get\n\nError: $e',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
// Ensure splash is removed so user can see the error
|
||||
FlutterNativeSplash.remove();
|
||||
}
|
||||
}
|
||||
|
||||
class CodaApp extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user