diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f9b303465f19b5fbf5ec669cd083c9cc38ecda9a --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1 @@ +include: package:flutter_lints/flutter.yaml diff --git a/android/gradle.properties b/android/gradle.properties index db7a1ee2908d6e94aeb319e1c1b548a8bb245891..14eed3944b547f02179b1b42f4b601f91b7957c0 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.3 -app.versionCode=3 +app.versionName=0.0.4 +app.versionCode=4 diff --git a/fastlane/metadata/android/en-US/changelogs/4.txt b/fastlane/metadata/android/en-US/changelogs/4.txt new file mode 100644 index 0000000000000000000000000000000000000000..6ab11150150fc75a46c9acc317890208e5a120b9 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/4.txt @@ -0,0 +1 @@ +Add automatic flutter linter. Apply code lints. Update dependencies. diff --git a/fastlane/metadata/android/fr-FR/changelogs/4.txt b/fastlane/metadata/android/fr-FR/changelogs/4.txt new file mode 100644 index 0000000000000000000000000000000000000000..609f5cf6e95a8df0799865df2e1ebde8fa981e5a --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/4.txt @@ -0,0 +1 @@ +Ajout d'un correcteur automatique de code. Application des corrections. Mise à jour des dépendances. diff --git a/lib/ui/screens/camera.dart b/lib/ui/screens/camera.dart index eafa1426d8acc8a9ec93ad36f933182cc20b0f53..00278434f60bdad03f093efd3c1ea7a88c7fd8cf 100644 --- a/lib/ui/screens/camera.dart +++ b/lib/ui/screens/camera.dart @@ -13,12 +13,12 @@ class ScreenCamera extends StatelessWidget { Widget build(BuildContext context) { return Material( color: Theme.of(context).colorScheme.background, - child: Column( + child: const Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ - const SizedBox(height: 8), - const TakePictureWidget(), + SizedBox(height: 8), + TakePictureWidget(), ], ), ); diff --git a/lib/ui/screens/home.dart b/lib/ui/screens/home.dart index d6298dbe6f3384637f74bcae04d2e384e5d6b339..c9c537457b02275095311939873152e0bfded8c3 100644 --- a/lib/ui/screens/home.dart +++ b/lib/ui/screens/home.dart @@ -14,10 +14,10 @@ class ScreenHome extends StatelessWidget { child: ListView( padding: const EdgeInsets.symmetric(horizontal: 4), physics: const BouncingScrollPhysics(), - children: <Widget>[ - const SizedBox(height: 8), - const Text('CONTENT'), - const SizedBox(height: 36), + children: const <Widget>[ + SizedBox(height: 8), + Text('CONTENT'), + SizedBox(height: 36), ], ), ); diff --git a/lib/ui/screens/settings.dart b/lib/ui/screens/settings.dart index 731e6d926416d724328ed31a826d2e19160d1088..db2e9214cf474767b2d5d66e89db18fde70aec42 100644 --- a/lib/ui/screens/settings.dart +++ b/lib/ui/screens/settings.dart @@ -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(), ], ), ); diff --git a/lib/ui/skeleton.dart b/lib/ui/skeleton.dart index f3979df590e396ff260fce18ac9629c65bfcb3a6..16d65ec2c7efc08ef3d6484b46f1c3df225945ab 100644 --- a/lib/ui/skeleton.dart +++ b/lib/ui/skeleton.dart @@ -25,7 +25,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> { ]; return Scaffold( - appBar: StandardAppBar(), + appBar: const StandardAppBar(), extendBodyBehindAppBar: false, body: BlocBuilder<BottomNavCubit, int>( builder: (BuildContext context, int state) { @@ -36,7 +36,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> { }, ), backgroundColor: Theme.of(context).colorScheme.background, - bottomNavigationBar: BottomNavBar(), + bottomNavigationBar: const BottomNavBar(), ); } } diff --git a/lib/ui/widgets/app_bar.dart b/lib/ui/widgets/app_bar.dart index 27030e720f0c6549fb24aadac064e043fd9ac469..35094c7252b900686a3d0b3b567636740b38ac08 100644 --- a/lib/ui/widgets/app_bar.dart +++ b/lib/ui/widgets/app_bar.dart @@ -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 [], ); } diff --git a/lib/ui/widgets/settings_form.dart b/lib/ui/widgets/settings_form.dart index 3957bb9b0e826ac4d8ae3e6441be5b33fed0fc97..d527702b672d6d2306827910ad4cacc4cef87f57 100644 --- a/lib/ui/widgets/settings_form.dart +++ b/lib/ui/widgets/settings_form.dart @@ -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_global')), // Dummy value @@ -56,7 +56,7 @@ class _SettingsFormState extends State<SettingsForm> { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('settings_label_dummy_value').tr(), + const Text('settings_label_dummy_value').tr(), ToggleButtons( onPressed: (int index) { setState(() { diff --git a/lib/ui/widgets/take_picture_widget.dart b/lib/ui/widgets/take_picture_widget.dart index d68b7341238278e82a6e7f4f61c9c761b6976c74..d817f13f20b937cf71036a3fea115aa5891dcf05 100644 --- a/lib/ui/widgets/take_picture_widget.dart +++ b/lib/ui/widgets/take_picture_widget.dart @@ -28,24 +28,20 @@ class TakePictureWidgetState extends State<TakePictureWidget> { } loadCamera() async { - final List<CameraDescription>? cameras = await availableCameras(); - if (cameras != null) { - controller = CameraController( - cameras.first, - ResolutionPreset.max, - enableAudio: false, - ); + final List<CameraDescription> cameras = await availableCameras(); + controller = CameraController( + cameras.first, + ResolutionPreset.max, + enableAudio: false, + ); - controller!.initialize().then((_) { - if (!mounted) { - return; - } - setState(() {}); - }); - } else { - print("No camera found."); + controller!.initialize().then((_) { + if (!mounted) { + return; + } + setState(() {}); + }); } - } @override void dispose() { @@ -60,50 +56,50 @@ class TakePictureWidgetState extends State<TakePictureWidget> { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( + SizedBox( height: 400, child: controller == null - ? Center(child: Text("Loading camera...")) + ? const Center(child: Text("Loading camera...")) : !controller!.value.isInitialized - ? Center(child: CircularProgressIndicator()) + ? const Center(child: CircularProgressIndicator()) : CameraPreview(controller!), ), ElevatedButton.icon( - label: Text("Take picture"), - icon: Icon(UniconsLine.camera), + label: const Text("Take picture"), + icon: const Icon(UniconsLine.camera), onPressed: () async { try { if ((controller != null) && (controller!.value.isInitialized)) { final XFile image = await controller!.takePicture(); - print('image.path: ' + image.path); - debug.add('image.path: ' + image.path); + print('image.path: ${image.path}'); + debug.add('image.path: ${image.path}'); File savedFile = await storage!.writeCounter(File(image.path)); - debug.add('image.path: ' + image.path); + debug.add('image.path: ${image.path}'); String imagePath = savedFile.path; - print('imagePath: ' + imagePath); - debug.add('imagePath: ' + imagePath); + print('imagePath: $imagePath'); + debug.add('imagePath: $imagePath'); previousImages.add(imagePath); setState(() {}); } } catch (e) { - debug.add('error: ' + e.toString()); + debug.add('error: $e'); setState(() {}); print(e); } }, ), - Text('debug: '), + const Text('debug: '), Column( children: debug.map((String line) { return Text(line); }).toList(), ), - previousImages.length == 0 - ? Text('no previous images') + previousImages.isEmpty + ? const Text('no previous images') : Column( children: previousImages.map((String imagePath) { return Row( diff --git a/lib/utils/picture_storage.dart b/lib/utils/picture_storage.dart index 72e2278f677d39ef318ab24a57dd4a7e8b9ae950..ebf663b54f928c580239afa3218833fb8f4a9a65 100644 --- a/lib/utils/picture_storage.dart +++ b/lib/utils/picture_storage.dart @@ -13,14 +13,14 @@ class PictureStorage { Future<String> _localFilePath(String name) async { final path = await _localPath; - return path + '/' + name; + return '$path/$name'; } Future<File> moveFile(File sourceFile, String newPath) async { try { return await sourceFile.rename(newPath); } on FileSystemException catch (e) { - print('Found exception while moving file: ' + e.toString()); + print('Found exception while moving file: $e'); final newFile = await sourceFile.copy(newPath); await sourceFile.delete(); return newFile; diff --git a/pubspec.lock b/pubspec.lock index 3c0facbe365f419588dddf0c1a8926dd11044459..087ee037023139eeb772c82a7f0f45923e78718e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,18 +13,18 @@ packages: dependency: transitive description: name: bloc - sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.1.3" camera: dependency: "direct main" description: name: camera - sha256: f3813a634fd1350a9d2a78ee70e5b247cebedc9c58a24560992620e57a8a5600 + sha256: "9499cbc2e51d8eb0beadc158b288380037618ce4e30c9acbc4fae1ac3ecb5797" url: "https://pub.dev" source: hosted - version: "0.10.5+8" + version: "0.10.5+9" camera_android: dependency: transitive description: @@ -37,18 +37,18 @@ packages: dependency: transitive description: name: camera_avfoundation - sha256: "1408600aa45faad05c518afccaabcd58419412ab67755a405b2ddce4f93fa120" + sha256: "7d0763dfcbf060f56aa254a68c103210280bee9e97bbe4fdef23e257a4f70ab9" url: "https://pub.dev" source: hosted - version: "0.9.13+9" + version: "0.9.14" camera_platform_interface: dependency: transitive description: name: camera_platform_interface - sha256: fdb8b7a40c3564ce2967273445707d58cbff91bc2fa129e8de80af8cc501e793 + sha256: fceb2c36038b6392317b1d5790c6ba9e6ca9f1da3031181b8bea03882bf9387a url: "https://pub.dev" source: hosted - version: "2.7.1" + version: "2.7.3" camera_web: dependency: transitive description: @@ -101,10 +101,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: @@ -125,10 +125,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: @@ -146,10 +146,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 @@ -169,7 +177,7 @@ packages: source: sdk version: "0.0.0" hive: - dependency: transitive + dependency: "direct main" description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" @@ -180,10 +188,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: @@ -192,22 +200,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.18.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: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" nested: dependency: transitive description: @@ -220,18 +236,18 @@ packages: dependency: "direct main" 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: @@ -244,10 +260,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: @@ -260,10 +276,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: @@ -316,10 +332,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: @@ -332,10 +348,10 @@ 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: @@ -401,10 +417,10 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.4.2" win32: dependency: transitive description: @@ -422,5 +438,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.3.0-279.1.beta <4.0.0" + flutter: ">=3.16.6" diff --git a/pubspec.yaml b/pubspec.yaml index 01804485e4fd9e6d4941d862e06714251ce74de1..e0b89d88ffae0bc59825e9cc9b6e1fab9409c799 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: stop motion assistant publish_to: 'none' -version: 0.0.3+3 +version: 0.0.4+4 environment: sdk: '^3.0.0' @@ -16,11 +16,15 @@ dependencies: easy_localization: ^3.0.1 equatable: ^2.0.5 flutter_bloc: ^8.1.1 + hive: ^2.2.3 hydrated_bloc: ^9.0.0 path: ^1.8.3 path_provider: ^2.1.1 unicons: ^2.1.1 +dev_dependencies: + flutter_lints: ^3.0.1 + flutter: uses-material-design: false assets: