From 1db90e2e25afaf76f3b767801d9dc5567b80fd9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr> Date: Mon, 19 Feb 2024 11:55:50 +0100 Subject: [PATCH] Use flutter linter, apply lints, update dependencies --- analysis_options.yaml | 1 + android/app/build.gradle | 2 +- android/gradle.properties | 4 +- .../metadata/android/en-US/changelogs/14.txt | 1 + .../metadata/android/fr-FR/changelogs/14.txt | 1 + lib/main.dart | 8 ++- lib/screens/home.dart | 56 +++++++++---------- pubspec.lock | 42 ++++++++------ pubspec.yaml | 5 +- 9 files changed, 68 insertions(+), 52 deletions(-) create mode 100644 analysis_options.yaml create mode 100644 fastlane/metadata/android/en-US/changelogs/14.txt create mode 100644 fastlane/metadata/android/fr-FR/changelogs/14.txt diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..f9b3034 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1 @@ +include: package:flutter_lints/flutter.yaml diff --git a/android/app/build.gradle b/android/app/build.gradle index 3b6a6e0..125fe1b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -44,7 +44,7 @@ android { defaultConfig { applicationId "org.benoitharrault.sortgame" - minSdkVersion 16 + minSdkVersion flutter.minSdkVersion targetSdkVersion 30 versionCode appVersionCode.toInteger() versionName appVersionName diff --git a/android/gradle.properties b/android/gradle.properties index 6638812..81949df 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.13 -app.versionCode=13 +app.versionName=0.0.14 +app.versionCode=14 diff --git a/fastlane/metadata/android/en-US/changelogs/14.txt b/fastlane/metadata/android/en-US/changelogs/14.txt new file mode 100644 index 0000000..6ab1115 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/14.txt @@ -0,0 +1 @@ +Add automatic flutter linter. Apply code lints. Update dependencies. diff --git a/fastlane/metadata/android/fr-FR/changelogs/14.txt b/fastlane/metadata/android/fr-FR/changelogs/14.txt new file mode 100644 index 0000000..315dd65 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/14.txt @@ -0,0 +1 @@ +Ajout d'un correcteur automatique de code. Application des correction. Mise à jour des dépendances. diff --git a/lib/main.dart b/lib/main.dart index a317c62..19b7ded 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,9 +4,11 @@ import 'package:provider/provider.dart'; import 'provider/data.dart'; import 'screens/home.dart'; -void main() => runApp(MyApp()); +void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return ChangeNotifierProvider( @@ -18,9 +20,9 @@ class MyApp extends StatelessWidget { primaryColor: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), - home: Home(), + home: const Home(), routes: { - Home.id: (context) => Home(), + Home.id: (context) => const Home(), }, ); }), diff --git a/lib/screens/home.dart b/lib/screens/home.dart index f8736bb..32fb32b 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -1,49 +1,49 @@ import 'package:flutter/material.dart'; class Home extends StatelessWidget { + const Home({super.key}); + static const String id = 'home'; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Sorting game'), + title: const Text('Sorting game'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ - Container( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.all(4), - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Colors.blue, - borderRadius: BorderRadius.circular(4), - border: Border.all( - color: Colors.green, - width: 4, - ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: const EdgeInsets.all(4), + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.blue, + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: Colors.green, + width: 4, ), - child: TextButton( - child: Text( - '🎲', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.w600, - color: Colors.black, - ), + ), + child: TextButton( + child: const Text( + '🎲', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 50, + fontWeight: FontWeight.w600, + color: Colors.black, ), - onPressed: () => print('X'), ), + onPressed: () => print('X'), ), - ], - ), + ), + ], ), ], ), diff --git a/pubspec.lock b/pubspec.lock index d6c8af1..4abc6fe 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,31 +13,47 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 + url: "https://pub.dev" + source: hosted + version: "3.0.1" + 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: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" nested: dependency: transitive description: @@ -50,10 +66,10 @@ packages: dependency: "direct main" description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.1" sky_engine: dependency: transitive description: flutter @@ -67,14 +83,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=1.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index b36e0d4..f7d3dfa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: sortgame description: A sorting game application. publish_to: 'none' -version: 1.0.0+1 +version: 0.0.14+14 environment: sdk: '^3.0.0' @@ -11,6 +11,9 @@ dependencies: sdk: flutter provider: ^6.0.5 +dev_dependencies: + flutter_lints: ^3.0.1 + flutter: uses-material-design: true assets: -- GitLab