Skip to content

Commit fd2dc38

Browse files
committed
added the new themedata for main purpose
1 parent 0c91d08 commit fd2dc38

File tree

3 files changed

+42
-38
lines changed

3 files changed

+42
-38
lines changed

quiz/assets/icon.png

22.6 KB
Loading

quiz/lib/main.dart

+38-36
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
11
import 'dart:async';
2+
import 'dart:ffi';
3+
import 'dart:ui';
24

3-
import 'package:flutter/material.dart';
45
import 'package:firebase_core/firebase_core.dart';
5-
import 'package:quiz/login.dart';
6+
import 'package:flutter/material.dart';
67

7-
Future <void> main() async {
8-
WidgetsFlutterBinding.ensureInitialized();
9-
runApp(MyApp());
8+
void main() {
9+
runApp( MyApp());
1010
}
1111

1212
class MyApp extends StatelessWidget {
1313

14-
final Future<FirebaseApp> _fbApp = Firebase.initializeApp();
14+
final Future<Firebase> _fbApp = Firebase.initializeApp() as Future<Firebase>;
1515

16-
MyApp({super.key});
16+
17+
MyApp({super.key});
1718

1819
@override
1920
Widget build(BuildContext context) {
2021
return MaterialApp(
2122
debugShowCheckedModeBanner: false,
22-
theme: ThemeData(primarySwatch: Colors.cyan),
23-
title: "Programming Quiz",
24-
home: FutureBuilder(future: _fbApp,
25-
builder: ((context, snapshot) {
26-
if(snapshot.hasError){
27-
return const Text("Something went's wrong!");
28-
}
29-
else if(snapshot.hasData){
30-
return const splash();
23+
theme: ThemeData(primarySwatch: Colors.lightBlue),
24+
title: "GECOMTECH QUIZ GAME",
25+
home: FutureBuilder(
26+
future: _fbApp,
27+
builder:(context, snapshot){
28+
if(snapshot.hasError){
29+
return Text("Something Went's Wrong");
30+
}
31+
else if(snapshot.hasData){
32+
return splash();
33+
}
34+
else {
35+
return Center(child: CircularProgressIndicator(),);
36+
}
3137
}
32-
else {
33-
return const Center(child: CircularProgressIndicator(),);
34-
}
35-
36-
37-
})),
38+
),
3839
);
3940
}
4041
}
@@ -45,30 +46,31 @@ class splash extends StatefulWidget {
4546
@override
4647
State<splash> createState() => _splashState();
4748

48-
4949
}
5050

5151
class _splashState extends State<splash> {
52+
@override
53+
void initState(){
54+
super.initState();
55+
Timer(Duration(seconds: 3),(){
56+
Navigator.of(context).pushReplacement(MaterialPageRoute(
57+
builder: (context)=> login(),
58+
));
59+
});
60+
}
61+
5262

5363

54-
@override
55-
void initState(){
56-
super.initState();
57-
Timer(const Duration(seconds: 3),(){
58-
Navigator.of(context).pushReplacement(MaterialPageRoute(
59-
builder: (context)=> login(),
60-
));
61-
});
62-
}
6364

6465

6566
@override
6667
Widget build(BuildContext context) {
6768
return Scaffold(
68-
backgroundColor: Colors.white,
69+
backgroundColor: Colors.white60,
6970
body: Center(child: Image.asset(
70-
'asset/icon.png'
71-
),),
72-
);
71+
'assets/icon.png'
72+
)),
73+
74+
)
7375
}
7476
}

quiz/pubspec.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies:
3535

3636
# The following adds the Cupertino Icons font to your application.
3737
# Use with the CupertinoIcons class for iOS style icons.
38+
dependecy_overrides :
3839
cupertino_icons: ^1.0.2
3940
firebase_core: ^2.1.1
4041
connectivity_plus: ^3.0.2
@@ -65,9 +66,10 @@ flutter:
6566
uses-material-design: true
6667

6768
# To add assets to your application, add an assets section, like this:
69+
6870
# assets:
69-
# - images/a_dot_burr.jpeg
70-
# - images/a_dot_ham.jpeg
71+
# - assets/icon.png
72+
7173

7274
# An image asset can refer to one or more resolution-specific "variants", see
7375
# https://flutter.dev/assets-and-images/#resolution-aware

0 commit comments

Comments
 (0)