Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
org.benoitharrault.petitbac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
android
org.benoitharrault.petitbac
Commits
6ff6c462
Commit
6ff6c462
authored
May 21, 2021
by
Benoît Harrault
Browse files
Options
Downloads
Plain Diff
Merge branch '17-improve-layout-and-gameplay' into 'master'
Resolve "Improve layout and gameplay" Closes
#17
See merge request
!16
parents
69a4c3e1
237d9514
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!16
Resolve "Improve layout and gameplay"
Pipeline
#1158
passed
May 21, 2021
Stage: update
Stage: build-debug
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
android/gradle.properties
+2
-2
2 additions, 2 deletions
android/gradle.properties
lib/provider/data.dart
+1
-1
1 addition, 1 deletion
lib/provider/data.dart
lib/screens/home.dart
+47
-39
47 additions, 39 deletions
lib/screens/home.dart
with
50 additions
and
42 deletions
android/gradle.properties
+
2
−
2
View file @
6ff6c462
org.gradle.jvmargs
=
-Xmx1536M
android.useAndroidX
=
true
android.enableJetifier
=
true
app.versionName
=
1.2.
7
app.versionCode
=
1
3
app.versionName
=
1.2.
8
app.versionCode
=
1
4
This diff is collapsed.
Click to expand it.
lib/provider/data.dart
+
1
−
1
View file @
6ff6c462
...
...
@@ -7,7 +7,7 @@ class Data extends ChangeNotifier {
bool
_searchingLetter
=
false
;
String
_category
=
''
;
String
_letter
=
''
;
int
_countdown
=
0
;
int
_countdown
=
-
1
;
bool
get
searchingCategory
=
>
_searchingCategory
;
...
...
This diff is collapsed.
Click to expand it.
lib/screens/home.dart
+
47
−
39
View file @
6ff6c462
...
...
@@ -17,7 +17,7 @@ class Home extends StatelessWidget {
int
_countdownStart
=
10
;
Future
<
void
>
startMiniGame
(
Data
myProvider
)
async
{
if
(
myProvider
.
countdown
=
=
0
)
{
if
(
myProvider
.
countdown
<
=
0
)
{
pickCategory
(
myProvider
);
pickLetter
(
myProvider
);
startTimer
(
myProvider
);
...
...
@@ -34,7 +34,7 @@ class Home extends StatelessWidget {
_timer
=
new
Timer
.
periodic
(
oneSec
,
(
Timer
timer
)
{
if
(
_countdownStart
==
0
)
{
if
(
_countdownStart
<
0
)
{
timer
.
cancel
();
}
else
{
_countdownStart
--
;
...
...
@@ -87,7 +87,7 @@ class Home extends StatelessWidget {
return
hslDark
.
toColor
();
}
Container
_buildPickedLetterContainer
(
Data
myProvider
,
Color
backgroundColor
)
{
Container
_buildPickedLetterContainer
(
Data
myProvider
,
Color
backgroundColor
,
double
borderWidth
)
{
Color
borderColor
=
darken
(
backgroundColor
);
return
Container
(
...
...
@@ -96,14 +96,14 @@ class Home extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
margin:
EdgeInsets
.
all
(
15
),
padding:
EdgeInsets
.
all
(
15
),
margin:
EdgeInsets
.
all
(
borderWidth
),
padding:
EdgeInsets
.
all
(
borderWidth
),
decoration:
BoxDecoration
(
color:
backgroundColor
,
borderRadius:
BorderRadius
.
circular
(
4
),
borderRadius:
BorderRadius
.
circular
(
borderWidth
),
border:
Border
.
all
(
color:
borderColor
,
width:
4
,
width:
borderWidth
,
),
),
child:
FlatButton
(
...
...
@@ -123,8 +123,7 @@ class Home extends StatelessWidget {
);
}
Container
_buildPickedCategoryContainer
(
Data
myProvider
,
Color
backgroundColor
)
{
Container
_buildPickedCategoryContainer
(
Data
myProvider
,
Color
backgroundColor
,
double
borderWidth
)
{
Color
borderColor
=
darken
(
backgroundColor
);
return
Container
(
...
...
@@ -133,22 +132,23 @@ class Home extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
margin:
EdgeInsets
.
all
(
5
),
padding:
EdgeInsets
.
all
(
5
),
margin:
EdgeInsets
.
all
(
borderWidth
),
padding:
EdgeInsets
.
all
(
borderWidth
),
decoration:
BoxDecoration
(
color:
backgroundColor
,
borderRadius:
BorderRadius
.
circular
(
4
),
borderRadius:
BorderRadius
.
circular
(
borderWidth
),
border:
Border
.
all
(
color:
borderColor
,
width:
4
,
width:
borderWidth
,
),
),
child:
FlatButton
(
onPressed:
()
=
>
pickCategory
(
myProvider
),
child:
Text
(
myProvider
.
category
==
''
?
"🔀"
:
myProvider
.
category
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
4
0
,
fontSize:
3
0
,
fontWeight:
FontWeight
.
w600
,
color:
Colors
.
black
,
),
...
...
@@ -160,33 +160,40 @@ class Home extends StatelessWidget {
);
}
Container
_buildMiniGameContainer
(
Data
myProvider
,
Color
backgroundColor
)
{
Container
_buildMiniGameContainer
(
Data
myProvider
,
Color
backgroundColor
,
double
borderWidth
)
{
Color
borderColor
=
darken
(
backgroundColor
);
Color
countDownColor
=
Colors
.
black
;
if
(
myProvider
.
countdown
==
0
)
{
countDownColor
=
Colors
.
red
;
}
return
Container
(
margin:
EdgeInsets
.
all
(
5
),
padding:
EdgeInsets
.
all
(
5
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
margin:
EdgeInsets
.
all
(
borderWidth
),
padding:
EdgeInsets
.
all
(
borderWidth
),
decoration:
BoxDecoration
(
color:
backgroundColor
,
borderRadius:
BorderRadius
.
circular
(
4
),
borderRadius:
BorderRadius
.
circular
(
borderWidth
),
border:
Border
.
all
(
color:
borderColor
,
width:
4
,
width:
borderWidth
,
),
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
FlatButton
(
onPressed:
(
myProvider
.
countdown
!=
0
)
?
null
:
()
=
>
startMiniGame
(
myProvider
),
padding:
EdgeInsets
.
all
(
10.0
),
child:
FlatButton
(
onPressed:
(
myProvider
.
countdown
>
=
0
)
?
null
:
()
=
>
startMiniGame
(
myProvider
),
child:
Text
(
(
myProvider
.
countdown
!=
0
)
?
myProvider
.
countdown
.
toString
()
:
'🎲'
,
(
myProvider
.
countdown
>
=
0
)
?
myProvider
.
countdown
.
toString
()
:
'🎲'
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
50
,
fontWeight:
FontWeight
.
w600
,
color:
Colors
.
black
,
color:
countDownColor
,
),
),
),
),
...
...
@@ -198,6 +205,7 @@ class Home extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
Data
_myProvider
=
Provider
.
of
<
Data
>(
context
);
double
borderWidth
=
8
;
return
Scaffold
(
appBar:
AppBar
(
...
...
@@ -207,11 +215,11 @@ class Home extends StatelessWidget {
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
_buildPickedLetterContainer
(
_myProvider
,
Colors
.
orange
),
SizedBox
(
height:
20
),
_build
PickedCategory
Container
(
_myProvider
,
Colors
.
green
),
SizedBox
(
height:
40
),
_build
MiniGame
Container
(
_myProvider
,
Colors
.
blue
),
_buildPickedLetterContainer
(
_myProvider
,
Colors
.
orange
,
borderWidth
),
SizedBox
(
height:
5
),
_build
MiniGame
Container
(
_myProvider
,
Colors
.
blue
,
borderWidth
),
SizedBox
(
height:
5
),
_build
PickedCategory
Container
(
_myProvider
,
Colors
.
green
,
borderWidth
),
],
),
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment