Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
org.benoitharrault.twister
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.twister
Commits
3c9ba01e
Commit
3c9ba01e
authored
Jan 1, 2024
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Update/improve application architecture
parent
0437b14e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!11
Resolve "Update/improve application architecture"
Pipeline
#4795
passed
Jan 2, 2024
Stage: update
Stage: build-debug
Changes
44
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/ui/widgets/bottom_nav_bar.dart
+47
-0
47 additions, 0 deletions
lib/ui/widgets/bottom_nav_bar.dart
lib/utils/game_utils.dart
+0
-18
0 additions, 18 deletions
lib/utils/game_utils.dart
pubspec.lock
+165
-40
165 additions, 40 deletions
pubspec.lock
pubspec.yaml
+24
-6
24 additions, 6 deletions
pubspec.yaml
with
236 additions
and
64 deletions
lib/ui/widgets/bottom_nav_bar.dart
0 → 100644
+
47
−
0
View file @
3c9ba01e
import
'package:easy_localization/easy_localization.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:twister/cubit/bottom_nav_cubit.dart'
;
import
'package:twister/ui/screens/home.dart'
;
class
BottomNavBar
extends
StatelessWidget
{
const
BottomNavBar
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Card
(
margin:
const
EdgeInsets
.
only
(
top:
1
,
right:
4
,
left:
4
),
elevation:
4
,
shadowColor:
Theme
.
of
(
context
)
.
colorScheme
.
shadow
,
color:
Theme
.
of
(
context
)
.
colorScheme
.
surfaceVariant
,
shape:
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
16
),
topRight:
Radius
.
circular
(
16
),
),
),
child:
BlocBuilder
<
BottomNavCubit
,
int
>(
builder:
(
BuildContext
context
,
int
state
)
{
return
BottomNavigationBar
(
currentIndex:
state
,
onTap:
(
int
index
)
=
>
context
.
read
<
BottomNavCubit
>()
.
updateIndex
(
index
),
type:
BottomNavigationBarType
.
fixed
,
elevation:
0
,
backgroundColor:
Colors
.
transparent
,
selectedItemColor:
Theme
.
of
(
context
)
.
colorScheme
.
primary
,
unselectedItemColor:
Theme
.
of
(
context
)
.
textTheme
.
bodySmall
!.
color
,
items:
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
ScreenHome
.
navBarIcon
,
label:
tr
(
ScreenHome
.
navBarText
),
),
BottomNavigationBarItem
(
icon:
ScreenHome
.
navBarIcon
,
label:
tr
(
ScreenHome
.
navBarText
),
),
],
);
}),
);
}
}
This diff is collapsed.
Click to expand it.
lib/utils/game_utils.dart
deleted
100644 → 0
+
0
−
18
View file @
0437b14e
import
'../provider/data.dart'
;
class
GameUtils
{
static
Future
<
void
>
resetGame
(
Data
myProvider
)
async
{
myProvider
.
updateGameIsRunning
(
false
);
}
static
Future
<
void
>
startGame
(
Data
myProvider
)
async
{
print
(
'Starting game'
);
print
(
'- level: '
+
myProvider
.
level
);
myProvider
.
resetGame
();
myProvider
.
updateGameIsRunning
(
true
);
}
}
This diff is collapsed.
Click to expand it.
pubspec.lock
+
165
−
40
View file @
3c9ba01e
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
a
sync
:
a
rgs
:
dependency: transitive
description:
name: a
sync
sha256:
"947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
name: a
rgs
sha256:
eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.11.0"
version: "2.4.2"
bloc:
dependency: transitive
description:
name: bloc
sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49"
url: "https://pub.dev"
source: hosted
version: "8.1.2"
characters:
dependency: transitive
description:
...
...
@@ -17,14 +25,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.18.0"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.3"
easy_localization:
dependency: "direct main"
description:
name: easy_localization
sha256: de63e3b422adfc97f256cbb3f8cf12739b6a4993d390f3cadb3f51837afaefe5
url: "https://pub.dev"
source: hosted
version: "3.0.3"
easy_logger:
dependency: transitive
description:
name: easy_logger
sha256: c764a6e024846f33405a2342caf91c62e357c24b02c04dbc712ef232bf30ffb7
url: "https://pub.dev"
source: hosted
version: "0.0.2"
equatable:
dependency: "direct main"
description:
name: equatable
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
url: "https://pub.dev"
source: hosted
version: "
1.17.2
"
version: "
2.0.5
"
ffi:
dependency: transitive
description:
...
...
@@ -37,20 +85,57 @@ packages:
dependency: transitive
description:
name: file
sha256: "
1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d
"
sha256: "
5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c
"
url: "https://pub.dev"
source: hosted
version: "
6.1.4
"
version: "
7.0.0
"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_bloc:
dependency: "direct main"
description:
name: flutter_bloc
sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae
url: "https://pub.dev"
source: hosted
version: "8.1.3"
flutter_localizations:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
hive:
dependency: transitive
description:
name: hive
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
hydrated_bloc:
dependency: "direct main"
description:
name: hydrated_bloc
sha256: c925e49704c052a8f249226ae7603f86bfa776b910816390763b956c71d2cbaf
url: "https://pub.dev"
source: hosted
version: "9.1.3"
intl:
dependency: transitive
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev"
source: hosted
version: "0.18.1"
material_color_utilities:
dependency: transitive
description:
...
...
@@ -63,10 +148,10 @@ packages:
dependency: transitive
description:
name: meta
sha256:
"3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256:
a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.
9.1
"
version: "1.
10.0
"
nested:
dependency: transitive
description:
...
...
@@ -75,14 +160,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
overlay_support:
dependency: "direct main"
description:
name: overlay_support
sha256: fc39389bfd94e6985e1e13b2a88a125fc4027608485d2d4e2847afe1b2bb339c
url: "https://pub.dev"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
...
...
@@ -91,6 +168,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.8.3"
path_provider:
dependency: "direct main"
description:
name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
path_provider_linux:
dependency: transitive
description:
...
...
@@ -119,34 +220,34 @@ packages:
dependency: transitive
description:
name: platform
sha256:
ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
sha256:
"0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
url: "https://pub.dev"
source: hosted
version: "3.1.
2
"
version: "3.1.
3
"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256:
da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
sha256:
f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8
url: "https://pub.dev"
source: hosted
version: "2.1.
6
"
version: "2.1.
7
"
provider:
dependency:
"direct main"
dependency:
transitive
description:
name: provider
sha256:
cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f
sha256:
"9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
url: "https://pub.dev"
source: hosted
version: "6.
0.5
"
version: "6.
1.1
"
shared_preferences:
dependency:
"direct main"
dependency:
transitive
description:
name: shared_preferences
sha256:
b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac
sha256:
"81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
url: "https://pub.dev"
source: hosted
version: "2.2.
1
"
version: "2.2.
2
"
shared_preferences_android:
dependency: transitive
description:
...
...
@@ -167,10 +268,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_linux
sha256:
c2eb5bf57a2fe9ad6988121609e47d3
e0
7
bb
3bdca5b6f8444e4cf302428a128a
sha256:
"9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164a
e0bb
93f1faa"
url: "https://pub.dev"
source: hosted
version: "2.3.
1
"
version: "2.3.
2
"
shared_preferences_platform_interface:
dependency: transitive
description:
...
...
@@ -183,23 +284,47 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256:
d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
sha256:
"7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
url: "https://pub.dev"
source: hosted
version: "2.2.
1
"
version: "2.2.
2
"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
sha256:
f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f
sha256:
"841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
url: "https://pub.dev"
source: hosted
version: "2.3.
1
"
version: "2.3.
2
"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
synchronized:
dependency: transitive
description:
name: synchronized
sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558"
url: "https://pub.dev"
source: hosted
version: "3.1.0+1"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.dev"
source: hosted
version: "1.3.2"
unicons:
dependency: "direct main"
description:
name: unicons
sha256: dbfcf93ff4d4ea19b324113857e358e4882115ab85db04417a4ba1c72b17a670
url: "https://pub.dev"
source: hosted
version: "2.1.1"
vector_math:
dependency: transitive
description:
...
...
@@ -212,18 +337,18 @@ packages:
dependency: transitive
description:
name: web
sha256:
dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
sha256:
afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.
1.4-beta
"
version: "0.
3.0
"
win32:
dependency: transitive
description:
name: win32
sha256:
"350a11abd2d1d97e0cc7a28a81b
781c
08002aa2864d9e3f192ca0ffa18b06ed3"
sha256:
b0f37db61ba2f2e9b7a
78
a
1c
aece0052564d1bc70668156cf3a29d676fe4e574
url: "https://pub.dev"
source: hosted
version: "5.
0.9
"
version: "5.
1.1
"
xdg_directories:
dependency: transitive
description:
...
...
@@ -233,5 +358,5 @@ packages:
source: hosted
version: "1.0.3"
sdks:
dart: ">=3.
1.0-185.0.dev
<4.0.0"
flutter: ">=3.
7
.0"
dart: ">=3.
2.0
<4.0.0"
flutter: ">=3.
16
.0"
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
24
−
6
View file @
3c9ba01e
name
:
twister
description
:
twister game companion
publish_to
:
'
none'
version
:
0.0.9+9
version
:
0.0.10+10
environment
:
sdk
:
'
^3.0.0'
...
...
@@ -9,11 +11,27 @@ environment:
dependencies
:
flutter
:
sdk
:
flutter
provider
:
^6.0.5
shared_preferences
:
^2.2.1
overlay_support
:
^2.1.0
easy_localization
:
^3.0.1
equatable
:
^2.0.5
flutter_bloc
:
^8.1.1
path_provider
:
^2.0.11
hydrated_bloc
:
^9.0.0
unicons
:
^2.1.1
flutter
:
uses-material-design
:
tru
e
uses-material-design
:
fals
e
assets
:
-
assets/icons/
-
assets/translations/
fonts
:
-
family
:
Nunito
fonts
:
-
asset
:
assets/fonts/Nunito-Bold.ttf
weight
:
700
-
asset
:
assets/fonts/Nunito-Medium.ttf
weight
:
500
-
asset
:
assets/fonts/Nunito-Regular.ttf
weight
:
400
-
asset
:
assets/fonts/Nunito-Light.ttf
weight
:
300
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
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
sign in
to comment