[919e07]: / lib / main.dart

Download this file

42 lines (38 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ignore_for_file: depend_on_referenced_packages
import 'package:flutter/material.dart';
import 'package:animated_splash_screen/animated_splash_screen.dart';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:firebase_core/firebase_core.dart';
import 'Onboarding/onboarding_screen.dart';
int? isviewed;
void main() async {
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
WidgetsFlutterBinding.ensureInitialized();
SharedPreferences prefs = await SharedPreferences.getInstance();
isviewed = prefs.getInt('onBoard');
await Firebase.initializeApp();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Cardio',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: AnimatedSplashScreen(
splash: Image.asset(
'assets/images/name.png',
fit: BoxFit.fill,
),
nextScreen: OnboardingScreen(),
splashTransition: SplashTransition.fadeTransition,
duration: 2000,
));
}
}