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

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

Resolve "Use flutter linter and apply lints"

Closes #8

See merge request !4
parents 0fa7fe75 e8959cc2
No related branches found
No related tags found
1 merge request!4Resolve "Use flutter linter and apply lints"
Pipeline #5118 passed
include: package:flutter_lints/flutter.yaml
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.3 app.versionName=0.0.4
app.versionCode=3 app.versionCode=4
Add automatic flutter linter. Apply code lints. Update dependencies.
Ajout d'un correcteur automatique de code. Application des corrections. Mise à jour des dépendances.
...@@ -13,12 +13,12 @@ class ScreenCamera extends StatelessWidget { ...@@ -13,12 +13,12 @@ class ScreenCamera extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
color: Theme.of(context).colorScheme.background, color: Theme.of(context).colorScheme.background,
child: Column( child: const Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
const SizedBox(height: 8), SizedBox(height: 8),
const TakePictureWidget(), TakePictureWidget(),
], ],
), ),
); );
......
...@@ -14,10 +14,10 @@ class ScreenHome extends StatelessWidget { ...@@ -14,10 +14,10 @@ class ScreenHome extends StatelessWidget {
child: ListView( child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 8), SizedBox(height: 8),
const Text('CONTENT'), Text('CONTENT'),
const SizedBox(height: 36), SizedBox(height: 36),
], ],
), ),
); );
......
...@@ -19,9 +19,9 @@ class ScreenSettings extends StatelessWidget { ...@@ -19,9 +19,9 @@ class ScreenSettings extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
children: <Widget>[ children: <Widget>[
SizedBox(height: 8), const SizedBox(height: 8),
AppTitle1(text: tr('settings_title')), AppTitle1(text: tr('settings_title')),
SettingsForm(), const SettingsForm(),
], ],
), ),
); );
......
...@@ -25,7 +25,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> { ...@@ -25,7 +25,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> {
]; ];
return Scaffold( return Scaffold(
appBar: StandardAppBar(), appBar: const StandardAppBar(),
extendBodyBehindAppBar: false, extendBodyBehindAppBar: false,
body: BlocBuilder<BottomNavCubit, int>( body: BlocBuilder<BottomNavCubit, int>(
builder: (BuildContext context, int state) { builder: (BuildContext context, int state) {
...@@ -36,7 +36,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> { ...@@ -36,7 +36,7 @@ class _SkeletonScreenState extends State<SkeletonScreen> {
}, },
), ),
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: Theme.of(context).colorScheme.background,
bottomNavigationBar: BottomNavBar(), bottomNavigationBar: const BottomNavBar(),
); );
} }
} }
...@@ -9,7 +9,7 @@ class StandardAppBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -9,7 +9,7 @@ class StandardAppBar extends StatelessWidget implements PreferredSizeWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppBar( return AppBar(
title: const AppTitle(text: 'app_name'), title: const AppTitle(text: 'app_name'),
actions: [], actions: const [],
); );
} }
......
...@@ -48,7 +48,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -48,7 +48,7 @@ class _SettingsFormState extends State<SettingsForm> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
SizedBox(height: 8), const SizedBox(height: 8),
AppTitle2(text: tr('settings_title_global')), AppTitle2(text: tr('settings_title_global')),
// Dummy value // Dummy value
...@@ -56,7 +56,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -56,7 +56,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_dummy_value').tr(), const Text('settings_label_dummy_value').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
......
...@@ -28,24 +28,20 @@ class TakePictureWidgetState extends State<TakePictureWidget> { ...@@ -28,24 +28,20 @@ class TakePictureWidgetState extends State<TakePictureWidget> {
} }
loadCamera() async { loadCamera() async {
final List<CameraDescription>? cameras = await availableCameras(); final List<CameraDescription> cameras = await availableCameras();
if (cameras != null) { controller = CameraController(
controller = CameraController( cameras.first,
cameras.first, ResolutionPreset.max,
ResolutionPreset.max, enableAudio: false,
enableAudio: false, );
);
controller!.initialize().then((_) { controller!.initialize().then((_) {
if (!mounted) { if (!mounted) {
return; return;
} }
setState(() {}); setState(() {});
}); });
} else {
print("No camera found.");
} }
}
@override @override
void dispose() { void dispose() {
...@@ -60,50 +56,50 @@ class TakePictureWidgetState extends State<TakePictureWidget> { ...@@ -60,50 +56,50 @@ class TakePictureWidgetState extends State<TakePictureWidget> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( SizedBox(
height: 400, height: 400,
child: controller == null child: controller == null
? Center(child: Text("Loading camera...")) ? const Center(child: Text("Loading camera..."))
: !controller!.value.isInitialized : !controller!.value.isInitialized
? Center(child: CircularProgressIndicator()) ? const Center(child: CircularProgressIndicator())
: CameraPreview(controller!), : CameraPreview(controller!),
), ),
ElevatedButton.icon( ElevatedButton.icon(
label: Text("Take picture"), label: const Text("Take picture"),
icon: Icon(UniconsLine.camera), icon: const Icon(UniconsLine.camera),
onPressed: () async { onPressed: () async {
try { try {
if ((controller != null) && (controller!.value.isInitialized)) { if ((controller != null) && (controller!.value.isInitialized)) {
final XFile image = await controller!.takePicture(); final XFile image = await controller!.takePicture();
print('image.path: ' + image.path); print('image.path: ${image.path}');
debug.add('image.path: ' + image.path); debug.add('image.path: ${image.path}');
File savedFile = await storage!.writeCounter(File(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; String imagePath = savedFile.path;
print('imagePath: ' + imagePath); print('imagePath: $imagePath');
debug.add('imagePath: ' + imagePath); debug.add('imagePath: $imagePath');
previousImages.add(imagePath); previousImages.add(imagePath);
setState(() {}); setState(() {});
} }
} catch (e) { } catch (e) {
debug.add('error: ' + e.toString()); debug.add('error: $e');
setState(() {}); setState(() {});
print(e); print(e);
} }
}, },
), ),
Text('debug: '), const Text('debug: '),
Column( Column(
children: debug.map((String line) { children: debug.map((String line) {
return Text(line); return Text(line);
}).toList(), }).toList(),
), ),
previousImages.length == 0 previousImages.isEmpty
? Text('no previous images') ? const Text('no previous images')
: Column( : Column(
children: previousImages.map((String imagePath) { children: previousImages.map((String imagePath) {
return Row( return Row(
......
...@@ -13,14 +13,14 @@ class PictureStorage { ...@@ -13,14 +13,14 @@ class PictureStorage {
Future<String> _localFilePath(String name) async { Future<String> _localFilePath(String name) async {
final path = await _localPath; final path = await _localPath;
return path + '/' + name; return '$path/$name';
} }
Future<File> moveFile(File sourceFile, String newPath) async { Future<File> moveFile(File sourceFile, String newPath) async {
try { try {
return await sourceFile.rename(newPath); return await sourceFile.rename(newPath);
} on FileSystemException catch (e) { } 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); final newFile = await sourceFile.copy(newPath);
await sourceFile.delete(); await sourceFile.delete();
return newFile; return newFile;
......
...@@ -13,18 +13,18 @@ packages: ...@@ -13,18 +13,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: bloc name: bloc
sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.1.2" version: "8.1.3"
camera: camera:
dependency: "direct main" dependency: "direct main"
description: description:
name: camera name: camera
sha256: f3813a634fd1350a9d2a78ee70e5b247cebedc9c58a24560992620e57a8a5600 sha256: "9499cbc2e51d8eb0beadc158b288380037618ce4e30c9acbc4fae1ac3ecb5797"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.10.5+8" version: "0.10.5+9"
camera_android: camera_android:
dependency: transitive dependency: transitive
description: description:
...@@ -37,18 +37,18 @@ packages: ...@@ -37,18 +37,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: camera_avfoundation name: camera_avfoundation
sha256: "1408600aa45faad05c518afccaabcd58419412ab67755a405b2ddce4f93fa120" sha256: "7d0763dfcbf060f56aa254a68c103210280bee9e97bbe4fdef23e257a4f70ab9"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.9.13+9" version: "0.9.14"
camera_platform_interface: camera_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: camera_platform_interface name: camera_platform_interface
sha256: fdb8b7a40c3564ce2967273445707d58cbff91bc2fa129e8de80af8cc501e793 sha256: fceb2c36038b6392317b1d5790c6ba9e6ca9f1da3031181b8bea03882bf9387a
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.7.1" version: "2.7.3"
camera_web: camera_web:
dependency: transitive dependency: transitive
description: description:
...@@ -101,10 +101,10 @@ packages: ...@@ -101,10 +101,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: easy_localization name: easy_localization
sha256: de63e3b422adfc97f256cbb3f8cf12739b6a4993d390f3cadb3f51837afaefe5 sha256: "9c86754b22aaa3e74e471635b25b33729f958dd6fb83df0ad6612948a7b231af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.3" version: "3.0.4"
easy_logger: easy_logger:
dependency: transitive dependency: transitive
description: description:
...@@ -125,10 +125,10 @@ packages: ...@@ -125,10 +125,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
file: file:
dependency: transitive dependency: transitive
description: description:
...@@ -146,10 +146,18 @@ packages: ...@@ -146,10 +146,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_bloc name: flutter_bloc
sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted 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: flutter_localizations:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -169,7 +177,7 @@ packages: ...@@ -169,7 +177,7 @@ packages:
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
hive: hive:
dependency: transitive dependency: "direct main"
description: description:
name: hive name: hive
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
...@@ -180,10 +188,10 @@ packages: ...@@ -180,10 +188,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: hydrated_bloc name: hydrated_bloc
sha256: c925e49704c052a8f249226ae7603f86bfa776b910816390763b956c71d2cbaf sha256: "00a2099680162e74b5a836b8a7f446e478520a9cae9f6032e028ad8129f4432d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.1.3" version: "9.1.4"
intl: intl:
dependency: transitive dependency: transitive
description: description:
...@@ -192,22 +200,30 @@ packages: ...@@ -192,22 +200,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.18.1" 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: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.0" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.11.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
...@@ -220,18 +236,18 @@ packages: ...@@ -220,18 +236,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: path_provider name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:
...@@ -244,10 +260,10 @@ packages: ...@@ -244,10 +260,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path_provider_foundation name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.2"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
...@@ -260,10 +276,10 @@ packages: ...@@ -260,10 +276,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
...@@ -316,10 +332,10 @@ packages: ...@@ -316,10 +332,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_foundation name: shared_preferences_foundation
sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.4" version: "2.3.5"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
...@@ -332,10 +348,10 @@ packages: ...@@ -332,10 +348,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_platform_interface name: shared_preferences_platform_interface
sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.2"
shared_preferences_web: shared_preferences_web:
dependency: transitive dependency: transitive
description: description:
...@@ -401,10 +417,10 @@ packages: ...@@ -401,10 +417,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "0.4.2"
win32: win32:
dependency: transitive dependency: transitive
description: description:
...@@ -422,5 +438,5 @@ packages: ...@@ -422,5 +438,5 @@ packages:
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
sdks: sdks:
dart: ">=3.2.0 <4.0.0" dart: ">=3.3.0-279.1.beta <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.16.6"
...@@ -3,7 +3,7 @@ description: stop motion assistant ...@@ -3,7 +3,7 @@ description: stop motion assistant
publish_to: 'none' publish_to: 'none'
version: 0.0.3+3 version: 0.0.4+4
environment: environment:
sdk: '^3.0.0' sdk: '^3.0.0'
...@@ -16,11 +16,15 @@ dependencies: ...@@ -16,11 +16,15 @@ dependencies:
easy_localization: ^3.0.1 easy_localization: ^3.0.1
equatable: ^2.0.5 equatable: ^2.0.5
flutter_bloc: ^8.1.1 flutter_bloc: ^8.1.1
hive: ^2.2.3
hydrated_bloc: ^9.0.0 hydrated_bloc: ^9.0.0
path: ^1.8.3 path: ^1.8.3
path_provider: ^2.1.1 path_provider: ^2.1.1
unicons: ^2.1.1 unicons: ^2.1.1
dev_dependencies:
flutter_lints: ^3.0.1
flutter: flutter:
uses-material-design: false uses-material-design: false
assets: assets:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment