Skip to content
Snippets Groups Projects
Commit 0040af47 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '24-use-flutter-linter-and-apply-lints' into 'master'

Resolve "Use flutter linter and apply lints"

Closes #24

See merge request !17
parents a74f4989 1baabdb6
No related branches found
No related tags found
1 merge request!17Resolve "Use flutter linter and apply lints"
Pipeline #5125 passed
Showing with 111 additions and 77 deletions
include: package:flutter_lints/flutter.yaml
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.16
app.versionCode=16
app.versionName=0.0.17
app.versionCode=17
Add automatic flutter linter. Apply code lints. Update dependencies.
Ajout d'un correcteur automatique de code. Application des correction. Mise à jour des dépendances.
......@@ -30,7 +30,7 @@ class GameCubit extends HydratedCubit<GameState> {
void deleteHistory() {
emit(GameState(
move: state.move,
history: [],
history: const [],
));
}
......
......@@ -32,22 +32,23 @@ class Move {
);
}
@override
String toString() {
return 'Move(' + this.toJson().toString() + ')';
return 'Move(${toJson()})';
}
String toSoundAsset() {
String base = 'voices/' + tr('lang_prefix') + '-';
String base = 'voices/${tr('lang_prefix')}-';
String member = this.member.toString();
String color = this.color.toString();
return base + member + '-on-' + color + '.wav';
return '$base$member-on-$color.wav';
}
Map<String, dynamic>? toJson() {
return <String, dynamic>{
'color': this.color.toString(),
'member': this.member.toString(),
'color': color.toString(),
'member': member.toString(),
};
}
}
......@@ -19,8 +19,9 @@ class TwisterColor {
return TwisterColor(value: TwisterAllowedColors.values[random]);
}
@override
String toString() {
List<String> parts = this.value.toString().split('.');
List<String> parts = value.toString().split('.');
return parts[1];
}
}
......@@ -19,8 +19,9 @@ class TwisterMember {
return TwisterMember(value: TwisterAllowedMembers.values[random]);
}
@override
String toString() {
List<String> parts = this.value.toString().split('.');
List<String> parts = value.toString().split('.');
final exp = RegExp('(?<=[a-z])[A-Z]');
return parts[1].replaceAllMapped(exp, (m) => '-${m.group(0)}').toLowerCase();
}
......
......@@ -15,10 +15,10 @@ class ScreenHome extends StatelessWidget {
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 4),
physics: const BouncingScrollPhysics(),
children: <Widget>[
const SizedBox(height: 8),
const Game(),
const SizedBox(height: 36),
children: const <Widget>[
SizedBox(height: 8),
Game(),
SizedBox(height: 36),
],
),
);
......
......@@ -19,9 +19,9 @@ class ScreenSettings extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 4),
physics: const BouncingScrollPhysics(),
children: <Widget>[
SizedBox(height: 8),
const SizedBox(height: 8),
AppTitle1(text: tr('settings_title')),
SettingsForm(),
const SettingsForm(),
],
),
);
......
......@@ -18,12 +18,12 @@ class _SkeletonScreenState extends State<SkeletonScreen> {
@override
Widget build(BuildContext context) {
List<Widget> pageNavigation = <Widget>[
ScreenHome(),
const ScreenHome(),
const ScreenSettings(),
];
return Scaffold(
appBar: StandardAppBar(),
appBar: const StandardAppBar(),
extendBodyBehindAppBar: false,
body: BlocBuilder<BottomNavCubit, int>(
builder: (BuildContext context, int state) {
......@@ -34,7 +34,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> {
},
),
backgroundColor: Theme.of(context).colorScheme.background,
bottomNavigationBar: BottomNavBar(),
bottomNavigationBar: const BottomNavBar(),
);
}
}
......@@ -9,7 +9,7 @@ class StandardAppBar extends StatelessWidget implements PreferredSizeWidget {
Widget build(BuildContext context) {
return AppBar(
title: const AppTitle(text: 'app_name'),
actions: [],
actions: const [],
);
}
......
......@@ -24,7 +24,7 @@ class _GameState extends State<Game> {
Move? shuffledMove;
void animate() {
const interval = const Duration(milliseconds: 200);
const interval = Duration(milliseconds: 200);
int iterationsLeft = 10;
shuffling = true;
......@@ -96,17 +96,17 @@ class _GameState extends State<Game> {
);
return Padding(
padding: EdgeInsets.all(30),
padding: const EdgeInsets.all(30),
child: Table(
children: [
TableRow(
children: [
Padding(
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: ShowMove(move: leftHandMove),
),
Padding(
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: ShowMove(move: rightHandMove),
),
],
......@@ -114,11 +114,11 @@ class _GameState extends State<Game> {
TableRow(
children: [
Padding(
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: ShowMove(move: leftFootMove),
),
Padding(
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: ShowMove(move: rightFootMove),
),
],
......
......@@ -48,7 +48,7 @@ class _SettingsFormState extends State<SettingsForm> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
SizedBox(height: 8),
const SizedBox(height: 8),
AppTitle2(text: tr('settings_title_game')),
// Timer value
......@@ -56,7 +56,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('settings_label_game_timer_value').tr(),
const Text('settings_label_game_timer_value').tr(),
ToggleButtons(
onPressed: (int index) {
setState(() {
......
......@@ -27,13 +27,13 @@ class ShowMove extends StatelessWidget {
}
Widget getImageWidget(Move move) {
String imageAsset = 'assets/images/' + (move.member?.toString() ?? 'blank') + '.png';
String imageAsset = 'assets/images/${move.member?.toString() ?? 'blank'}.png';
return Image.asset(imageAsset);
}
Widget getTextWidget(Move move) {
TextStyle style = TextStyle(
TextStyle style = const TextStyle(
color: Colors.black,
fontSize: 30,
fontWeight: FontWeight.bold,
......@@ -61,7 +61,7 @@ class ShowMove extends StatelessWidget {
return AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(child: child, scale: animation);
return ScaleTransition(scale: animation, child: child);
},
child: Container(
width: containerSize,
......
......@@ -77,10 +77,10 @@ packages:
dependency: transitive
description:
name: bloc
sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49"
sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e
url: "https://pub.dev"
source: hosted
version: "8.1.2"
version: "8.1.3"
characters:
dependency: transitive
description:
......@@ -117,10 +117,10 @@ packages:
dependency: "direct main"
description:
name: easy_localization
sha256: de63e3b422adfc97f256cbb3f8cf12739b6a4993d390f3cadb3f51837afaefe5
sha256: "9c86754b22aaa3e74e471635b25b33729f958dd6fb83df0ad6612948a7b231af"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.4"
easy_logger:
dependency: transitive
description:
......@@ -141,10 +141,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.2"
file:
dependency: transitive
description:
......@@ -153,6 +153,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.0"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter
......@@ -162,10 +170,18 @@ packages:
dependency: "direct main"
description:
name: flutter_bloc
sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae
sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1"
url: "https://pub.dev"
source: hosted
version: "8.1.3"
version: "8.1.4"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
url: "https://pub.dev"
source: hosted
version: "3.0.1"
flutter_localizations:
dependency: transitive
description: flutter
......@@ -177,7 +193,7 @@ packages:
source: sdk
version: "0.0.0"
hive:
dependency: transitive
dependency: "direct main"
description:
name: hive
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
......@@ -188,10 +204,10 @@ packages:
dependency: transitive
description:
name: http
sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.2.1"
http_parser:
dependency: transitive
description:
......@@ -204,10 +220,10 @@ packages:
dependency: "direct main"
description:
name: hydrated_bloc
sha256: c925e49704c052a8f249226ae7603f86bfa776b910816390763b956c71d2cbaf
sha256: "00a2099680162e74b5a836b8a7f446e478520a9cae9f6032e028ad8129f4432d"
url: "https://pub.dev"
source: hosted
version: "9.1.3"
version: "9.1.4"
intl:
dependency: transitive
description:
......@@ -224,22 +240,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
lints:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.dev"
source: hosted
version: "3.0.0"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
nested:
dependency: transitive
description:
......@@ -252,18 +276,18 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_provider:
dependency: "direct main"
description:
name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
path_provider_android:
dependency: transitive
description:
......@@ -276,10 +300,10 @@ packages:
dependency: transitive
description:
name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
path_provider_linux:
dependency: transitive
description:
......@@ -292,10 +316,10 @@ packages:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
path_provider_windows:
dependency: transitive
description:
......@@ -308,18 +332,18 @@ packages:
dependency: transitive
description:
name: platform
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
url: "https://pub.dev"
source: hosted
version: "3.1.3"
version: "3.1.4"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.7"
version: "2.1.8"
provider:
dependency: transitive
description:
......@@ -348,10 +372,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7"
sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
version: "2.3.5"
shared_preferences_linux:
dependency: transitive
description:
......@@ -364,18 +388,18 @@ packages:
dependency: transitive
description:
name: shared_preferences_platform_interface
sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a
sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.1"
shared_preferences_windows:
dependency: transitive
description:
......@@ -449,10 +473,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: "22c94e5ad1e75f9934b766b53c742572ee2677c56bc871d850a57dad0f82127f"
sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8
url: "https://pub.dev"
source: hosted
version: "4.2.2"
version: "4.3.3"
vector_math:
dependency: transitive
description:
......@@ -465,26 +489,26 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.5.0"
win32:
dependency: transitive
description:
name: win32
sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
version: "5.2.0"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
url: "https://pub.dev"
source: hosted
version: "1.0.3"
version: "1.0.4"
sdks:
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.10.0"
......@@ -3,7 +3,7 @@ description: twister game companion
publish_to: 'none'
version: 0.0.16+16
version: 0.0.17+17
environment:
sdk: '^3.0.0'
......@@ -16,10 +16,14 @@ dependencies:
easy_localization: ^3.0.1
equatable: ^2.0.5
flutter_bloc: ^8.1.1
hive: ^2.2.3
path_provider: ^2.0.11
hydrated_bloc: ^9.0.0
unicons: ^2.1.1
dev_dependencies:
flutter_lints: ^3.0.1
flutter:
uses-material-design: false
assets:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment