diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..b0b3e1fe2543143896ee06ae7b9984f8bd038f73 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.json] +indent_size = 2 + +[*.yaml] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 361df94f91db934b411ea13244ac8db6f41f3888..54ae0222de3e722adfb2b48c14d77c4d074dafda 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .buildlog/ .history .svn/ +migrate_working_dir/ # IntelliJ related *.iml diff --git a/assets/fonts/Nunito-Bold.ttf b/assets/fonts/Nunito-Bold.ttf deleted file mode 100644 index 6519feb781449ebe0015cbc74dfd9e13110fbba9..0000000000000000000000000000000000000000 Binary files a/assets/fonts/Nunito-Bold.ttf and /dev/null differ diff --git a/assets/fonts/Nunito-Light.ttf b/assets/fonts/Nunito-Light.ttf deleted file mode 100644 index 8a0736c41cd6c2a1225d356bf274de1d0afc3497..0000000000000000000000000000000000000000 Binary files a/assets/fonts/Nunito-Light.ttf and /dev/null differ diff --git a/assets/fonts/Nunito-Medium.ttf b/assets/fonts/Nunito-Medium.ttf deleted file mode 100644 index 88fccdc0638b6f5d6ac49d9d269dc3d518618ad1..0000000000000000000000000000000000000000 Binary files a/assets/fonts/Nunito-Medium.ttf and /dev/null differ diff --git a/assets/fonts/Nunito-Regular.ttf b/assets/fonts/Nunito-Regular.ttf deleted file mode 100644 index e7b8375a896ef0cd8e06730a78c84532b377e784..0000000000000000000000000000000000000000 Binary files a/assets/fonts/Nunito-Regular.ttf and /dev/null differ diff --git a/fastlane/metadata/android/en-US/changelogs/12.txt b/fastlane/metadata/android/en-US/changelogs/12.txt new file mode 100644 index 0000000000000000000000000000000000000000..65ba5e83570223adc45ccea599a3487b24b8a7dd --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/12.txt @@ -0,0 +1 @@ +Use flutter_custom_toolbox for common features. diff --git a/fastlane/metadata/android/fr-FR/changelogs/12.txt b/fastlane/metadata/android/fr-FR/changelogs/12.txt new file mode 100644 index 0000000000000000000000000000000000000000..258c624fb3898d91b6b70d7d99db2719c1bf0751 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/12.txt @@ -0,0 +1 @@ +Utilisation de flutter_custom_toolbox pour les fonctionnalités communes. diff --git a/lib/config/activity_page.dart b/lib/config/activity_page.dart index 29314379fa159675e4c47fa91ce6eb19063d9854..5de51cb1670fb041a0acc48d81c91bff7d4679f2 100644 --- a/lib/config/activity_page.dart +++ b/lib/config/activity_page.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:unicons/unicons.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/ui/pages/editor.dart'; import 'package:stopmotion/ui/pages/home.dart'; diff --git a/lib/config/default_activity_settings.dart b/lib/config/default_activity_settings.dart index 52cd9ce07b25a2a92f7549c0c6307eac077e0bc6..601c1a0ec01f24f0b0bf22a3471738df80407426 100644 --- a/lib/config/default_activity_settings.dart +++ b/lib/config/default_activity_settings.dart @@ -1,4 +1,4 @@ -import 'package:stopmotion/utils/tools.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; class DefaultActivitySettings { // available activity parameters codes diff --git a/lib/config/default_global_settings.dart b/lib/config/default_global_settings.dart index c871bd79d669e6af961cf9d59f1dc0b06f992ba7..d92229c2e02064684ed4a2caeb272ff63325776a 100644 --- a/lib/config/default_global_settings.dart +++ b/lib/config/default_global_settings.dart @@ -1,4 +1,4 @@ -import 'package:stopmotion/utils/tools.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; class DefaultGlobalSettings { // available global parameters codes diff --git a/lib/config/screen.dart b/lib/config/screen.dart index 46382ae9824be4b247aff08f051634a591a23287..41d67622a0f38f872def535a62a67219585fdaa4 100644 --- a/lib/config/screen.dart +++ b/lib/config/screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:unicons/unicons.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/ui/screens/about.dart'; import 'package:stopmotion/ui/screens/activity.dart'; diff --git a/lib/config/theme.dart b/lib/config/theme.dart deleted file mode 100644 index 74f532fd5abf693979118609564d29167e902009..0000000000000000000000000000000000000000 --- a/lib/config/theme.dart +++ /dev/null @@ -1,190 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Colors from Tailwind CSS (v3.0) - June 2022 -/// -/// https://tailwindcss.com/docs/customizing-colors - -const int _primaryColor = 0xFF6366F1; -const MaterialColor primarySwatch = MaterialColor(_primaryColor, <int, Color>{ - 50: Color(0xFFEEF2FF), // indigo-50 - 100: Color(0xFFE0E7FF), // indigo-100 - 200: Color(0xFFC7D2FE), // indigo-200 - 300: Color(0xFFA5B4FC), // indigo-300 - 400: Color(0xFF818CF8), // indigo-400 - 500: Color(_primaryColor), // indigo-500 - 600: Color(0xFF4F46E5), // indigo-600 - 700: Color(0xFF4338CA), // indigo-700 - 800: Color(0xFF3730A3), // indigo-800 - 900: Color(0xFF312E81), // indigo-900 -}); - -const int _textColor = 0xFF64748B; -const MaterialColor textSwatch = MaterialColor(_textColor, <int, Color>{ - 50: Color(0xFFF8FAFC), // slate-50 - 100: Color(0xFFF1F5F9), // slate-100 - 200: Color(0xFFE2E8F0), // slate-200 - 300: Color(0xFFCBD5E1), // slate-300 - 400: Color(0xFF94A3B8), // slate-400 - 500: Color(_textColor), // slate-500 - 600: Color(0xFF475569), // slate-600 - 700: Color(0xFF334155), // slate-700 - 800: Color(0xFF1E293B), // slate-800 - 900: Color(0xFF0F172A), // slate-900 -}); - -const Color errorColor = Color(0xFFDC2626); // red-600 - -final ColorScheme lightColorScheme = ColorScheme.light( - primary: primarySwatch.shade500, - secondary: primarySwatch.shade500, - onSecondary: Colors.white, - error: errorColor, - onSurface: textSwatch.shade500, - surface: textSwatch.shade50, - surfaceContainerHighest: Colors.white, - shadow: textSwatch.shade900.withOpacity(.1), -); - -final ColorScheme darkColorScheme = ColorScheme.dark( - primary: primarySwatch.shade500, - secondary: primarySwatch.shade500, - onSecondary: Colors.white, - error: errorColor, - onSurface: textSwatch.shade300, - surface: const Color(0xFF262630), - surfaceContainerHighest: const Color(0xFF282832), - shadow: textSwatch.shade900.withOpacity(.2), -); - -final ThemeData lightTheme = ThemeData( - colorScheme: lightColorScheme, - fontFamily: 'Nunito', - textTheme: TextTheme( - displayLarge: TextStyle( - color: textSwatch.shade700, - fontFamily: 'Nunito', - ), - displayMedium: TextStyle( - color: textSwatch.shade600, - fontFamily: 'Nunito', - ), - displaySmall: TextStyle( - color: textSwatch.shade500, - fontFamily: 'Nunito', - ), - headlineLarge: TextStyle( - color: textSwatch.shade700, - fontFamily: 'Nunito', - ), - headlineMedium: TextStyle( - color: textSwatch.shade600, - fontFamily: 'Nunito', - ), - headlineSmall: TextStyle( - color: textSwatch.shade500, - fontFamily: 'Nunito', - ), - titleLarge: TextStyle( - color: textSwatch.shade700, - fontFamily: 'Nunito', - ), - titleMedium: TextStyle( - color: textSwatch.shade600, - fontFamily: 'Nunito', - ), - titleSmall: TextStyle( - color: textSwatch.shade500, - fontFamily: 'Nunito', - ), - bodyLarge: TextStyle( - color: textSwatch.shade700, - fontFamily: 'Nunito', - ), - bodyMedium: TextStyle( - color: textSwatch.shade600, - fontFamily: 'Nunito', - ), - bodySmall: TextStyle( - color: textSwatch.shade500, - fontFamily: 'Nunito', - ), - labelLarge: TextStyle( - color: textSwatch.shade700, - fontFamily: 'Nunito', - ), - labelMedium: TextStyle( - color: textSwatch.shade600, - fontFamily: 'Nunito', - ), - labelSmall: TextStyle( - color: textSwatch.shade500, - fontFamily: 'Nunito', - ), - ), -); - -final ThemeData darkTheme = lightTheme.copyWith( - colorScheme: darkColorScheme, - textTheme: TextTheme( - displayLarge: TextStyle( - color: textSwatch.shade200, - fontFamily: 'Nunito', - ), - displayMedium: TextStyle( - color: textSwatch.shade300, - fontFamily: 'Nunito', - ), - displaySmall: TextStyle( - color: textSwatch.shade400, - fontFamily: 'Nunito', - ), - headlineLarge: TextStyle( - color: textSwatch.shade200, - fontFamily: 'Nunito', - ), - headlineMedium: TextStyle( - color: textSwatch.shade300, - fontFamily: 'Nunito', - ), - headlineSmall: TextStyle( - color: textSwatch.shade400, - fontFamily: 'Nunito', - ), - titleLarge: TextStyle( - color: textSwatch.shade200, - fontFamily: 'Nunito', - ), - titleMedium: TextStyle( - color: textSwatch.shade300, - fontFamily: 'Nunito', - ), - titleSmall: TextStyle( - color: textSwatch.shade400, - fontFamily: 'Nunito', - ), - bodyLarge: TextStyle( - color: textSwatch.shade200, - fontFamily: 'Nunito', - ), - bodyMedium: TextStyle( - color: textSwatch.shade300, - fontFamily: 'Nunito', - ), - bodySmall: TextStyle( - color: textSwatch.shade400, - fontFamily: 'Nunito', - ), - labelLarge: TextStyle( - color: textSwatch.shade200, - fontFamily: 'Nunito', - ), - labelMedium: TextStyle( - color: textSwatch.shade300, - fontFamily: 'Nunito', - ), - labelSmall: TextStyle( - color: textSwatch.shade400, - fontFamily: 'Nunito', - ), - ), -); diff --git a/lib/cubit/activity_cubit.dart b/lib/cubit/activity_cubit.dart index 9ab361adcac13a9b1562fee1723dd22593b08d66..640d9c5e67984fd02bf68cd5904f33b7e1d4a385 100644 --- a/lib/cubit/activity_cubit.dart +++ b/lib/cubit/activity_cubit.dart @@ -1,6 +1,5 @@ -import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; -import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/models/activity/activity.dart'; import 'package:stopmotion/models/settings/settings_activity.dart'; diff --git a/lib/cubit/nav_cubit_pages.dart b/lib/cubit/nav_cubit_pages.dart index e64bc1139f40c761eea2fba07f80ce0c496c464e..9099e788484ff04e76ec983f221109bc32ca1555 100644 --- a/lib/cubit/nav_cubit_pages.dart +++ b/lib/cubit/nav_cubit_pages.dart @@ -1,4 +1,4 @@ -import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/activity_page.dart'; diff --git a/lib/cubit/nav_cubit_screens.dart b/lib/cubit/nav_cubit_screens.dart index ca76f548b52c21b221e53f6b565c4efa0b52773a..616206d9b9c3d34b87398a7b5aa384d391a7e1ae 100644 --- a/lib/cubit/nav_cubit_screens.dart +++ b/lib/cubit/nav_cubit_screens.dart @@ -1,4 +1,4 @@ -import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/screen.dart'; diff --git a/lib/cubit/settings_activity_cubit.dart b/lib/cubit/settings_activity_cubit.dart index f0e460d7bcfbcc83b9ce009ada99f5ecceeb4090..64570f7fea4fd56b61beacbb40cd2599fcc9b0a9 100644 --- a/lib/cubit/settings_activity_cubit.dart +++ b/lib/cubit/settings_activity_cubit.dart @@ -1,6 +1,5 @@ -import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; -import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/default_activity_settings.dart'; import 'package:stopmotion/models/settings/settings_activity.dart'; diff --git a/lib/cubit/settings_global_cubit.dart b/lib/cubit/settings_global_cubit.dart index f5b2f0667916c5144243eec7532a795e80a523e7..428571c704655e451d6978c62b2612646bfc2baf 100644 --- a/lib/cubit/settings_global_cubit.dart +++ b/lib/cubit/settings_global_cubit.dart @@ -1,6 +1,5 @@ -import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; -import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/default_global_settings.dart'; import 'package:stopmotion/models/settings/settings_global.dart'; diff --git a/lib/cubit/theme_cubit.dart b/lib/cubit/theme_cubit.dart index b793e895dbb0c672d451cd403e0036c3d9ac9b42..1ecab6014c67a0393eabbf704b8b85c9e988705e 100644 --- a/lib/cubit/theme_cubit.dart +++ b/lib/cubit/theme_cubit.dart @@ -1,6 +1,5 @@ -import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; -import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; part 'theme_state.dart'; diff --git a/lib/main.dart b/lib/main.dart index 042dbd65e41f6c10c4b6f947f51d0fc07c62b534..9fc0cd34c4392a5379546eb6bd6b9929cc915fc8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,14 +1,9 @@ import 'dart:io'; -import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:hive/hive.dart'; -import 'package:hydrated_bloc/hydrated_bloc.dart'; -import 'package:path_provider/path_provider.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; -import 'package:stopmotion/config/theme.dart'; import 'package:stopmotion/cubit/activity_cubit.dart'; import 'package:stopmotion/cubit/nav_cubit_pages.dart'; import 'package:stopmotion/cubit/nav_cubit_screens.dart'; diff --git a/lib/models/activity/activity.dart b/lib/models/activity/activity.dart index 6b778cb963c164c320d4ffee4327db0ee239806b..b66802850935bb919e11334a76f2db718154100c 100644 --- a/lib/models/activity/activity.dart +++ b/lib/models/activity/activity.dart @@ -1,7 +1,8 @@ +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; + import 'package:stopmotion/models/data/picture.dart'; import 'package:stopmotion/models/settings/settings_activity.dart'; import 'package:stopmotion/models/settings/settings_global.dart'; -import 'package:stopmotion/utils/tools.dart'; class Activity { Activity({ diff --git a/lib/models/settings/settings_activity.dart b/lib/models/settings/settings_activity.dart index 434ea010e783c23838485ca0b7c0186295803eaa..d1664eb48fc413e3e5b3a68a846e95fcefe50be0 100644 --- a/lib/models/settings/settings_activity.dart +++ b/lib/models/settings/settings_activity.dart @@ -1,5 +1,6 @@ +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; + import 'package:stopmotion/config/default_activity_settings.dart'; -import 'package:stopmotion/utils/tools.dart'; class ActivitySettings { final String movieType; diff --git a/lib/models/settings/settings_global.dart b/lib/models/settings/settings_global.dart index 060d7d49a494c6ec9b1dbf01d9572d8dbe676ab6..fb2c3fd32077e8ed45a6d2540b87148077e8cda0 100644 --- a/lib/models/settings/settings_global.dart +++ b/lib/models/settings/settings_global.dart @@ -1,5 +1,6 @@ +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; + import 'package:stopmotion/config/default_global_settings.dart'; -import 'package:stopmotion/utils/tools.dart'; class GlobalSettings { String skin; diff --git a/lib/ui/helpers/app_titles.dart b/lib/ui/helpers/app_titles.dart deleted file mode 100644 index b98107b12fabc3114ebfbec994166b588abcf1ad..0000000000000000000000000000000000000000 --- a/lib/ui/helpers/app_titles.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; - -class AppHeader extends StatelessWidget { - const AppHeader({super.key, required this.text}); - - final String text; - - @override - Widget build(BuildContext context) { - return Text( - tr(text), - textAlign: TextAlign.start, - style: Theme.of(context).textTheme.headlineMedium!.apply(fontWeightDelta: 2), - ); - } -} - -class AppTitle extends StatelessWidget { - const AppTitle({super.key, required this.text}); - - final String text; - - @override - Widget build(BuildContext context) { - return Text( - tr(text), - textAlign: TextAlign.start, - style: Theme.of(context).textTheme.titleLarge!.apply(fontWeightDelta: 2), - ); - } -} diff --git a/lib/ui/helpers/outlined_text_widget.dart b/lib/ui/helpers/outlined_text_widget.dart deleted file mode 100644 index e8cbb93a282c081d59cc9b0963dd9cf3554b0860..0000000000000000000000000000000000000000 --- a/lib/ui/helpers/outlined_text_widget.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:stopmotion/utils/color_extensions.dart'; - -class OutlinedText extends StatelessWidget { - const OutlinedText({ - super.key, - required this.text, - required this.fontSize, - required this.textColor, - this.outlineColor, - }); - - final String text; - final double fontSize; - final Color textColor; - final Color? outlineColor; - - @override - Widget build(BuildContext context) { - final double delta = fontSize / 30; - - return Text( - text, - style: TextStyle( - inherit: true, - fontSize: fontSize, - fontWeight: FontWeight.w600, - color: textColor, - shadows: [ - Shadow( - offset: Offset(-delta, -delta), - color: outlineColor ?? textColor.darken(), - ), - Shadow( - offset: Offset(delta, -delta), - color: outlineColor ?? textColor.darken(), - ), - Shadow( - offset: Offset(delta, delta), - color: outlineColor ?? textColor.darken(), - ), - Shadow( - offset: Offset(-delta, delta), - color: outlineColor ?? textColor.darken(), - ), - ], - ), - ); - } -} diff --git a/lib/ui/nav/bottom_nav_bar.dart b/lib/ui/nav/bottom_nav_bar.dart index fb30fdec3daadf1d86a603f22ec58103d6160f77..edd86d4c344abb3560d73e94bcca0a4b80f59a2c 100644 --- a/lib/ui/nav/bottom_nav_bar.dart +++ b/lib/ui/nav/bottom_nav_bar.dart @@ -1,6 +1,5 @@ -import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/activity_page.dart'; import 'package:stopmotion/cubit/nav_cubit_pages.dart'; @@ -36,7 +35,7 @@ class BottomNavBar extends StatelessWidget { return BottomNavigationBar( currentIndex: state, - onTap: (int index) => context.read<NavCubitPage>().updateIndex(index), + onTap: (int index) => BlocProvider.of<NavCubitPage>(context).updateIndex(index), type: BottomNavigationBarType.fixed, elevation: 0, backgroundColor: Colors.transparent, diff --git a/lib/ui/nav/global_app_bar.dart b/lib/ui/nav/global_app_bar.dart index 0590d1dfaf047967ee80c1d750909f1553dc0cf8..92320466ea3c534bba515cb811503eb531470db0 100644 --- a/lib/ui/nav/global_app_bar.dart +++ b/lib/ui/nav/global_app_bar.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/screen.dart'; import 'package:stopmotion/cubit/activity_cubit.dart'; import 'package:stopmotion/cubit/nav_cubit_screens.dart'; -import 'package:stopmotion/ui/helpers/app_titles.dart'; class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget { const GlobalAppBar({super.key}); @@ -21,7 +20,7 @@ class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget { // go to Settings page menuActions.add(ElevatedButton( onPressed: () { - context.read<NavCubitScreen>().goToSettingsPage(); + BlocProvider.of<NavCubitScreen>(context).goToSettingsPage(); }, style: ElevatedButton.styleFrom( shape: const CircleBorder(), @@ -32,7 +31,7 @@ class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget { // go to About page menuActions.add(ElevatedButton( onPressed: () { - context.read<NavCubitScreen>().goToAboutPage(); + BlocProvider.of<NavCubitScreen>(context).goToAboutPage(); }, style: ElevatedButton.styleFrom( shape: const CircleBorder(), @@ -43,7 +42,7 @@ class GlobalAppBar extends StatelessWidget implements PreferredSizeWidget { // back to Home page menuActions.add(ElevatedButton( onPressed: () { - context.read<NavCubitScreen>().goToActivityPage(); + BlocProvider.of<NavCubitScreen>(context).goToActivityPage(); }, style: ElevatedButton.styleFrom( shape: const CircleBorder(), diff --git a/lib/ui/pages/editor.dart b/lib/ui/pages/editor.dart index 2a0648fdbd1d3d593547e6865afe430d5674f857..4ed4be14d9f7b4f1bf0315ddd51b4f3cc542da2c 100644 --- a/lib/ui/pages/editor.dart +++ b/lib/ui/pages/editor.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/cubit/activity_cubit.dart'; import 'package:stopmotion/ui/widgets/take_picture_widget.dart'; diff --git a/lib/ui/pages/home.dart b/lib/ui/pages/home.dart index ffe31c447aa85a04b6bc1a9dc0a7d92b8e96062c..5c1e5482332414cdd6d9fc89b826e09eeff73ec4 100644 --- a/lib/ui/pages/home.dart +++ b/lib/ui/pages/home.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/cubit/activity_cubit.dart'; import 'package:stopmotion/models/activity/activity.dart'; -import 'package:stopmotion/ui/helpers/outlined_text_widget.dart'; -import 'package:stopmotion/utils/color_extensions.dart'; class PageHome extends StatelessWidget { const PageHome({super.key}); diff --git a/lib/ui/pages/player.dart b/lib/ui/pages/player.dart index 5171cfc87c7e1465881c7150d9df5c81c1a8111e..fc1302ec7ec8fcbc84a9cc801d953b7b5ff30f02 100644 --- a/lib/ui/pages/player.dart +++ b/lib/ui/pages/player.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/cubit/activity_cubit.dart'; import 'package:stopmotion/models/activity/activity.dart'; -import 'package:stopmotion/ui/helpers/outlined_text_widget.dart'; -import 'package:stopmotion/utils/color_extensions.dart'; class PagePlayer extends StatelessWidget { const PagePlayer({super.key}); diff --git a/lib/ui/screens/about.dart b/lib/ui/screens/about.dart index ec183f054b2c033fbc535ba80266bcb6fbcff0ba..f7a14a9a7e574a7b6f9ed181f38d08ba8c2285fe 100644 --- a/lib/ui/screens/about.dart +++ b/lib/ui/screens/about.dart @@ -1,8 +1,5 @@ -import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import 'package:package_info_plus/package_info_plus.dart'; - -import 'package:stopmotion/ui/helpers/app_titles.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; class ScreenAbout extends StatelessWidget { const ScreenAbout({super.key}); diff --git a/lib/ui/screens/activity.dart b/lib/ui/screens/activity.dart index c4a4697a2a279942f72a2ff69773f1152c1c6d3f..dcf72de9ef243e1c368cc49da379409fb95913fa 100644 --- a/lib/ui/screens/activity.dart +++ b/lib/ui/screens/activity.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/activity_page.dart'; import 'package:stopmotion/cubit/nav_cubit_pages.dart'; diff --git a/lib/ui/screens/settings.dart b/lib/ui/screens/settings.dart index d08b042e201531509d7d7ac81a41610b66259905..9a40e2651ffec997c80a19883382c41aa16fc979 100644 --- a/lib/ui/screens/settings.dart +++ b/lib/ui/screens/settings.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; + import 'package:stopmotion/ui/settings/settings_form.dart'; -import 'package:stopmotion/ui/helpers/app_titles.dart'; class ScreenSettings extends StatelessWidget { const ScreenSettings({super.key}); diff --git a/lib/ui/settings/settings_form.dart b/lib/ui/settings/settings_form.dart index e9106fb751d10a80642254bc7c471bd59bd52cb3..72ad95de89da95dfe46cf343b8994737e25a1b13 100644 --- a/lib/ui/settings/settings_form.dart +++ b/lib/ui/settings/settings_form.dart @@ -1,6 +1,5 @@ -import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import 'package:unicons/unicons.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/ui/settings/theme_card.dart'; diff --git a/lib/ui/settings/theme_card.dart b/lib/ui/settings/theme_card.dart index 74351a20082666571f8bcec4f320a74139683e55..e448c10c6b111888874f3522fe01544f02e8a57f 100644 --- a/lib/ui/settings/theme_card.dart +++ b/lib/ui/settings/theme_card.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/cubit/theme_cubit.dart'; diff --git a/lib/ui/skeleton.dart b/lib/ui/skeleton.dart index 8da2685aadfc2b261e682ded04aa4a38c14d9180..6f8f62666805f09446eca8c8008cd8f4bbba7f2b 100644 --- a/lib/ui/skeleton.dart +++ b/lib/ui/skeleton.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/config/screen.dart'; import 'package:stopmotion/cubit/nav_cubit_screens.dart'; diff --git a/lib/ui/widgets/take_picture_widget.dart b/lib/ui/widgets/take_picture_widget.dart index 573bc526a36a7aaa16464aefa72f63438c2b06ef..1bc06d6e1aad583d5afa0dd52013ff39b091d2ca 100644 --- a/lib/ui/widgets/take_picture_widget.dart +++ b/lib/ui/widgets/take_picture_widget.dart @@ -2,10 +2,9 @@ import 'dart:io'; import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; -import 'package:unicons/unicons.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; import 'package:stopmotion/utils/picture_storage.dart'; -import 'package:stopmotion/utils/tools.dart'; class TakePictureWidget extends StatefulWidget { const TakePictureWidget({super.key}); diff --git a/lib/utils/color_extensions.dart b/lib/utils/color_extensions.dart deleted file mode 100644 index 4e55e338f0d3ed98b233d1ef887b7b3e17e29d97..0000000000000000000000000000000000000000 --- a/lib/utils/color_extensions.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'dart:ui'; - -extension ColorExtension on Color { - Color darken([int percent = 40]) { - assert(1 <= percent && percent <= 100); - final value = 1 - percent / 100; - return Color.fromARGB( - alpha, - (red * value).round(), - (green * value).round(), - (blue * value).round(), - ); - } - - Color lighten([int percent = 40]) { - assert(1 <= percent && percent <= 100); - final value = percent / 100; - return Color.fromARGB( - alpha, - (red + ((255 - red) * value)).round(), - (green + ((255 - green) * value)).round(), - (blue + ((255 - blue) * value)).round(), - ); - } - - Color avg(Color other) { - final red = (this.red + other.red) ~/ 2; - final green = (this.green + other.green) ~/ 2; - final blue = (this.blue + other.blue) ~/ 2; - final alpha = (this.alpha + other.alpha) ~/ 2; - return Color.fromARGB(alpha, red, green, blue); - } -} diff --git a/lib/utils/picture_storage.dart b/lib/utils/picture_storage.dart index 5fc0d542b1f09da8642d2825f4347fbd6f58195c..6f1e0acb3b78f15d4b52e4e20911efbc41acafec 100644 --- a/lib/utils/picture_storage.dart +++ b/lib/utils/picture_storage.dart @@ -1,9 +1,7 @@ import 'dart:io'; import 'package:path/path.dart'; -import 'package:path_provider/path_provider.dart'; - -import 'package:stopmotion/utils/tools.dart'; +import 'package:flutter_custom_toolbox/flutter_toolbox.dart'; class PictureStorage { Future<String> get _localPath async { diff --git a/lib/utils/tools.dart b/lib/utils/tools.dart deleted file mode 100644 index fd48b2b009b80b22248d6e7f08a63e96c4065bd7..0000000000000000000000000000000000000000 --- a/lib/utils/tools.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter/foundation.dart'; - -void printlog(String message) { - if (!kReleaseMode) { - debugPrint(message); - } -} diff --git a/pubspec.lock b/pubspec.lock index 173d913fbf1b76bd209b786104459ce54a2b9582..fb693120baa3beb5c9a5fd50e3c38bd251000119 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,20 +5,20 @@ packages: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.12.0" auto_size_text: - dependency: "direct main" + dependency: transitive description: name: auto_size_text sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" @@ -109,12 +109,12 @@ packages: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" easy_localization: - dependency: "direct main" + dependency: transitive description: name: easy_localization sha256: fa59bcdbbb911a764aa6acf96bbb6fa7a5cf8234354fc45ec1a43a0349ef0201 @@ -130,7 +130,7 @@ packages: source: hosted version: "0.0.2" equatable: - dependency: "direct main" + dependency: transitive description: name: equatable sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 @@ -159,13 +159,22 @@ packages: source: sdk version: "0.0.0" flutter_bloc: - dependency: "direct main" + dependency: transitive description: name: flutter_bloc sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a url: "https://pub.dev" source: hosted version: "8.1.6" + flutter_custom_toolbox: + dependency: "direct main" + description: + path: "." + ref: "0.1.1" + resolved-ref: ba7137ca9edec7e503ed3dbfe7f6ede7e9cfbf4d + url: "https://git.harrault.fr/android/flutter-toolbox.git" + source: git + version: "0.1.1" flutter_lints: dependency: "direct dev" description: @@ -193,7 +202,7 @@ packages: source: sdk version: "0.0.0" hive: - dependency: "direct main" + dependency: transitive description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" @@ -217,7 +226,7 @@ packages: source: hosted version: "4.0.2" hydrated_bloc: - dependency: "direct main" + dependency: transitive description: name: hydrated_bloc sha256: af35b357739fe41728df10bec03aad422cdc725a1e702e03af9d2a41ea05160c @@ -265,13 +274,13 @@ packages: source: hosted version: "1.0.0" package_info_plus: - dependency: "direct main" + dependency: transitive description: name: package_info_plus - sha256: "894f37107424311bdae3e476552229476777b8752c5a2a2369c0cb9a2d5442ef" + sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998 url: "https://pub.dev" source: hosted - version: "8.0.3" + version: "8.1.0" package_info_plus_platform_interface: dependency: transitive description: @@ -289,7 +298,7 @@ packages: source: hosted version: "1.9.0" path_provider: - dependency: "direct main" + dependency: transitive description: name: path_provider sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 @@ -340,10 +349,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -441,10 +450,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" synchronized: dependency: transitive description: @@ -465,12 +474,12 @@ packages: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" unicons: - dependency: "direct main" + dependency: transitive description: name: unicons sha256: f3eab9d87c226415ef857cfd2167e1d12ad81ea1f5783b46cf644224fea4eab7 @@ -497,10 +506,10 @@ packages: dependency: transitive description: name: win32 - sha256: "4d45dc9069dba4619dc0ebd93c7cec5e66d8482cb625a370ac806dcc8165f2ec" + sha256: "2735daae5150e8b1dfeb3eb0544b4d3af0061e9e82cef063adcd583bdae4306a" url: "https://pub.dev" source: hosted - version: "5.5.5" + version: "5.7.0" xdg_directories: dependency: transitive description: @@ -510,5 +519,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.5.3 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9e82b72e6e90c5d222c33934fbb565d3b05abfae..3ab06a72d8899b4c076b38c60c092eee9b0c3945 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: stop motion assistant publish_to: "none" -version: 0.1.1+11 +version: 0.2.0+12 environment: sdk: "^3.0.0" @@ -13,15 +13,10 @@ dependencies: sdk: flutter # base - auto_size_text: ^3.0.0 - easy_localization: ^3.0.1 - equatable: ^2.0.5 - flutter_bloc: ^8.1.1 - hive: ^2.2.3 - hydrated_bloc: ^9.0.0 - package_info_plus: ^8.0.0 - path_provider: ^2.0.11 - unicons: ^3.0.0 + flutter_custom_toolbox: + git: + url: https://git.harrault.fr/android/flutter-toolbox.git + ref: 0.1.1 # specific camera: ^0.11.0+1 @@ -34,15 +29,3 @@ flutter: uses-material-design: true assets: - 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