Skip to content

Commit 20371f5

Browse files
thamaraiselvamthamaraiselvam
authored andcommitted
created constant file moved all colors there
overall app maintained same color
1 parent fce2884 commit 20371f5

File tree

9 files changed

+239
-188
lines changed

9 files changed

+239
-188
lines changed

TODO

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11

22
Todo:
33
☐ Replace Wrap to somethings else
4-
☐ Design Home page
54
☐ Vibrate when wrong item selected
65
☐ Store recent scores in local storage
7-
☐ Plan/remove Rank
8-
☐ Icon rethink
96
☐ Code refactor
107
☐ Add constant file
118
☐ Write test cases

lib/main.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import 'package:flutter/services.dart';
12
import 'package:numbers/screens/GameScreen.dart';
23
import 'package:numbers/screens/HowToScreen.dart';
34
import 'package:numbers/screens/LoadingScreen.dart';
45
import 'package:flutter/material.dart';
56
import 'package:numbers/screens/SplashScreen.dart';
67
import 'package:numbers/screens/homeScreen.dart';
78

8-
void main() => runApp(new MaterialApp(
9+
Future<void> main() async {
10+
SystemChrome.setPreferredOrientations([
11+
DeviceOrientation.portraitUp,
12+
DeviceOrientation.portraitDown,
13+
]);
14+
runApp(
15+
new MaterialApp(
916
initialRoute: '/',
1017
routes: <String, WidgetBuilder> {
1118
'/': (BuildContext context) => SplashScreen(),
@@ -15,3 +22,4 @@ void main() => runApp(new MaterialApp(
1522
'/howTo': (BuildContext context) => HowToScreen(),
1623
},
1724
));
25+
}

lib/screens/GameScreen.dart

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:async';
22
import 'package:numbers/schema/blackSchema.dart';
3+
import 'package:numbers/utils/constants.dart';
34
import 'package:numbers/widgets/bgGradient.dart';
45
import 'package:numbers/provider/BlockDataStream.dart';
56
import 'package:numbers/widgets/targetBlockBuilder.dart';
@@ -28,7 +29,35 @@ class _GameScreenState extends State<GameScreen> {
2829
this.listenBlockChanges();
2930
}
3031

31-
void initTimer() {
32+
@override
33+
Widget build(BuildContext context) {
34+
return SafeArea(
35+
child: Scaffold(
36+
body: Container(
37+
height: double.infinity,
38+
decoration: bgBoxDecoration(),
39+
child: SingleChildScrollView(
40+
child: Column(
41+
children: <Widget>[
42+
SizedBox(
43+
height: 10,
44+
),
45+
_headerInfo(),
46+
SizedBox(
47+
height: 10,
48+
),
49+
buildTargetBlock(
50+
title: 'Target', targetValue: this.blockSchema.target),
51+
buildNumberBlocks()
52+
],
53+
),
54+
),
55+
),
56+
),
57+
);
58+
}
59+
60+
void initTimer() {
3261
this.gameTimerObject = Timer.periodic(Duration(seconds: 1), (timer) {
3362
setState(() {
3463
this.secCounter--;
@@ -129,39 +158,14 @@ class _GameScreenState extends State<GameScreen> {
129158
this.blocks[selectedIndex].color = color;
130159
}
131160

132-
@override
133-
Widget build(BuildContext context) {
134-
return SafeArea(
135-
child: Scaffold(
136-
body: Container(
137-
decoration: bgBoxDecoration(),
138-
child: Column(
139-
children: <Widget>[
140-
SizedBox(
141-
height: 10,
142-
),
143-
_headerInfo(),
144-
SizedBox(
145-
height: 10,
146-
),
147-
buildTargetBlock(
148-
title: 'Target', targetValue: this.blockSchema.target),
149-
buildNumberBlocks()
150-
],
151-
),
152-
),
153-
),
154-
);
155-
}
156-
157161
Row _headerInfo() {
158162
return Row(
159163
mainAxisAlignment: MainAxisAlignment.center,
160164
children: <Widget>[
161165
Container(
162166
padding: const EdgeInsets.only(left: 15, right: 10),
163167
width: 100,
164-
color: Colors.red,
168+
color: blackLowOpacity,
165169
child: Row(
166170
children: <Widget>[
167171
Text(
@@ -181,7 +185,7 @@ class _GameScreenState extends State<GameScreen> {
181185
margin: const EdgeInsets.only(left: 10),
182186
padding: const EdgeInsets.only(left: 15, right: 10),
183187
width: 100,
184-
color: Colors.green,
188+
color: blackLowOpacity,
185189
child: Row(
186190
children: <Widget>[
187191
Text(

0 commit comments

Comments
 (0)