You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.8 KiB
Dart
60 lines
1.8 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:test_sa/providers/settings_provider.dart';
|
|
import 'package:test_sa/screens/splash_screen/splash_screen.dart';
|
|
|
|
import 'core/app_configs/app_localizations.dart';
|
|
import 'core/app_configs/app_routes.dart';
|
|
import 'core/app_configs/app_theme.dart';
|
|
import 'core/utils/provider_scope.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
if (Platform.isIOS) {
|
|
await Firebase.initializeApp(
|
|
options: const FirebaseOptions(
|
|
apiKey: "AIzaSyACQkSleNwU1jzEKR5ho1uSfZERokwwAbc",
|
|
appId: "1:973582662416:ios:bc4a8061444c6a08fbc395",
|
|
messagingSenderId: "973582662416",
|
|
projectId: "atoms-fb912",
|
|
),
|
|
);
|
|
} else {
|
|
await Firebase.initializeApp();
|
|
}
|
|
runApp(const EntryPoint());
|
|
}
|
|
|
|
class EntryPoint extends StatelessWidget {
|
|
const EntryPoint({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ProviderScope(
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
FocusManager.instance.primaryFocus?.unfocus();
|
|
}
|
|
},
|
|
child: Consumer<SettingsProvider>(
|
|
builder: (context, settingProvider, _) => MaterialApp(
|
|
title: 'ATOMS',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: AppTheme.theme,
|
|
localizationsDelegates: AppLocalizations.delegates,
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
locale: settingProvider.locale,
|
|
initialRoute: SplashScreen.routeName,
|
|
routes: appRoutes,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|