diff --git a/.DS_Store b/.DS_Store index 23b2012..e730df1 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index d11a282..bd2a7c0 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -1130,7 +1130,7 @@ "languageVersion": "3.7" } ], - "generated": "2025-06-17T17:48:52.089260Z", + "generated": "2025-06-17T18:40:18.603782Z", "generator": "pub", "generatorVersion": "3.7.0", "flutterRoot": "file:///Users/vitalijnecitajlo/fvm/versions/3.29.0", diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 54bf22b..1cf9d9d 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/fluttertoast-8.2.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"flutter_displaymode","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_displaymode-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.27/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/fluttertoast-8.2.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_android-2.2.16/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":false,"dependencies":["url_launcher_linux"],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":["url_launcher_windows"],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/fluttertoast-8.2.12/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","dependencies":["url_launcher_web"],"dev_dependency":false},{"name":"url_launcher_web","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_displaymode","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share_plus","dependencies":["url_launcher_web","url_launcher_windows","url_launcher_linux"]},{"name":"sqlite3_flutter_libs","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2025-06-17 20:49:46.224491","version":"3.29.0","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/fluttertoast-8.2.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false},{"name":"flutter_displaymode","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_displaymode-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.27/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/fluttertoast-8.2.12/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_android-2.2.16/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_linux","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":false,"dependencies":["url_launcher_linux"],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_linux","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_windows","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","native_build":true,"dependencies":["url_launcher_windows"],"dev_dependency":false},{"name":"sqlite3_flutter_libs","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/sqlite3_flutter_libs-0.5.32/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"url_launcher_windows","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[{"name":"file_picker","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/file_picker-10.0.0/","dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"fluttertoast","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/fluttertoast-8.2.12/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","dependencies":[],"dev_dependency":false},{"name":"share_plus","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/share_plus-10.1.4/","dependencies":["url_launcher_web"],"dev_dependency":false},{"name":"url_launcher_web","path":"/Users/vitalijnecitajlo/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_displaymode","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"fluttertoast","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"share_plus","dependencies":["url_launcher_web","url_launcher_windows","url_launcher_linux"]},{"name":"sqlite3_flutter_libs","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2025-06-17 21:40:17.098788","version":"3.29.0","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/assets/.DS_Store b/assets/.DS_Store index 0d775bb..67ead26 100644 Binary files a/assets/.DS_Store and b/assets/.DS_Store differ diff --git a/assets/images/training_empty.png b/assets/images/training_empty.png new file mode 100644 index 0000000..25dd25f Binary files /dev/null and b/assets/images/training_empty.png differ diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 68c3ffb..c0dc899 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -410,6 +410,10 @@ class $AssetsImagesGen { /// File path: assets/images/quote.png AssetGenImage get quote => const AssetGenImage('assets/images/quote.png'); + /// File path: assets/images/training_empty.png + AssetGenImage get trainingEmpty => + const AssetGenImage('assets/images/training_empty.png'); + /// List of all assets List get values => [ aGitkeep, @@ -427,6 +431,7 @@ class $AssetsImagesGen { logo, noData, quote, + trainingEmpty, ]; } diff --git a/lib/i18n/strings.g.dart b/lib/i18n/strings.g.dart index bd6bd7c..ba4cd71 100644 --- a/lib/i18n/strings.g.dart +++ b/lib/i18n/strings.g.dart @@ -6,7 +6,7 @@ /// Locales: 2 /// Strings: 20 (10 per locale) /// -/// Built on 2025-06-17 at 17:49 UTC +/// Built on 2025-06-17 at 18:40 UTC // coverage:ignore-file // ignore_for_file: type=lint, unused_import diff --git a/lib/router.dart b/lib/router.dart index 677e01a..e2c30c2 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -22,6 +22,8 @@ class AppRouter extends RootStackRouter { ], ), + AutoRoute(path: '/training', page: TrainingRoute.page), + AutoRoute(path: '/crud_collection', page: CrudCollectionRoute.page), AutoRoute(path: '/collection_search', page: CollectionSearchRoute.page), AutoRoute(path: '/crudFullField', page: CrudCollectionFullscreenField.page), diff --git a/lib/router.gr.dart b/lib/router.gr.dart index 189f9f3..dfa4f2a 100644 --- a/lib/router.gr.dart +++ b/lib/router.gr.dart @@ -9,10 +9,10 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i13; -import 'package:flutter/cupertino.dart' as _i14; -import 'package:flutter/material.dart' as _i16; -import 'package:remever/database/database.dart' as _i15; +import 'package:auto_route/auto_route.dart' as _i14; +import 'package:flutter/cupertino.dart' as _i15; +import 'package:flutter/material.dart' as _i17; +import 'package:remever/database/database.dart' as _i16; import 'package:remever/screens/auth/auth_screen.dart' as _i1; import 'package:remever/screens/collections/collection_detail_screen.dart' as _i2; @@ -28,16 +28,17 @@ import 'package:remever/screens/sandbox/sandbox_screen.dart' as _i9; import 'package:remever/screens/settings/settings_screen.dart' as _i10; import 'package:remever/screens/splash/splash_screen.dart' as _i11; import 'package:remever/screens/statistick/statistick_screen.dart' as _i12; +import 'package:remever/screens/training/training_screen.dart' as _i13; /// generated route for /// [_i1.AuthScreen] -class AuthRoute extends _i13.PageRouteInfo { - const AuthRoute({List<_i13.PageRouteInfo>? children}) +class AuthRoute extends _i14.PageRouteInfo { + const AuthRoute({List<_i14.PageRouteInfo>? children}) : super(AuthRoute.name, initialChildren: children); static const String name = 'AuthRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { return const _i1.AuthScreen(); @@ -48,11 +49,11 @@ class AuthRoute extends _i13.PageRouteInfo { /// generated route for /// [_i2.CollectionDetailScreen] class CollectionDetailRoute - extends _i13.PageRouteInfo { + extends _i14.PageRouteInfo { CollectionDetailRoute({ - _i14.Key? key, - required _i15.Collection collection, - List<_i13.PageRouteInfo>? children, + _i15.Key? key, + required _i16.Collection collection, + List<_i14.PageRouteInfo>? children, }) : super( CollectionDetailRoute.name, args: CollectionDetailRouteArgs(key: key, collection: collection), @@ -61,7 +62,7 @@ class CollectionDetailRoute static const String name = 'CollectionDetailRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -76,9 +77,9 @@ class CollectionDetailRoute class CollectionDetailRouteArgs { const CollectionDetailRouteArgs({this.key, required this.collection}); - final _i14.Key? key; + final _i15.Key? key; - final _i15.Collection collection; + final _i16.Collection collection; @override String toString() { @@ -88,13 +89,13 @@ class CollectionDetailRouteArgs { /// generated route for /// [_i3.CollectionScreen] -class CollectionRoute extends _i13.PageRouteInfo { - const CollectionRoute({List<_i13.PageRouteInfo>? children}) +class CollectionRoute extends _i14.PageRouteInfo { + const CollectionRoute({List<_i14.PageRouteInfo>? children}) : super(CollectionRoute.name, initialChildren: children); static const String name = 'CollectionRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { return const _i3.CollectionScreen(); @@ -105,11 +106,11 @@ class CollectionRoute extends _i13.PageRouteInfo { /// generated route for /// [_i4.CollectionSearchScreen] class CollectionSearchRoute - extends _i13.PageRouteInfo { + extends _i14.PageRouteInfo { CollectionSearchRoute({ - _i14.Key? key, - required void Function(_i15.Collection) onCollectionSelect, - List<_i13.PageRouteInfo>? children, + _i15.Key? key, + required void Function(_i16.Collection) onCollectionSelect, + List<_i14.PageRouteInfo>? children, }) : super( CollectionSearchRoute.name, args: CollectionSearchRouteArgs( @@ -121,7 +122,7 @@ class CollectionSearchRoute static const String name = 'CollectionSearchRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -136,9 +137,9 @@ class CollectionSearchRoute class CollectionSearchRouteArgs { const CollectionSearchRouteArgs({this.key, required this.onCollectionSelect}); - final _i14.Key? key; + final _i15.Key? key; - final void Function(_i15.Collection) onCollectionSelect; + final void Function(_i16.Collection) onCollectionSelect; @override String toString() { @@ -148,11 +149,11 @@ class CollectionSearchRouteArgs { /// generated route for /// [_i5.CreateScreen] -class CreateRoute extends _i13.PageRouteInfo { +class CreateRoute extends _i14.PageRouteInfo { CreateRoute({ - _i14.Key? key, - _i15.Collection? collection, - List<_i13.PageRouteInfo>? children, + _i15.Key? key, + _i16.Collection? collection, + List<_i14.PageRouteInfo>? children, }) : super( CreateRoute.name, args: CreateRouteArgs(key: key, collection: collection), @@ -161,7 +162,7 @@ class CreateRoute extends _i13.PageRouteInfo { static const String name = 'CreateRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { final args = data.argsAs( @@ -175,9 +176,9 @@ class CreateRoute extends _i13.PageRouteInfo { class CreateRouteArgs { const CreateRouteArgs({this.key, this.collection}); - final _i14.Key? key; + final _i15.Key? key; - final _i15.Collection? collection; + final _i16.Collection? collection; @override String toString() { @@ -188,15 +189,15 @@ class CreateRouteArgs { /// generated route for /// [_i6.CrudCollectionFullscreenField] class CrudCollectionFullscreenField - extends _i13.PageRouteInfo { + extends _i14.PageRouteInfo { CrudCollectionFullscreenField({ - _i14.Key? key, + _i15.Key? key, String title = '', String? hint, String? content, double height = 92, required void Function(String?) onEditingComplete, - List<_i13.PageRouteInfo>? children, + List<_i14.PageRouteInfo>? children, }) : super( CrudCollectionFullscreenField.name, args: CrudCollectionFullscreenFieldArgs( @@ -212,7 +213,7 @@ class CrudCollectionFullscreenField static const String name = 'CrudCollectionFullscreenField'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { final args = data.argsAs(); @@ -238,7 +239,7 @@ class CrudCollectionFullscreenFieldArgs { required this.onEditingComplete, }); - final _i14.Key? key; + final _i15.Key? key; final String title; @@ -258,11 +259,11 @@ class CrudCollectionFullscreenFieldArgs { /// generated route for /// [_i7.CrudCollectionScreen] -class CrudCollectionRoute extends _i13.PageRouteInfo { +class CrudCollectionRoute extends _i14.PageRouteInfo { CrudCollectionRoute({ - _i14.Key? key, - _i15.Collection? editedCollection, - List<_i13.PageRouteInfo>? children, + _i15.Key? key, + _i16.Collection? editedCollection, + List<_i14.PageRouteInfo>? children, }) : super( CrudCollectionRoute.name, args: CrudCollectionRouteArgs( @@ -274,7 +275,7 @@ class CrudCollectionRoute extends _i13.PageRouteInfo { static const String name = 'CrudCollectionRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { final args = data.argsAs( @@ -291,9 +292,9 @@ class CrudCollectionRoute extends _i13.PageRouteInfo { class CrudCollectionRouteArgs { const CrudCollectionRouteArgs({this.key, this.editedCollection}); - final _i14.Key? key; + final _i15.Key? key; - final _i15.Collection? editedCollection; + final _i16.Collection? editedCollection; @override String toString() { @@ -303,13 +304,13 @@ class CrudCollectionRouteArgs { /// generated route for /// [_i8.HomeScreen] -class HomeRoute extends _i13.PageRouteInfo { - const HomeRoute({List<_i13.PageRouteInfo>? children}) +class HomeRoute extends _i14.PageRouteInfo { + const HomeRoute({List<_i14.PageRouteInfo>? children}) : super(HomeRoute.name, initialChildren: children); static const String name = 'HomeRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { return const _i8.HomeScreen(); @@ -319,13 +320,13 @@ class HomeRoute extends _i13.PageRouteInfo { /// generated route for /// [_i9.SandboxScreen] -class SandboxRoute extends _i13.PageRouteInfo { - const SandboxRoute({List<_i13.PageRouteInfo>? children}) +class SandboxRoute extends _i14.PageRouteInfo { + const SandboxRoute({List<_i14.PageRouteInfo>? children}) : super(SandboxRoute.name, initialChildren: children); static const String name = 'SandboxRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { return const _i9.SandboxScreen(); @@ -335,13 +336,13 @@ class SandboxRoute extends _i13.PageRouteInfo { /// generated route for /// [_i10.SettingsScreen] -class SettingsRoute extends _i13.PageRouteInfo { - const SettingsRoute({List<_i13.PageRouteInfo>? children}) +class SettingsRoute extends _i14.PageRouteInfo { + const SettingsRoute({List<_i14.PageRouteInfo>? children}) : super(SettingsRoute.name, initialChildren: children); static const String name = 'SettingsRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { return const _i10.SettingsScreen(); @@ -351,13 +352,13 @@ class SettingsRoute extends _i13.PageRouteInfo { /// generated route for /// [_i11.SplashScreen] -class SplashRoute extends _i13.PageRouteInfo { - const SplashRoute({List<_i13.PageRouteInfo>? children}) +class SplashRoute extends _i14.PageRouteInfo { + const SplashRoute({List<_i14.PageRouteInfo>? children}) : super(SplashRoute.name, initialChildren: children); static const String name = 'SplashRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { return const _i11.SplashScreen(); @@ -367,8 +368,8 @@ class SplashRoute extends _i13.PageRouteInfo { /// generated route for /// [_i12.StatistickScreen] -class StatistickRoute extends _i13.PageRouteInfo { - StatistickRoute({_i16.Key? key, List<_i13.PageRouteInfo>? children}) +class StatistickRoute extends _i14.PageRouteInfo { + StatistickRoute({_i17.Key? key, List<_i14.PageRouteInfo>? children}) : super( StatistickRoute.name, args: StatistickRouteArgs(key: key), @@ -377,7 +378,7 @@ class StatistickRoute extends _i13.PageRouteInfo { static const String name = 'StatistickRoute'; - static _i13.PageInfo page = _i13.PageInfo( + static _i14.PageInfo page = _i14.PageInfo( name, builder: (data) { final args = data.argsAs( @@ -391,10 +392,26 @@ class StatistickRoute extends _i13.PageRouteInfo { class StatistickRouteArgs { const StatistickRouteArgs({this.key}); - final _i16.Key? key; + final _i17.Key? key; @override String toString() { return 'StatistickRouteArgs{key: $key}'; } } + +/// generated route for +/// [_i13.TrainingScreen] +class TrainingRoute extends _i14.PageRouteInfo { + const TrainingRoute({List<_i14.PageRouteInfo>? children}) + : super(TrainingRoute.name, initialChildren: children); + + static const String name = 'TrainingRoute'; + + static _i14.PageInfo page = _i14.PageInfo( + name, + builder: (data) { + return const _i13.TrainingScreen(); + }, + ); +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 13744de..36a0dea 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -37,7 +37,7 @@ class HomeScreen extends StatelessWidget { }, ), ), - _buildCentralButton(), + _buildCentralButton(context), ], ); } @@ -80,12 +80,12 @@ class HomeScreen extends StatelessWidget { } /// Построение центральной кнопки - Widget _buildCentralButton() { + Widget _buildCentralButton(BuildContext context) { return Align( alignment: Alignment(0, 0.91), child: GestureDetector( onTap: () { - // Логика нажатия на центральную кнопку + context.pushRoute(TrainingRoute()); }, child: SizedBox.square( dimension: 60.r, diff --git a/lib/screens/training/cubit/training_cubit.dart b/lib/screens/training/cubit/training_cubit.dart new file mode 100644 index 0000000..f2e6e5b --- /dev/null +++ b/lib/screens/training/cubit/training_cubit.dart @@ -0,0 +1,25 @@ +import 'package:bloc/bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'training_state.dart'; +part 'training_cubit.freezed.dart'; + +class TrainingCubit extends Cubit { + TrainingCubit() : super(TrainingState.data()); + + Future toLoading() async { + emit(TrainingState.loading()); + } + + Future toEmptyState() async { + emit(TrainingState.empty()); + } + + Future toDataState() async { + emit(TrainingState.data()); + } + + Future toResultState() async { + emit(TrainingState.result()); + } +} diff --git a/lib/screens/training/cubit/training_cubit.freezed.dart b/lib/screens/training/cubit/training_cubit.freezed.dart new file mode 100644 index 0000000..c2cf45e --- /dev/null +++ b/lib/screens/training/cubit/training_cubit.freezed.dart @@ -0,0 +1,560 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'training_cubit.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +/// @nodoc +mixin _$TrainingState { + @optionalTypeArgs + TResult when({ + required TResult Function() loading, + required TResult Function() empty, + required TResult Function() data, + required TResult Function() result, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? loading, + TResult? Function()? empty, + TResult? Function()? data, + TResult? Function()? result, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? loading, + TResult Function()? empty, + TResult Function()? data, + TResult Function()? result, + required TResult orElse(), + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_Loading value) loading, + required TResult Function(_Empty value) empty, + required TResult Function(_Data value) data, + required TResult Function(_Result value) result, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Loading value)? loading, + TResult? Function(_Empty value)? empty, + TResult? Function(_Data value)? data, + TResult? Function(_Result value)? result, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Loading value)? loading, + TResult Function(_Empty value)? empty, + TResult Function(_Data value)? data, + TResult Function(_Result value)? result, + required TResult orElse(), + }) => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $TrainingStateCopyWith<$Res> { + factory $TrainingStateCopyWith( + TrainingState value, + $Res Function(TrainingState) then, + ) = _$TrainingStateCopyWithImpl<$Res, TrainingState>; +} + +/// @nodoc +class _$TrainingStateCopyWithImpl<$Res, $Val extends TrainingState> + implements $TrainingStateCopyWith<$Res> { + _$TrainingStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of TrainingState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$LoadingImplCopyWith<$Res> { + factory _$$LoadingImplCopyWith( + _$LoadingImpl value, + $Res Function(_$LoadingImpl) then, + ) = __$$LoadingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$LoadingImplCopyWithImpl<$Res> + extends _$TrainingStateCopyWithImpl<$Res, _$LoadingImpl> + implements _$$LoadingImplCopyWith<$Res> { + __$$LoadingImplCopyWithImpl( + _$LoadingImpl _value, + $Res Function(_$LoadingImpl) _then, + ) : super(_value, _then); + + /// Create a copy of TrainingState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$LoadingImpl implements _Loading { + const _$LoadingImpl(); + + @override + String toString() { + return 'TrainingState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$LoadingImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() loading, + required TResult Function() empty, + required TResult Function() data, + required TResult Function() result, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? loading, + TResult? Function()? empty, + TResult? Function()? data, + TResult? Function()? result, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? loading, + TResult Function()? empty, + TResult Function()? data, + TResult Function()? result, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Loading value) loading, + required TResult Function(_Empty value) empty, + required TResult Function(_Data value) data, + required TResult Function(_Result value) result, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Loading value)? loading, + TResult? Function(_Empty value)? empty, + TResult? Function(_Data value)? data, + TResult? Function(_Result value)? result, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Loading value)? loading, + TResult Function(_Empty value)? empty, + TResult Function(_Data value)? data, + TResult Function(_Result value)? result, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class _Loading implements TrainingState { + const factory _Loading() = _$LoadingImpl; +} + +/// @nodoc +abstract class _$$EmptyImplCopyWith<$Res> { + factory _$$EmptyImplCopyWith( + _$EmptyImpl value, + $Res Function(_$EmptyImpl) then, + ) = __$$EmptyImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$EmptyImplCopyWithImpl<$Res> + extends _$TrainingStateCopyWithImpl<$Res, _$EmptyImpl> + implements _$$EmptyImplCopyWith<$Res> { + __$$EmptyImplCopyWithImpl( + _$EmptyImpl _value, + $Res Function(_$EmptyImpl) _then, + ) : super(_value, _then); + + /// Create a copy of TrainingState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$EmptyImpl implements _Empty { + const _$EmptyImpl(); + + @override + String toString() { + return 'TrainingState.empty()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$EmptyImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() loading, + required TResult Function() empty, + required TResult Function() data, + required TResult Function() result, + }) { + return empty(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? loading, + TResult? Function()? empty, + TResult? Function()? data, + TResult? Function()? result, + }) { + return empty?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? loading, + TResult Function()? empty, + TResult Function()? data, + TResult Function()? result, + required TResult orElse(), + }) { + if (empty != null) { + return empty(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Loading value) loading, + required TResult Function(_Empty value) empty, + required TResult Function(_Data value) data, + required TResult Function(_Result value) result, + }) { + return empty(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Loading value)? loading, + TResult? Function(_Empty value)? empty, + TResult? Function(_Data value)? data, + TResult? Function(_Result value)? result, + }) { + return empty?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Loading value)? loading, + TResult Function(_Empty value)? empty, + TResult Function(_Data value)? data, + TResult Function(_Result value)? result, + required TResult orElse(), + }) { + if (empty != null) { + return empty(this); + } + return orElse(); + } +} + +abstract class _Empty implements TrainingState { + const factory _Empty() = _$EmptyImpl; +} + +/// @nodoc +abstract class _$$DataImplCopyWith<$Res> { + factory _$$DataImplCopyWith( + _$DataImpl value, + $Res Function(_$DataImpl) then, + ) = __$$DataImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$DataImplCopyWithImpl<$Res> + extends _$TrainingStateCopyWithImpl<$Res, _$DataImpl> + implements _$$DataImplCopyWith<$Res> { + __$$DataImplCopyWithImpl(_$DataImpl _value, $Res Function(_$DataImpl) _then) + : super(_value, _then); + + /// Create a copy of TrainingState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$DataImpl implements _Data { + const _$DataImpl(); + + @override + String toString() { + return 'TrainingState.data()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$DataImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() loading, + required TResult Function() empty, + required TResult Function() data, + required TResult Function() result, + }) { + return data(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? loading, + TResult? Function()? empty, + TResult? Function()? data, + TResult? Function()? result, + }) { + return data?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? loading, + TResult Function()? empty, + TResult Function()? data, + TResult Function()? result, + required TResult orElse(), + }) { + if (data != null) { + return data(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Loading value) loading, + required TResult Function(_Empty value) empty, + required TResult Function(_Data value) data, + required TResult Function(_Result value) result, + }) { + return data(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Loading value)? loading, + TResult? Function(_Empty value)? empty, + TResult? Function(_Data value)? data, + TResult? Function(_Result value)? result, + }) { + return data?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Loading value)? loading, + TResult Function(_Empty value)? empty, + TResult Function(_Data value)? data, + TResult Function(_Result value)? result, + required TResult orElse(), + }) { + if (data != null) { + return data(this); + } + return orElse(); + } +} + +abstract class _Data implements TrainingState { + const factory _Data() = _$DataImpl; +} + +/// @nodoc +abstract class _$$ResultImplCopyWith<$Res> { + factory _$$ResultImplCopyWith( + _$ResultImpl value, + $Res Function(_$ResultImpl) then, + ) = __$$ResultImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ResultImplCopyWithImpl<$Res> + extends _$TrainingStateCopyWithImpl<$Res, _$ResultImpl> + implements _$$ResultImplCopyWith<$Res> { + __$$ResultImplCopyWithImpl( + _$ResultImpl _value, + $Res Function(_$ResultImpl) _then, + ) : super(_value, _then); + + /// Create a copy of TrainingState + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$ResultImpl implements _Result { + const _$ResultImpl(); + + @override + String toString() { + return 'TrainingState.result()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ResultImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() loading, + required TResult Function() empty, + required TResult Function() data, + required TResult Function() result, + }) { + return result(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? loading, + TResult? Function()? empty, + TResult? Function()? data, + TResult? Function()? result, + }) { + return result?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? loading, + TResult Function()? empty, + TResult Function()? data, + TResult Function()? result, + required TResult orElse(), + }) { + if (result != null) { + return result(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Loading value) loading, + required TResult Function(_Empty value) empty, + required TResult Function(_Data value) data, + required TResult Function(_Result value) result, + }) { + return result(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_Loading value)? loading, + TResult? Function(_Empty value)? empty, + TResult? Function(_Data value)? data, + TResult? Function(_Result value)? result, + }) { + return result?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Loading value)? loading, + TResult Function(_Empty value)? empty, + TResult Function(_Data value)? data, + TResult Function(_Result value)? result, + required TResult orElse(), + }) { + if (result != null) { + return result(this); + } + return orElse(); + } +} + +abstract class _Result implements TrainingState { + const factory _Result() = _$ResultImpl; +} diff --git a/lib/screens/training/cubit/training_state.dart b/lib/screens/training/cubit/training_state.dart new file mode 100644 index 0000000..4021db4 --- /dev/null +++ b/lib/screens/training/cubit/training_state.dart @@ -0,0 +1,9 @@ +part of 'training_cubit.dart'; + +@freezed +class TrainingState with _$TrainingState { + const factory TrainingState.loading() = _Loading; + const factory TrainingState.empty() = _Empty; + const factory TrainingState.data() = _Data; + const factory TrainingState.result() = _Result; +} diff --git a/lib/screens/training/states/empty.dart b/lib/screens/training/states/empty.dart new file mode 100644 index 0000000..d8b7cde --- /dev/null +++ b/lib/screens/training/states/empty.dart @@ -0,0 +1,71 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:remever/common/resources.dart'; +import 'package:remever/common/widgets/typography.dart'; +import 'package:remever/common/widgets/wspace.dart'; +import 'package:remever/components/extensions/context.dart'; +import 'package:remever/gen/assets.gen.dart'; +import 'package:remever/router.gr.dart'; +import 'package:remever/widgets/primary_button.dart'; + +class TrainingEmpty extends StatelessWidget { + const TrainingEmpty({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.bg, + appBar: _buildAppBar(context), + body: _buildMain(context), + ); + } + + /// Построение шапки + AppBar _buildAppBar(BuildContext context) { + return AppBar( + backgroundColor: AppColors.white, + shadowColor: Colors.transparent, + leading: GestureDetector( + onTap: () => context.back(), + child: const Icon(Icons.close, color: Colors.black), + ), + centerTitle: true, + title: AppTypography( + 'Тренировка', + type: SemiBold20px(), + color: AppColors.body_text, + ), + ); + } + + Widget _buildMain(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16).r, + child: Column( + children: [ + HSpace(90), + Assets.images.trainingEmpty.image(height: 127.h, width: 160.w), + HSpace(20), + AppTypography( + 'К сожалению, у вас нет карточек для изучения', + type: SemiBold20px(), + maxLines: 3, + textAlign: TextAlign.center, + ), + Spacer(), + PrimaryButton( + onTap: () { + context.router.replaceAll([CreateRoute()]); + }, + child: AppTypography( + 'Создать карточку', + type: Medium14px(), + color: Colors.white, + ), + ), + HSpace(90), + ], + ), + ); + } +} diff --git a/lib/screens/training/states/loading.dart b/lib/screens/training/states/loading.dart new file mode 100644 index 0000000..3f9eb68 --- /dev/null +++ b/lib/screens/training/states/loading.dart @@ -0,0 +1,35 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:remever/common/resources.dart'; +import 'package:remever/common/widgets/typography.dart'; + +class TrainingLoading extends StatelessWidget { + const TrainingLoading({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.bg, + appBar: _buildAppBar(context), + body: Center(child: CircularProgressIndicator(color: AppColors.primary)), + ); + } + + /// Построение шапки + AppBar _buildAppBar(BuildContext context) { + return AppBar( + backgroundColor: AppColors.white, + shadowColor: Colors.transparent, + leading: GestureDetector( + onTap: () => context.back(), + child: const Icon(Icons.close, color: Colors.black), + ), + centerTitle: true, + title: AppTypography( + 'Тренировка', + type: SemiBold20px(), + color: AppColors.body_text, + ), + ); + } +} diff --git a/lib/screens/training/training_screen.dart b/lib/screens/training/training_screen.dart new file mode 100644 index 0000000..21d44f4 --- /dev/null +++ b/lib/screens/training/training_screen.dart @@ -0,0 +1,185 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:remever/common/resources.dart'; +import 'package:remever/common/typography.dart'; +import 'package:remever/common/widgets/typography.dart'; +import 'package:remever/common/widgets/w_if.dart'; +import 'package:remever/common/widgets/wspace.dart'; +import 'package:remever/components/extensions/context.dart'; +import 'package:remever/components/extensions/state.dart'; +import 'package:remever/gen/assets.gen.dart'; +import 'package:remever/router.gr.dart'; +import 'package:remever/screens/training/cubit/training_cubit.dart'; +import 'package:remever/screens/training/states/empty.dart'; +import 'package:remever/screens/training/states/loading.dart'; +import 'package:remever/screens/training/widgets/training_ticket.dart'; +import 'package:remever/widgets/primary_button.dart'; + +@RoutePage() +class TrainingScreen extends StatelessWidget { + const TrainingScreen({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => TrainingCubit(), + child: _buildMain(), + ); + } + + /// + /// Построение основного блока + /// + Widget _buildMain() { + return PopScope( + canPop: false, + child: BlocBuilder( + builder: (BuildContext context, state) { + return state.when( + loading: () => TrainingLoading(), + empty: () => TrainingEmpty(), + data: () => TrainingData(), + result: () => Placeholder(), + ); + }, + ), + ); + } +} + +class TrainingData extends StatefulWidget { + const TrainingData({super.key}); + + @override + State createState() => _TrainingDataState(); +} + +class _TrainingDataState extends State { + bool _showAnswer = false; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.bg, + appBar: _buildAppBar(context), + body: _buildMain(), + ); + } + + /// Построение шапки + AppBar _buildAppBar(BuildContext context) { + return AppBar( + backgroundColor: AppColors.white, + shadowColor: Colors.transparent, + leading: GestureDetector( + onTap: () => context.back(), + child: const Icon(Icons.close, color: Colors.black), + ), + centerTitle: true, + title: AppTypography( + 'Тренировка', + type: SemiBold20px(), + color: AppColors.body_text, + ), + actions: [_buildCounter(), WSpace(16)], + ); + } + + Widget _buildCounter() { + return Center( + child: Container( + height: 24.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(100)).r, + color: AppColors.bg, + ), + child: Padding( + padding: const EdgeInsets.all(3).r, + child: Center(child: AppTypography('1 из 9', type: Regular14px())), + ), + ), + ); + } + + Widget _buildMain() { + return Column( + children: [_buildTickets(), _buildShowAnswerButton(), _buildActions()], + ); + } + + Widget _buildActions() { + return Padding( + padding: const EdgeInsets.all(16).r, + child: Row( + spacing: 8.r, + children: [ + Flexible( + child: PrimaryButton( + onTap: () {}, + color: AppColors.danger, + child: AppTypography( + 'Не помню', + type: Medium14px(), + color: Colors.white, + ), + ), + ), + Flexible( + child: PrimaryButton( + child: AppTypography( + 'Помню', + type: Medium14px(), + color: Colors.white, + ), + onTap: () {}, + ), + ), + ], + ), + ); + } + + Widget _buildShowAnswerButton() { + return Wif( + condition: !_showAnswer, + builder: + (context) => PrimaryButton( + onTap: () { + safeSetState(() { + _showAnswer = true; + }); + }, + color: AppColors.secondary, + width: 170, + child: AppTypography( + 'Показать ответ', + type: Medium14px(), + color: AppColors.primary, + ), + ), + ); + } + + Widget _buildTickets() { + return Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(16).r, + child: Column( + spacing: 8.r, + children: [ + TrainingTicket(), + Wif( + condition: _showAnswer, + builder: (context) => TrainingTicket(isAnswer: true), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/training/widgets/training_ticket.dart b/lib/screens/training/widgets/training_ticket.dart new file mode 100644 index 0000000..f126042 --- /dev/null +++ b/lib/screens/training/widgets/training_ticket.dart @@ -0,0 +1,124 @@ +import 'package:flutter/material.dart'; +import 'package:remever/common/resources.dart'; +import 'package:remever/common/widgets/typography.dart'; +import 'package:remever/common/widgets/w_if.dart'; +import 'package:remever/common/widgets/wspace.dart'; +import 'package:remever/components/extensions/context.dart'; + +class TrainingTicket extends StatelessWidget { + const TrainingTicket({super.key, this.isAnswer = false}); + + final bool isAnswer; + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12).r, + color: Colors.white, + ), + constraints: BoxConstraints(minHeight: 50.h), + child: Stack( + children: [ + SizedBox( + height: 90.h, + width: double.infinity, + child: DecoratedBox(decoration: getDecoration()), + ), + Padding( + padding: const EdgeInsets.all(12).r, + child: Column( + children: [ + _buildCollectionInfo(), + _buildImage(), + HSpace(4), + _buildText(context), + ], + ), + ), + ], + ), + ); + } + + Widget _buildCollectionInfo() { + return Wif( + condition: !isAnswer, + builder: (context) { + return Padding( + padding: const EdgeInsets.only(bottom: 8).r, + child: Row( + children: [ + SizedBox( + height: 24.h, + width: 24.w, + child: ClipOval( + child: Image.network( + 'https://avatars.mds.yandex.net/i?id=56429b65e9098a58fcd538387d43bcbb_l-5384017-images-thumbs&n=13', + fit: BoxFit.cover, + ), + ), + ), + WSpace(4), + AppTypography( + 'Астрология и астрофизика', + type: Regular14px(), + color: AppColors.disabled, + ), + ], + ), + ); + }, + ); + } + + /// Декорирование контейнера + BoxDecoration getDecoration() { + return BoxDecoration( + borderRadius: BorderRadius.circular(12).r, + gradient: LinearGradient( + colors: [ + isAnswer ? AppColors.answer : AppColors.question, + Colors.white, + ], + begin: Alignment.topLeft, + end: const Alignment(-0.5, 1), + stops: const [0.25, 0.25], + ), + ); + } + + Widget _buildText(BuildContext context) { + return AppTypography( + 'Родился 19 февраля 1473 года в Торуне в семье купца. После смерти отца воспитывался у дяди, епископа Вармийской епархии. Коперник изложил свои идеи в сочинении «Commentariolus» («Малый комментарий»), в котором сформулировал основные положения гелиоцентрической системы мира в виде 6 аксиом. Их смысл состоит в том, что Земля, как и другие планеты,' + 'Родился 19 февраля 1473 года в Торуне в семье купца. После смерти отца воспитывался у дяди, епископа Вармийской епархии. Коперник изложил свои идеи в сочинении «Commentariolus» («Малый комментарий»), в котором сформулировал основные положения гелиоцентрической системы мира в виде 6 аксиом. Их смысл состоит в том, что Земля, как и другие планеты,', + maxLines: 99, + type: Regular14px(), + ); + } + + Widget _buildImage() { + // final imageBytes = + // isAnswer ? ticket.answerImage : ticket.questionImage; + + return Wif( + condition: true, // imageBytes != null, + builder: + (context) => Padding( + padding: const EdgeInsets.only(right: 8).r, + child: SizedBox.square( + dimension: 100.r, + child: ClipRRect( + borderRadius: BorderRadius.circular(8).r, + // child: Image.memory(imageBytes!, fit: BoxFit.cover), + child: Image.network( + 'https://avatars.mds.yandex.net/i?id=56429b65e9098a58fcd538387d43bcbb_l-5384017-images-thumbs&n=13', + fit: BoxFit.cover, + ), + ), + ), + ), + ); + } +}