diff --git a/README copy.md b/README copy.md deleted file mode 100644 index cbdd835..0000000 --- a/README copy.md +++ /dev/null @@ -1,16 +0,0 @@ -# friflex_starter - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/app_services/aurora/app_services/.gitignore b/app_services/aurora/app_services/.gitignore deleted file mode 100644 index ac5aa98..0000000 --- a/app_services/aurora/app_services/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -build/ diff --git a/app_services/aurora/app_services/.metadata b/app_services/aurora/app_services/.metadata deleted file mode 100644 index 2b37703..0000000 --- a/app_services/aurora/app_services/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "7482962148e8d758338d8a28f589f317e1e42ba4" - channel: "stable" - -project_type: package diff --git a/app_services/aurora/app_services/README.md b/app_services/aurora/app_services/README.md deleted file mode 100644 index a03f3bd..0000000 --- a/app_services/aurora/app_services/README.md +++ /dev/null @@ -1 +0,0 @@ -# Базовые сервисы для приложения \ No newline at end of file diff --git a/app_services/aurora/app_services/analysis_options.yaml b/app_services/aurora/app_services/analysis_options.yaml deleted file mode 100644 index 6e32909..0000000 --- a/app_services/aurora/app_services/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -include: package:friflex_lint_rules/analysis_options.yaml \ No newline at end of file diff --git a/app_services/aurora/app_services/lib/app_services.dart b/app_services/aurora/app_services/lib/app_services.dart deleted file mode 100644 index 7b6c1ee..0000000 --- a/app_services/aurora/app_services/lib/app_services.dart +++ /dev/null @@ -1,4 +0,0 @@ -library app_services; - -export 'src/app_path_provider.dart'; -export 'src/app_secure_storage.dart'; diff --git a/app_services/aurora/app_services/lib/src/app_path_provider.dart b/app_services/aurora/app_services/lib/src/app_path_provider.dart deleted file mode 100644 index 8dbc387..0000000 --- a/app_services/aurora/app_services/lib/src/app_path_provider.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:i_app_services/i_app_services.dart'; -import 'package:path_provider/path_provider.dart'; - -/// Класс для Aurora реализации сервиса работы с путями -class AppPathProvider implements IPathProvider { - /// Наименование сервиса - static const name = 'AuroraAppPathProvider'; - - @override - Future getAppDocumentsDirectoryPath() async { - return (await getApplicationDocumentsDirectory()).path; - } -} diff --git a/app_services/aurora/app_services/lib/src/app_secure_storage.dart b/app_services/aurora/app_services/lib/src/app_secure_storage.dart deleted file mode 100644 index c0ab727..0000000 --- a/app_services/aurora/app_services/lib/src/app_secure_storage.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:flutter_secure_storage_aurora/flutter_secure_storage_aurora.dart'; -import 'package:i_app_services/i_app_services.dart'; - -/// Класс для Aurora реализации сервис по работе с защищенным хранилищем -final class AppSecureStorage implements ISecureStorage { - /// Создает сервис для работы с защищенным хранилищем - /// - /// Принимает: - /// - [secretKey] - ключ шифрования данных - AppSecureStorage({required this.secretKey}){ - FlutterSecureStorageAurora.setSecret(secretKey); - } - - @override - final String secretKey; - - - static const name = 'AuroraAppSecureStorage'; - - /// Экземпляр хранилища данных - final _box = const FlutterSecureStorage(); - - @override - Future clear() async { - await _box.deleteAll(); - } - - @override - Future delete(String key) async { - await _box.delete(key: key); - } - - @override - Future exists(String key) { - return _box.containsKey(key: key); - } - - @override - Future read(String key) async { - return _box.read(key: key); - } - - @override - Future write(String key, String value) async { - await _box.write(key: key, value: value); - } - - @override - String get nameImpl => AppSecureStorage.name; -} diff --git a/app_services/aurora/app_services/pubspec.yaml b/app_services/aurora/app_services/pubspec.yaml deleted file mode 100644 index d3ca044..0000000 --- a/app_services/aurora/app_services/pubspec.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: app_services -description: "Google сервисы для приложения" -version: 0.0.1 -publish_to: none - -environment: - sdk: ^3.5.0 - flutter: ^3.24.0 - - -dependencies: - flutter: - sdk: flutter - - # Зависимости для сервиса защищенного хранилища - flutter_secure_storage: 8.0.0 - flutter_secure_storage_aurora: - git: - url: https://gitlab.com/omprussia/flutter/flutter-community-plugins/flutter_secure_storage_aurora.git - ref: aurora-0.5.3 - - # для работы с путями в хранилища - path_provider: 2.1.4 - path_provider_aurora: - git: - url: https://gitlab.com/omprussia/flutter/packages.git - ref: aurora-path_provider_aurora-0.6.0 - path: packages/path_provider_aurora - - # Обязательные интерфейсы - i_app_services: - path: ../../i_app_services - -dev_dependencies: - friflex_lint_rules: - hosted: https://pub.friflex.com - version: 4.0.1 diff --git a/app_services/gms/app_services/.gitignore b/app_services/gms/app_services/.gitignore deleted file mode 100644 index ac5aa98..0000000 --- a/app_services/gms/app_services/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -build/ diff --git a/app_services/gms/app_services/.metadata b/app_services/gms/app_services/.metadata deleted file mode 100644 index 2b37703..0000000 --- a/app_services/gms/app_services/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "7482962148e8d758338d8a28f589f317e1e42ba4" - channel: "stable" - -project_type: package diff --git a/app_services/gms/app_services/README.md b/app_services/gms/app_services/README.md deleted file mode 100644 index a03f3bd..0000000 --- a/app_services/gms/app_services/README.md +++ /dev/null @@ -1 +0,0 @@ -# Базовые сервисы для приложения \ No newline at end of file diff --git a/app_services/gms/app_services/analysis_options.yaml b/app_services/gms/app_services/analysis_options.yaml deleted file mode 100644 index 6e32909..0000000 --- a/app_services/gms/app_services/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -include: package:friflex_lint_rules/analysis_options.yaml \ No newline at end of file diff --git a/app_services/gms/app_services/lib/app_services.dart b/app_services/gms/app_services/lib/app_services.dart deleted file mode 100644 index 7b6c1ee..0000000 --- a/app_services/gms/app_services/lib/app_services.dart +++ /dev/null @@ -1,4 +0,0 @@ -library app_services; - -export 'src/app_path_provider.dart'; -export 'src/app_secure_storage.dart'; diff --git a/app_services/gms/app_services/lib/src/app_path_provider.dart b/app_services/gms/app_services/lib/src/app_path_provider.dart deleted file mode 100644 index 58b250a..0000000 --- a/app_services/gms/app_services/lib/src/app_path_provider.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:i_app_services/i_app_services.dart'; -import 'package:path_provider/path_provider.dart'; - -/// Класс для базовой реализации сервиса работы с путями -class AppPathProvider implements IPathProvider { - /// Наименование сервиса - static const name = 'GmsAppPathProvider'; - - @override - Future getAppDocumentsDirectoryPath() async { - return (await getApplicationDocumentsDirectory()).path; - } -} diff --git a/app_services/gms/app_services/lib/src/app_secure_storage.dart b/app_services/gms/app_services/lib/src/app_secure_storage.dart deleted file mode 100644 index 8b1d886..0000000 --- a/app_services/gms/app_services/lib/src/app_secure_storage.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:i_app_services/i_app_services.dart'; - -/// Класс для базовой реализации сервис по работе с защищенным хранилищем -final class AppSecureStorage implements ISecureStorage { - /// Создает сервис для работы с защищенным хранилищем - /// - /// Принимает: - /// - [secretKey] - ключ шифрования данных - AppSecureStorage({required this.secretKey}); - - @override - final String secretKey; - - static const name = 'GmsAppSecureStorage'; - - /// Экземпляр хранилища данных - final _box = const FlutterSecureStorage(); - - @override - Future clear() async { - await _box.deleteAll(); - } - - @override - Future delete(String key) async { - await _box.delete(key: key); - } - - @override - Future exists(String key) { - return _box.containsKey(key: key); - } - - @override - Future read(String key) async { - return _box.read(key: key); - } - - @override - Future write(String key, String value) async { - await _box.write(key: key, value: value); - } - - @override - String get nameImpl => AppSecureStorage.name; -} diff --git a/app_services/gms/app_services/pubspec.yaml b/app_services/gms/app_services/pubspec.yaml deleted file mode 100644 index 49f478d..0000000 --- a/app_services/gms/app_services/pubspec.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: app_services -description: "Google сервисы для приложения" -version: 0.0.1 -publish_to: none - -environment: - sdk: ^3.5.0 - flutter: ^3.24.0 - -dependencies: - flutter: - sdk: flutter - - # Зависимости для сервиса защищенного хранилища - flutter_secure_storage: 9.2.4 - - # Зависимости для сервиса незащищенного хранилища - shared_preferences: 2.3.5 - - # для работы с путями в хранилища - path_provider: 2.1.5 - - # Обязательные интерфейсы - i_app_services: - path: ../../i_app_services - -dev_dependencies: - friflex_lint_rules: - hosted: https://pub.friflex.com - version: 4.0.1 diff --git a/app_services/i_app_services/.gitignore b/app_services/i_app_services/.gitignore deleted file mode 100644 index ac5aa98..0000000 --- a/app_services/i_app_services/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -build/ diff --git a/app_services/i_app_services/README.md b/app_services/i_app_services/README.md deleted file mode 100644 index 3814655..0000000 --- a/app_services/i_app_services/README.md +++ /dev/null @@ -1 +0,0 @@ -# Хранит в себе все интерфейсы для реализации общих сервисов \ No newline at end of file diff --git a/app_services/i_app_services/analysis_options.yaml b/app_services/i_app_services/analysis_options.yaml deleted file mode 100644 index 45d8890..0000000 --- a/app_services/i_app_services/analysis_options.yaml +++ /dev/null @@ -1,10 +0,0 @@ -include: package:friflex_lint_rules/analysis_options.yaml - -analyzer: - exclude: - - "**/*.g.dart" - - "**/*.freezed.dart" - - "**/*.yaml" - - "app_services/aurora/**" - - "/app_services/aurora/**" - - "**/app_services/aurora/**" \ No newline at end of file diff --git a/app_services/i_app_services/lib/i_app_services.dart b/app_services/i_app_services/lib/i_app_services.dart deleted file mode 100644 index 887d570..0000000 --- a/app_services/i_app_services/lib/i_app_services.dart +++ /dev/null @@ -1,4 +0,0 @@ -library i_app_services; - -export 'src/i_path_provider.dart'; -export 'src/i_secure_storage.dart'; diff --git a/app_services/i_app_services/lib/src/i_path_provider.dart b/app_services/i_app_services/lib/src/i_path_provider.dart deleted file mode 100644 index c51123b..0000000 --- a/app_services/i_app_services/lib/src/i_path_provider.dart +++ /dev/null @@ -1,9 +0,0 @@ -/// Класс для описания интерфейса сервиса -/// для получения пути хранения файлов -abstract interface class IPathProvider { - /// Наименования интерфейса - static const name = 'IPathProvider'; - - /// Получение path на внутренне хранилище приложения - Future getAppDocumentsDirectoryPath(); -} diff --git a/app_services/i_app_services/lib/src/i_secure_storage.dart b/app_services/i_app_services/lib/src/i_secure_storage.dart deleted file mode 100644 index 92ce229..0000000 --- a/app_services/i_app_services/lib/src/i_secure_storage.dart +++ /dev/null @@ -1,46 +0,0 @@ -/// Класс интерфейса для работы с защищенным хранилищем -abstract interface class ISecureStorage { - /// Описывает обязательные параметры имплементаций - /// - /// Требует: - /// - [secretKey] - секретный ключ для шифрования данных - const ISecureStorage._({ - required this.secretKey, - }); - - /// Секретный ключ для шифрования данных - final String secretKey; - - /// Наименования интерфейса - static const name = 'ISecureStorage'; - - /// Метод для получения значения из защищенного хранилища - /// - /// Принимает: - /// - [key] - ключ - Future read(String key); - - /// Метод для записи значения в защищенное хранилище - /// - /// Принимает: - /// - [key] - ключ - /// - [value] - значение - Future write(String key, String value); - - /// Метод для удаления значения из защищенного хранилища - /// - /// Принимает: - /// - [key] - ключ - Future delete(String key); - - /// Метод для очистки защищенного хранилища - Future clear(); - - /// Метод для проверки наличия значения в защищенном хранилище - /// - /// Принимает: - /// - [key] - ключ - Future exists(String key); - - String get nameImpl; -} diff --git a/app_services/i_app_services/pubspec.yaml b/app_services/i_app_services/pubspec.yaml deleted file mode 100644 index 8ef39b2..0000000 --- a/app_services/i_app_services/pubspec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: i_app_services -description: "Хранит в себе все интерфейсы для реализации общих сервисов" -version: 0.0.1 -publish_to: "none" - -environment: - sdk: ^3.5.0 - flutter: ^3.24.0 - -dependencies: - flutter: - sdk: flutter - -dev_dependencies: - friflex_lint_rules: - hosted: https://pub.friflex.com - version: 4.0.1 diff --git a/l10n.yaml b/l10n.yaml deleted file mode 100644 index c6e3a25..0000000 --- a/l10n.yaml +++ /dev/null @@ -1,5 +0,0 @@ -arb-dir: lib/l10n -template-arb-file: app_en.arb -output-dir: lib/l10n/gen -output-localization-file: app_localizations.dart -synthetic-package: false \ No newline at end of file diff --git a/lib/app/app.dart b/lib/app/app.dart deleted file mode 100644 index 1effd46..0000000 --- a/lib/app/app.dart +++ /dev/null @@ -1,111 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:friflex_starter/app/app_context_ext.dart'; -import 'package:friflex_starter/app/app_providers.dart'; -import 'package:friflex_starter/app/depends_providers.dart'; -import 'package:friflex_starter/app/theme/app_theme.dart'; -import 'package:friflex_starter/app/theme/theme_notifier.dart'; -import 'package:friflex_starter/di/di_container.dart'; -import 'package:friflex_starter/features/error/error_screen.dart'; -import 'package:friflex_starter/features/splash/splash_screen.dart'; -import 'package:friflex_starter/l10n/gen/app_localizations.dart'; -import 'package:friflex_starter/l10n/localization_notifier.dart'; -import 'package:go_router/go_router.dart'; - -/// Класс приложения -class App extends StatefulWidget { - const App({ - super.key, - required this.router, - required this.initDependencies, - }); - /// Роутер приложения - final GoRouter router; - /// Функция для инициализации зависимостей - final Future Function() initDependencies; - - @override - State createState() => _AppState(); -} - -class _AppState extends State { - /// Мутабельная Future для инициализации зависимостей - late Future _initFuture; - - @override - void initState() { - super.initState(); - _initFuture = widget.initDependencies(); - } - - @override - Widget build(BuildContext context) { - return AppProviders( - // Consumer для локализации добавляем выше чем DependsProviders - // чтобы при изменении локализации перестраивался весь виджет - // Но, это не обязательно, можно добавить в DependsProviders - child: LocalizationConsumer( - builder: () => FutureBuilder( - future: _initFuture, - builder: (_, snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.none: - case ConnectionState.waiting: - case ConnectionState.active: - // Пока инициализация показываем Splash - return const SplashScreen(); - case ConnectionState.done: - if (snapshot.hasError) { - return ErrorScreen( - error: snapshot.error, - stackTrace: snapshot.stackTrace, - onRetry: _retryInit, - ); - } - - final diContainer = snapshot.data; - if (diContainer == null) { - return ErrorScreen( - error: - 'Ошибка инициализации зависимостей, diContainer = null', - stackTrace: null, - onRetry: _retryInit, - ); - } - return DependsProviders( - diContainer: diContainer, - child: ThemeConsumer( - builder: () => _App(router: widget.router), - ), - ); - } - }, - ), - ), - ); - } - - void _retryInit() { - setState(() { - _initFuture = widget.initDependencies(); - }); - } -} - -class _App extends StatelessWidget { - const _App({required this.router}); - - final GoRouter router; - - @override - Widget build(BuildContext context) { - return MaterialApp.router( - routerConfig: router, - darkTheme: AppTheme.dark, - theme: AppTheme.light, - themeMode: context.theme.themeMode, - locale: context.localization.locale, - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - ); - } -} diff --git a/lib/app/app_config/app_config.dart b/lib/app/app_config/app_config.dart deleted file mode 100644 index 201e316..0000000 --- a/lib/app/app_config/app_config.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:envied/envied.dart'; -import 'package:friflex_starter/app/app_config/i_app_config.dart'; -import 'package:friflex_starter/app/app_env.dart'; - -part 'app_config.g.dart'; - -/// Класс для реализации конфигурации с моковыми данными -@Envied(name: 'Dev', path: 'env/dev.env') -class AppConfigDev implements IAppConfig { - @override - AppEnv get env => AppEnv.dev; - - @override - String get name => 'AppConfigDev'; - - @override - @EnviedField() - final String baseUrl = _Dev.baseUrl; - - @override - @EnviedField(obfuscate: true) - final String secretKey = _Dev.secretKey; -} - -/// Класс для реализации конфигурации с продакшн данными -@Envied(name: 'Prod', path: 'env/prod.env') -class AppConfigProd implements IAppConfig { - @override - AppEnv get env => AppEnv.prod; - - @override - String get name => 'AppConfigProd'; - - @override - @EnviedField(obfuscate: true) - final String baseUrl = _Prod.baseUrl; - - @override - @EnviedField(obfuscate: true) - final String secretKey = _Prod.secretKey; -} - -/// Класс для реализации конфигурации с стейдж данными -@Envied(name: 'Stage', path: 'env/stage.env') -class AppConfigStage implements IAppConfig { - @override - AppEnv get env => AppEnv.stage; - - @override - String get name => 'AppConfigStage'; - - @override - @EnviedField(obfuscate: true) - final String baseUrl = _Stage.baseUrl; - - @override - @EnviedField(obfuscate: true) - final String secretKey = _Stage.secretKey; -} diff --git a/lib/app/app_config/app_config.g.dart b/lib/app/app_config/app_config.g.dart deleted file mode 100644 index ca2c5fa..0000000 --- a/lib/app/app_config/app_config.g.dart +++ /dev/null @@ -1,158 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'app_config.dart'; - -// ************************************************************************** -// EnviedGenerator -// ************************************************************************** - -// coverage:ignore-file -// ignore_for_file: type=lint -// generated_from: env/dev.env -final class _Dev { - static const String baseUrl = 'https://dev'; - - static const List _enviedkeysecretKey = [ - 45820206, - 4292305074, - 1553598735, - ]; - - static const List _envieddatasecretKey = [ - 45820234, - 4292305111, - 1553598841, - ]; - - static final String secretKey = String.fromCharCodes(List.generate( - _envieddatasecretKey.length, - (int i) => i, - growable: false, - ).map((int i) => _envieddatasecretKey[i] ^ _enviedkeysecretKey[i])); -} - -// coverage:ignore-file -// ignore_for_file: type=lint -// generated_from: env/prod.env -final class _Prod { - static const List _enviedkeybaseUrl = [ - 3619294633, - 560029786, - 3178585068, - 3377720392, - 977735066, - 2142081055, - 1298585806, - 933917938, - 1244996901, - 1950368931, - 2147265964, - 2338251746, - ]; - - static const List _envieddatabaseUrl = [ - 3619294657, - 560029742, - 3178584984, - 3377720376, - 977735145, - 2142081061, - 1298585825, - 933917917, - 1244996949, - 1950368977, - 2147265987, - 2338251654, - ]; - - static final String baseUrl = String.fromCharCodes(List.generate( - _envieddatabaseUrl.length, - (int i) => i, - growable: false, - ).map((int i) => _envieddatabaseUrl[i] ^ _enviedkeybaseUrl[i])); - - static const List _enviedkeysecretKey = [ - 2449171331, - 2315988352, - 1037757119, - 3159274193, - ]; - - static const List _envieddatasecretKey = [ - 2449171443, - 2315988466, - 1037757136, - 3159274165, - ]; - - static final String secretKey = String.fromCharCodes(List.generate( - _envieddatasecretKey.length, - (int i) => i, - growable: false, - ).map((int i) => _envieddatasecretKey[i] ^ _enviedkeysecretKey[i])); -} - -// coverage:ignore-file -// ignore_for_file: type=lint -// generated_from: env/stage.env -final class _Stage { - static const List _enviedkeybaseUrl = [ - 443716089, - 3928907238, - 1851881210, - 3858110087, - 3324475128, - 1601592105, - 2404110281, - 1092690431, - 1025677374, - 3283672546, - 425122182, - 3412521909, - 1297182020, - ]; - - static const List _envieddatabaseUrl = [ - 443715985, - 3928907154, - 1851881102, - 3858110199, - 3324475019, - 1601592083, - 2404110310, - 1092690384, - 1025677389, - 3283672470, - 425122279, - 3412521938, - 1297181985, - ]; - - static final String baseUrl = String.fromCharCodes(List.generate( - _envieddatabaseUrl.length, - (int i) => i, - growable: false, - ).map((int i) => _envieddatabaseUrl[i] ^ _enviedkeybaseUrl[i])); - - static const List _enviedkeysecretKey = [ - 58874248, - 3497500657, - 3833421599, - 555777488, - 132619188, - ]; - - static const List _envieddatasecretKey = [ - 58874363, - 3497500549, - 3833421694, - 555777463, - 132619217, - ]; - - static final String secretKey = String.fromCharCodes(List.generate( - _envieddatasecretKey.length, - (int i) => i, - growable: false, - ).map((int i) => _envieddatasecretKey[i] ^ _enviedkeysecretKey[i])); -} diff --git a/lib/app/app_config/i_app_config.dart b/lib/app/app_config/i_app_config.dart deleted file mode 100644 index 884b5fb..0000000 --- a/lib/app/app_config/i_app_config.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:friflex_starter/app/app_env.dart'; - -/// Класс для описания интерфейса конфигурации -abstract interface class IAppConfig { - /// Наименование сервиса - String get name => 'IAppConfig'; - - /// Основной адрес для запросов к API - String get baseUrl; - - /// Тип окружения - AppEnv get env; - - /// Секретный ключ для шифрования данных - String get secretKey; -} diff --git a/lib/app/app_context_ext.dart b/lib/app/app_context_ext.dart deleted file mode 100644 index 7dd0f43..0000000 --- a/lib/app/app_context_ext.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:friflex_starter/app/theme/theme_notifier.dart'; -import 'package:friflex_starter/di/di_container.dart'; -import 'package:friflex_starter/l10n/gen/app_localizations.dart'; -import 'package:friflex_starter/l10n/localization_notifier.dart'; -import 'package:provider/provider.dart'; - -/// Класс, реализующий расширение для контекста приложения -extension AppContextExt on BuildContext { - /// Метод для получения экземпляра DIContainer - DiContainer get di => read(); - - /// Геттер для получения цветовой схемы - ColorScheme get colors => Theme.of(this).colorScheme; - - /// Геттер для получения темы - ThemeNotifier get theme => read(); - - /// Геттер для получения локализации - AppLocalizations get l10n => AppLocalizations.of(this)!; - - /// Геттер для получения управления локализацией - LocalizationNotifier get localization => read(); -} diff --git a/lib/app/app_env.dart b/lib/app/app_env.dart deleted file mode 100644 index e1620bd..0000000 --- a/lib/app/app_env.dart +++ /dev/null @@ -1,12 +0,0 @@ -/// Перечислимый тип окружений сборки -enum AppEnv { - /// Тестовое окружение (моковое) - dev, - - /// Стейдж окружение (тестовое окружение, которое имеет возможность - /// как обращаться в сеть, так и использовать моковые данные) - stage, - - /// Продакшен окружение - prod, -} diff --git a/lib/app/app_providers.dart b/lib/app/app_providers.dart deleted file mode 100644 index 41496ff..0000000 --- a/lib/app/app_providers.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:friflex_starter/app/theme/theme_notifier.dart'; -import 'package:friflex_starter/l10n/localization_notifier.dart'; -import 'package:provider/provider.dart'; - -/// Класс для добавления провайдеров темы и локализации -final class AppProviders extends StatelessWidget { - const AppProviders({ - super.key, - required this.child, - }); - - final Widget child; - - @override - Widget build(BuildContext context) { - return MultiProvider( - providers: [ - ChangeNotifierProvider( - create: (_) => ThemeNotifier(), - ), // Провайдер для темы - ChangeNotifierProvider( - create: (_) => LocalizationNotifier(), - ), // Провайдер для локализации - ], - child: child, - ); - } -} diff --git a/lib/app/depends_providers.dart b/lib/app/depends_providers.dart deleted file mode 100644 index a05e512..0000000 --- a/lib/app/depends_providers.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:friflex_starter/di/di_container.dart'; -import 'package:provider/provider.dart'; - -/// Класс для внедрения глобальных зависимостей -final class DependsProviders extends StatelessWidget { - const DependsProviders({ - super.key, - required this.child, - required this.diContainer, - }); - - final Widget child; - final DiContainer diContainer; - - @override - Widget build(BuildContext context) { - return MultiProvider( - providers: [ - // Сюда добавляем глобальные блоки, inherited и т.д. - Provider.value(value: diContainer), // Передаем контейнер зависимостей - ], - child: child, - ); - } -} diff --git a/lib/app/http/app_http_client.dart b/lib/app/http/app_http_client.dart deleted file mode 100644 index c50cc22..0000000 --- a/lib/app/http/app_http_client.dart +++ /dev/null @@ -1,138 +0,0 @@ -import 'package:dio/dio.dart'; -import 'package:friflex_starter/app/app_config/i_app_config.dart'; -import 'package:friflex_starter/app/http/i_http_client.dart'; -import 'package:friflex_starter/features/debug/i_debug_service.dart'; - -/// Класс для реализации HTTP-клиента для управления запросами -final class AppHttpClient implements IHttpClient { - /// Создает HTTP клиент - /// - /// Принимает: - /// - [debugService] - сервис для логирования запросов - /// - [appConfig] - конфигурация приложения - AppHttpClient({ - required IDebugService debugService, - required IAppConfig appConfig, - }) { - _httpClient = Dio(); - _appConfig = appConfig; - - _httpClient.options - ..baseUrl = appConfig.baseUrl - ..connectTimeout = const Duration(seconds: 5) - ..sendTimeout = const Duration(seconds: 7) - ..receiveTimeout = const Duration(seconds: 10) - ..headers = { - 'Content-Type': 'application/json', - }; - debugService.log('HTTP client created'); - } - - /// Конфигурация приложения - late final IAppConfig _appConfig; - - /// Экземпляр HTTP клиента - late final Dio _httpClient; - - @override - Future get( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }) async { - _httpClient.options.baseUrl = _appConfig.baseUrl; - - return _httpClient.get( - path, - data: data, - queryParameters: queryParameters, - options: options, - ); - } - - @override - Future post( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }) async { - _httpClient.options.baseUrl = _appConfig.baseUrl; - - return _httpClient.post( - path, - data: data, - queryParameters: queryParameters, - options: options, - ); - } - - @override - Future patch( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }) async { - _httpClient.options.baseUrl = _appConfig.baseUrl; - - return _httpClient.patch( - path, - data: data, - queryParameters: queryParameters, - options: options, - ); - } - - @override - Future put( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }) async { - _httpClient.options.baseUrl = _appConfig.baseUrl; - - return _httpClient.put( - path, - data: data, - queryParameters: queryParameters, - options: options, - ); - } - - @override - Future delete( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }) async { - _httpClient.options.baseUrl = _appConfig.baseUrl; - - return _httpClient.delete( - path, - data: data, - queryParameters: queryParameters, - options: options, - ); - } - - @override - Future head( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }) async { - _httpClient.options.baseUrl = _appConfig.baseUrl; - - return _httpClient.head( - path, - data: data, - queryParameters: queryParameters, - options: options, - ); - } -} diff --git a/lib/app/http/i_http_client.dart b/lib/app/http/i_http_client.dart deleted file mode 100644 index 34d8315..0000000 --- a/lib/app/http/i_http_client.dart +++ /dev/null @@ -1,94 +0,0 @@ -import 'package:dio/dio.dart'; - -/// Класс для описания интерфейса сервиса по управлению HTTP запросами -abstract interface class IHttpClient { - /// Описывает поля HTTP клиента - const IHttpClient(); - - /// Наименование сервиса - static const name = 'IHttpClient'; - - /// Метод для реализации запроса GET - /// - /// Принимает: - /// - [path] - путь к ресурсу - /// - [data] - тело запроса - /// - [queryParameters] - параметры запроса - /// - [options] - конфигурация запроса - Future get( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }); - - /// Метод для реализации запроса POST - /// - /// Принимает: - /// - [path] - путь к ресурсу - /// - [data] - тело запроса - /// - [queryParameters] - параметры запроса - /// - [options] - конфигурация запроса - Future post( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }); - - /// Метод для реализации запроса PATCH - /// - /// Принимает: - /// - [path] - путь к ресурсу - /// - [data] - тело запроса - /// - [queryParameters] - параметры запроса - /// - [options] - конфигурация запроса - Future patch( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }); - - /// Метод для реализации запроса PUT - /// - /// Принимает: - /// - [path] - путь к ресурсу - /// - [data] - тело запроса - /// - [queryParameters] - параметры запроса - /// - [options] - конфигурация запроса - Future put( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }); - - /// Метод для реализации запроса DELETE - /// - /// Принимает: - /// - [path] - путь к ресурсу - /// - [data] - тело запроса - /// - [queryParameters] - параметры запроса - /// - [options] - конфигурация запроса - Future delete( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }); - - /// Метод для реализации запроса POST - /// - /// Принимает: - /// - [path] - путь к ресурсу - /// - [data] - тело запроса - /// - [queryParameters] - параметры запроса - /// - [options] - конфигурация запроса - Future head( - String path, { - Object? data, - Map? queryParameters, - Options? options, - }); -} diff --git a/lib/app/theme/app_colors_scheme.dart b/lib/app/theme/app_colors_scheme.dart deleted file mode 100644 index 4c0f093..0000000 --- a/lib/app/theme/app_colors_scheme.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Класс, реализующий расширение для добавления токенов в цветовую схему -extension AppColorsScheme on ColorScheme { - bool get _isDark => brightness == Brightness.dark; - - // Тестовый цвет - Color get testColor => _isDark ? Colors.green : Colors.red; -} diff --git a/lib/app/theme/app_theme.dart b/lib/app/theme/app_theme.dart deleted file mode 100644 index 4a88777..0000000 --- a/lib/app/theme/app_theme.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Класс для конфигурации светлой/темной темы приложения -abstract class AppTheme { - /// Геттер для получения светлой темы - static ThemeData get light => ThemeData.light(); - - /// Геттер для получения темной темы - static ThemeData get dark => ThemeData.dark(); -} diff --git a/lib/app/theme/theme_notifier.dart b/lib/app/theme/theme_notifier.dart deleted file mode 100644 index a53ab66..0000000 --- a/lib/app/theme/theme_notifier.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -typedef ThemeBuilder = Widget Function(); - -/// Виджет для подписки на изменение темы приложения -class ThemeConsumer extends StatelessWidget { - const ThemeConsumer({super.key, required this.builder}); - - final ThemeBuilder builder; - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (_, __, ___) { - return builder(); - }, - ); - } -} - -/// Класс для управления темой приложения -final class ThemeNotifier extends ChangeNotifier { - ThemeMode _themeMode = ThemeMode.system; - - ThemeMode get themeMode => _themeMode; - - void changeTheme() { - _themeMode = - _themeMode == ThemeMode.light ? ThemeMode.dark : ThemeMode.light; - notifyListeners(); - } -} diff --git a/lib/di/di_base_repo.dart b/lib/di/di_base_repo.dart deleted file mode 100644 index f7f100f..0000000 --- a/lib/di/di_base_repo.dart +++ /dev/null @@ -1,6 +0,0 @@ -/// Миксин репозитория в приложении. -/// Каждый интерфейс репозитория в приложении должен подмешивать текущий класс -mixin class DiBaseRepo { - /// Наименование репозитория - String get name => 'DiBaseRepo'; -} diff --git a/lib/di/di_container.dart b/lib/di/di_container.dart deleted file mode 100644 index 96d3eda..0000000 --- a/lib/di/di_container.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:friflex_starter/app/app_config/app_config.dart'; -import 'package:friflex_starter/app/app_config/i_app_config.dart'; -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/app/http/app_http_client.dart'; -import 'package:friflex_starter/app/http/i_http_client.dart'; -import 'package:friflex_starter/di/di_repositories.dart'; -import 'package:friflex_starter/di/di_services.dart'; -import 'package:friflex_starter/di/di_typedefs.dart'; -import 'package:friflex_starter/features/debug/i_debug_service.dart'; - -/// {@template dependencies_container} -/// Контейнер для зависимостей -/// {@macro composition_process} -/// {@endtemplate} -final class DiContainer { - /// {@macro dependencies_container} - DiContainer({required this.env, required IDebugService dService}) - : debugService = dService; - final AppEnv env; - - /// Сервис для отладки, получаем из конструктора - late final IDebugService debugService; - - /// Конфигурация приложения - late final IAppConfig appConfig; - - /// Сервис для работы с HTTP запросами - late final IHttpClient Function(IDebugService, IAppConfig) httpClientFactory; - - /// Репозитории приложения - late final DiRepositories repositories; - - /// Сервисы приложения - late final DiServices services; - - /// Метод для инициализации зависимостей - Future init({ - required OnProgress onProgress, - required OnComplete onComplete, - required OnError onError, - }) async { - // Инициализация конфигурации приложения - appConfig = switch (env) { - AppEnv.dev => AppConfigDev(), - AppEnv.prod => AppConfigProd(), - AppEnv.stage => AppConfigStage() - }; - - // Инициализация HTTP клиента - httpClientFactory = (debugService, appConfig) => AppHttpClient( - debugService: debugService, - appConfig: appConfig, - ); - - // Инициализация сервисов - services = DiServices() - ..init( - onProgress: onProgress, - onError: onError, - diContainer: this, - ); - // throw Exception('Тестовая - ошибка инициализации зависимостей'); - // Инициализация репозиториев - repositories = DiRepositories() - ..init( - onProgress: onProgress, - onError: onError, - diContainer: this, - ); - - onComplete('Инициализация зависимостей завершена!'); - } -} diff --git a/lib/di/di_repositories.dart b/lib/di/di_repositories.dart deleted file mode 100644 index dc10bc3..0000000 --- a/lib/di/di_repositories.dart +++ /dev/null @@ -1,178 +0,0 @@ -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/di/di_base_repo.dart'; -import 'package:friflex_starter/di/di_container.dart'; -import 'package:friflex_starter/di/di_typedefs.dart'; -import 'package:friflex_starter/features/auth/data/repository/auth_mock_repository.dart'; -import 'package:friflex_starter/features/auth/data/repository/auth_repository.dart'; -import 'package:friflex_starter/features/auth/domain/repository/i_auth_repository.dart'; -import 'package:friflex_starter/features/main/data/repository/main_mock_repository.dart'; -import 'package:friflex_starter/features/main/data/repository/main_repository.dart'; -import 'package:friflex_starter/features/main/domain/repository/i_main_repository.dart'; -import 'package:friflex_starter/features/profile/data/repository/profile_mock_repository.dart'; -import 'package:friflex_starter/features/profile/data/repository/profile_repository.dart'; -import 'package:friflex_starter/features/profile/domain/repository/i_profile_repository.dart'; -import 'package:friflex_starter/features/profile_scope/data/repository/profile_scope_mock_repository.dart'; -import 'package:friflex_starter/features/profile_scope/data/repository/profile_scope_repository.dart'; -import 'package:friflex_starter/features/profile_scope/domain/repository/i_profile_scope_repository.dart'; - -/// Список названий моковых репозиториев, которые должны быть подменены -/// для использования в сборке stage окружения -/// -/// Для того, чтобы репозиторий был автоматически подменен на моковый в stage -/// сборке, необходимо в этом списке указать название мокового репозитория, -/// обращаясь к соответствующему полю name. -/// -/// Пример: -/// ``` -/// [ AuthCheckRepositoryMock().name, ] -/// ``` -final List _mockReposToSwitch = []; - -/// Класс для инициализации репозиториев в приложении -/// -/// По умолчанию репозиторию присваивается моковая реализация. -/// В зависимости от окружения либо выполняется подмена репозиторий, -/// либо используется моковый. -final class DiRepositories { - /// Интерфейс для работы с репозиторием авторизации - late final IAuthRepository authRepository; - - /// Интерфейс для работы с репозиторием главного сервиса - late final IMainRepository mainRepository; - - /// Интерфейс для работы с репозиторием профиля - late final IProfileRepository profileRepository; - - /// Интерфейс для работы с репозиторием профиля scope - late final IProfileScopeRepository profileScopeRepository; - - /// Метод для инициализации репозиториев в приложении - /// - /// Принимает: - /// - [onProgress] - обратный вызов при прогрессе - /// - [diContainer] - контейнер зависимостей - void init({ - required OnProgress onProgress, - required OnError onError, - required DiContainer diContainer, - }) { - try { - //Инициализация репозитория авторизации - authRepository = _lazyInitRepo( - mockFactory: AuthMockRepository.new, - mainFactory: () => AuthRepository( - httpClient: diContainer.httpClientFactory( - diContainer.debugService, - diContainer.appConfig, - ), - ), - onProgress: onProgress, - environment: diContainer.env, - ); - onProgress(authRepository.name); - } on Object catch (error, stackTrace) { - onError( - 'Ошибка инициализации репозитория IAuthRepository', - error, - stackTrace, - ); - } - - try { - // Инициализация репозитория сервиса управления токеном доступа - mainRepository = _lazyInitRepo( - mockFactory: MainMockRepository.new, - mainFactory: () => MainRepository( - httpClient: diContainer.httpClientFactory( - diContainer.debugService, - diContainer.appConfig, - ), - ), - onProgress: onProgress, - environment: diContainer.env, - ); - onProgress(mainRepository.name); - } on Object catch (error, stackTrace) { - onError( - 'Ошибка инициализации репозитория IMainRepository', - error, - stackTrace, - ); - } - - try { - // Инициализация репозитория профиля - profileRepository = _lazyInitRepo( - mockFactory: ProfileMockRepository.new, - mainFactory: () => ProfileRepository( - httpClient: diContainer.httpClientFactory( - diContainer.debugService, - diContainer.appConfig, - ), - ), - onProgress: onProgress, - environment: diContainer.env, - ); - onProgress(profileRepository.name); - } on Object catch (error, stackTrace) { - onError( - 'Ошибка инициализации репозитория IProfileRepository', - error, - stackTrace, - ); - } - - try { - // Инициализация репозитория профиля scope - profileScopeRepository = _lazyInitRepo( - mockFactory: ProfileScopeMockRepository.new, - mainFactory: () => ProfileScopeRepository( - httpClient: diContainer.httpClientFactory( - diContainer.debugService, - diContainer.appConfig, - ), - ), - onProgress: onProgress, - environment: diContainer.env, - ); - onProgress(mainRepository.name); - } on Object catch (error, stackTrace) { - onError( - 'Ошибка инициализации репозитория IProfileScopeRepository', - error, - stackTrace, - ); - } - - onProgress( - 'Инициализация репозиториев завершена! Было подменено репозиториев - ${_mockReposToSwitch.length} (${_mockReposToSwitch.join(', ')})', - ); - } - - /// Метод для ленивой инициализации конкретного репозитория по типу [Т]. - /// В зависимости от окружения инициализируется моковый или сетевой репозиторий. - /// - /// Принимает: - /// - [mockFactory] - функция - фабрика для инициализации репозитория для управления моковыми запросами - /// - [mainFactory] - функция - фабрика для инициализации основного репозиторий - /// - [onProgress] - обратный вызов при прогрессе - T _lazyInitRepo({ - required AppEnv environment, - required T Function() mainFactory, - required T Function() mockFactory, - required OnProgress onProgress, - }) { - final mockRepo = mockFactory(); - final mainRepo = mainFactory(); - - final repo = switch (environment) { - AppEnv.dev => mockRepo, - AppEnv.prod => mainRepo, - AppEnv.stage => - _mockReposToSwitch.contains(mockRepo.name) ? mockRepo : mainRepo, - }; - - onProgress(repo.name); - return repo; - } -} diff --git a/lib/di/di_services.dart b/lib/di/di_services.dart deleted file mode 100644 index 4cd358a..0000000 --- a/lib/di/di_services.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'package:app_services/app_services.dart'; -import 'package:friflex_starter/di/di_container.dart'; -import 'package:friflex_starter/di/di_typedefs.dart'; -import 'package:i_app_services/i_app_services.dart'; - -/// Класс для инициализации сервисов -final class DiServices { - /// Сервис для работы с путями - late final IPathProvider pathProvider; - - /// Сервис для работы с локальным хранилищем - late final ISecureStorage secureStorage; - - /// Метод для инициализации репозиториев в приложении - /// - /// Принимает: - /// - [onProgress] - обратный вызов при прогрессе - /// - [diContainer] - контейнер зависимостей - /// - [onError] - обратный вызов при ошибке - void init({ - required OnProgress onProgress, - required OnError onError, - required DiContainer diContainer, - }) { - try { - pathProvider = AppPathProvider(); - onProgress(AppPathProvider.name); - } on Object catch (error, stackTrace) { - onError( - 'Ошибка инициализации ${IPathProvider.name}', - error, - stackTrace, - ); - } - try { - secureStorage = AppSecureStorage( - secretKey: diContainer.appConfig.secretKey, - ); - onProgress(AppSecureStorage.name); - } on Object catch (error, stackTrace) { - onError( - 'Ошибка инициализации ${ISecureStorage.name}', - error, - stackTrace, - ); - } - - onProgress('Инициализация сервисов завершена!'); - } -} diff --git a/lib/di/di_typedefs.dart b/lib/di/di_typedefs.dart deleted file mode 100644 index 8cf3a9b..0000000 --- a/lib/di/di_typedefs.dart +++ /dev/null @@ -1,12 +0,0 @@ -/// Обратный вызов при ошибки инициализации -typedef OnError = void Function( - String message, - Object error, [ - StackTrace? stackTrace, -]); - -/// Обратный вызов при прогрессе -typedef OnProgress = void Function(String name); - -/// Обратный вызов при успешной инициализации -typedef OnComplete = void Function(String msg); diff --git a/lib/features/auth/data/repository/auth_mock_repository.dart b/lib/features/auth/data/repository/auth_mock_repository.dart deleted file mode 100644 index de31710..0000000 --- a/lib/features/auth/data/repository/auth_mock_repository.dart +++ /dev/null @@ -1,9 +0,0 @@ -import '../../domain/repository/i_auth_repository.dart'; - -/// {@template AuthMockRepository} -/// -/// {@endtemplate} -final class AuthMockRepository implements IAuthRepository { - @override - String get name => 'AuthMockRepository'; -} diff --git a/lib/features/auth/data/repository/auth_repository.dart b/lib/features/auth/data/repository/auth_repository.dart deleted file mode 100644 index 947f091..0000000 --- a/lib/features/auth/data/repository/auth_repository.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:friflex_starter/app/http/i_http_client.dart'; - -import '../../domain/repository/i_auth_repository.dart'; - -/// {@template AuthRepository} -/// -/// {@endtemplate} -final class AuthRepository implements IAuthRepository { - final IHttpClient httpClient; - - AuthRepository({required this.httpClient}); - - @override - String get name => 'AuthRepository'; -} diff --git a/lib/features/auth/domain/repository/i_auth_repository.dart b/lib/features/auth/domain/repository/i_auth_repository.dart deleted file mode 100644 index d9c3f01..0000000 --- a/lib/features/auth/domain/repository/i_auth_repository.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'package:friflex_starter/di/di_base_repo.dart'; - -/// {@template IAuthRepository} -/// -/// {@endtemplate} -abstract interface class IAuthRepository with DiBaseRepo {} diff --git a/lib/features/auth/presentation/screens/auth_screen.dart b/lib/features/auth/presentation/screens/auth_screen.dart deleted file mode 100644 index 813e7b3..0000000 --- a/lib/features/auth/presentation/screens/auth_screen.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:flutter/material.dart'; - -/// {@template AuthScreen} -/// -/// {@endtemplate} -class AuthScreen extends StatelessWidget { - /// {@macro AuthScreen} - const AuthScreen({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('AuthScreen'), - ), - body: const Center( - child: Text('AuthScreen'), - ), - ); - } -} diff --git a/lib/features/debug/debug_routes.dart b/lib/features/debug/debug_routes.dart deleted file mode 100644 index a82d94c..0000000 --- a/lib/features/debug/debug_routes.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/widgets.dart'; -import 'package:friflex_starter/features/debug/debug_screen.dart'; -import 'package:go_router/go_router.dart'; - -abstract final class DebugRoutes { - /// Название роута страницы профиля пользователя - static const String debugScreenName = 'debug_screen'; - - /// Путь роута страницы профиля пользователя - static const String _debugScreenPath = '/debug'; - - /// Метод для построения ветки роутов по фиче профиля пользователя - /// - /// Принимает: - /// - [routes] - вложенные роуты - static StatefulShellBranch buildShellBranch({ - List routes = const [], - List? observers, - }) => - StatefulShellBranch( - initialLocation: _debugScreenPath, - observers: observers, - routes: [ - GoRoute( - path: _debugScreenPath, - name: debugScreenName, - builder: (context, state) => const DebugScreen(), - routes: routes, - ), - ], - ); -} diff --git a/lib/features/debug/debug_screen.dart b/lib/features/debug/debug_screen.dart deleted file mode 100644 index db04981..0000000 --- a/lib/features/debug/debug_screen.dart +++ /dev/null @@ -1,118 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:friflex_starter/app/app_context_ext.dart'; -import 'package:friflex_starter/app/theme/app_colors_scheme.dart'; -import 'package:friflex_starter/gen/assets.gen.dart'; -import 'package:friflex_starter/gen/fonts.gen.dart'; - -class DebugScreen extends StatelessWidget { - const DebugScreen({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text('Debug Screen')), - body: Center( - child: ListView( - padding: const EdgeInsets.all(16), - children: [ - Text( - 'Реализация SecureStorage: ${context.di.services.secureStorage.nameImpl}', - ), - const SizedBox(height: 16), - Text( - 'Окружение: ${context.di.appConfig.env.name}', - ), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () { - context.theme.changeTheme(); - }, - child: const Text('Сменить тему'), - ), - const SizedBox(height: 16), - ColoredBox( - color: context.colors.testColor, - child: const SizedBox(height: 100, width: 100), - ), - const SizedBox(height: 16), - Text( - 'Текущая тема: ${context.theme.themeMode}', - ), - const SizedBox(height: 16), - Text( - 'Текущий репозиторий: ${context.di.repositories.authRepository.name}', - ), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () { - context.localization.changeLocal( - const Locale('ru', 'RU'), - ); - }, - child: const Text('Сменить язык на Rусский'), - ), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () { - context.localization.changeLocal( - const Locale('en', 'EN'), - ); - }, - child: const Text('Сменить язык на Английский'), - ), - const SizedBox(height: 16), - Text( - 'Тестовое слово montserrat bold: ${context.l10n.helloWorld}', - style: TextStyle( - color: context.colors.testColor, - fontFamily: Assets.fonts.montserratBold, - ), - ), - const SizedBox(height: 16), - Text( - 'Тестовое слово montserrat medium: ${context.l10n.helloWorld}', - style: TextStyle( - color: context.colors.testColor, - fontFamily: FontFamily.montserrat, - ), - ), - const SizedBox(height: 16), - Text( - 'Текущий язык: ${context.l10n.localeName}', - ), - const SizedBox(height: 16), - const Text('Тестовая иконка из assets'), - const SizedBox(height: 16), - Assets.icons.home.svg(), - ElevatedButton( - onPressed: () { - throw Exception( - 'Тестовая ошибка Exception для отладки FlutterError', - ); - }, - child: const Text('Вызывать ошибку FlutterError'), - ), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () async { - await _callError(); - }, - child: const Text('Вызывать ошибку PlatformDispatcher'), - ), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () async { - await context.di.debugService.openDebugScreen(context); - }, - child: const Text('Вызывать Экран отладки'), - ), - ], - ), - ), - ); - } - - Future _callError() async { - throw Exception('Тестовая ошибка Exception для отладки PlatformDispatcher'); - } -} diff --git a/lib/features/debug/debug_service.dart b/lib/features/debug/debug_service.dart deleted file mode 100644 index 3d0012f..0000000 --- a/lib/features/debug/debug_service.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:friflex_starter/features/debug/i_debug_service.dart'; - -/// Класс реализации интерфейса Debug сервиса -class DebugService implements IDebugService { - /// Наименование сервиса - static const name = 'DebugService'; - - @override - void logDebug(Object message, {Object? logLevel, Map? args}) { - if (kDebugMode) { - print('Message: $message'); - } - - /// Реализация логики - } - - @override - void logError( - Object message, { - Object? error, - Object? logLevel, - Map? args, - StackTrace? stackTrace, - }) { - final logMessage = message is Function ? Function.apply(message, []) as Object : message; - if (kDebugMode) { - print('Message: $logMessage'); - print('Error: $error'); - print('StackTrace: $stackTrace'); - } - - /// Реализация логики - } - - @override - void log(Object message, {Object? logLevel, Map? args}) { - final logMessage = message is Function ? Function.apply(message, []) as Object : message; - if (kDebugMode) { - print('Message: $logMessage'); - } - - /// Реализация логики - } - - @override - void logWarning(Object message, {Object? logLevel, Map? args}) { - final logMessage = message is Function ? Function.apply(message, []) as Object : message; - if (kDebugMode) { - print('Message: $logMessage'); - } - - /// Реализация логики - } - - @override - Future openDebugScreen(BuildContext context, {bool useRootNavigator = false}) { - if (kDebugMode) { - print('Переход на страницу отладки'); - } - - /// Реализация логики - return Future.value(); - } -} diff --git a/lib/features/debug/i_debug_service.dart b/lib/features/debug/i_debug_service.dart deleted file mode 100644 index 839b850..0000000 --- a/lib/features/debug/i_debug_service.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:flutter/material.dart'; - -/// Интерфейс для сервиса отладки -abstract interface class IDebugService { - static const name = 'IDebugService'; - - /// Метод для логирования сообщений - void log( - Object message, { - Object logLevel, - Map? args, - }); - - /// Метод для логирования предупреждений - void logWarning( - Object message, { - Object logLevel, - Map? args, - }); - - /// Метод для логирования ошибок - void logError( - Object message, { - Object error, - StackTrace? stackTrace, - Object logLevel, - Map? args, - }); - - /// Метод для обработки ошибок - void logDebug( - Object message, { - Object logLevel, - Map? args, - }); - - /// Метод для открытия окна отладки - /// - /// Принимает: - /// - [context] - для определения навигатора по нему - /// - [useRootNavigator] - при true, открывает окно в корневом навигаторе - Future openDebugScreen( - BuildContext context, { - bool useRootNavigator = false, - }); -} diff --git a/lib/features/error/error_screen.dart b/lib/features/error/error_screen.dart deleted file mode 100644 index db157ba..0000000 --- a/lib/features/error/error_screen.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:flutter/material.dart'; - -/// {@template ErrorScreen} -/// Экран, когда в приложении произошла фатальная ошибка -/// {@endtemplate} -class ErrorScreen extends StatelessWidget { - /// {@macro ErrorScreen} - const ErrorScreen({ - super.key, - required this.error, - required this.stackTrace, - this.onRetry, - }); - - final Object? error; - final StackTrace? stackTrace; - final VoidCallback? onRetry; - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - body: SafeArea( - child: Center( - child: ListView( - padding: const EdgeInsets.all(16), - children: [ - const SizedBox(height: 16), - ElevatedButton( - onPressed: onRetry, - child: const Text('Перезагрузить приложение'), - ), - const SizedBox(height: 16), - Text( - ''' - Что-то пошло не так, попробуйте перезагрузить приложение - error: $error - stackTrace: $stackTrace - ''', - textAlign: TextAlign.center, - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/features/main/data/repository/main_mock_repository.dart b/lib/features/main/data/repository/main_mock_repository.dart deleted file mode 100644 index 9eada70..0000000 --- a/lib/features/main/data/repository/main_mock_repository.dart +++ /dev/null @@ -1,9 +0,0 @@ -import '../../domain/repository/i_main_repository.dart'; - -/// {@template MainMockRepository} -/// -/// {@endtemplate} -final class MainMockRepository implements IMainRepository { - @override - String get name => 'MainMockRepository'; -} \ No newline at end of file diff --git a/lib/features/main/data/repository/main_repository.dart b/lib/features/main/data/repository/main_repository.dart deleted file mode 100644 index 68778e5..0000000 --- a/lib/features/main/data/repository/main_repository.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:friflex_starter/app/http/i_http_client.dart'; - -import '../../domain/repository/i_main_repository.dart'; - -/// {@template MainRepository} -/// -/// {@endtemplate} -final class MainRepository implements IMainRepository { - final IHttpClient httpClient; - - MainRepository({required this.httpClient}); - - @override - String get name => 'MainRepository'; -} diff --git a/lib/features/main/domain/repository/i_main_repository.dart b/lib/features/main/domain/repository/i_main_repository.dart deleted file mode 100644 index aa3afb9..0000000 --- a/lib/features/main/domain/repository/i_main_repository.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'package:friflex_starter/di/di_base_repo.dart'; - -/// {@template IMainRepository} -/// -/// {@endtemplate} -abstract interface class IMainRepository with DiBaseRepo{} \ No newline at end of file diff --git a/lib/features/main/presentation/main_routes.dart b/lib/features/main/presentation/main_routes.dart deleted file mode 100644 index a942189..0000000 --- a/lib/features/main/presentation/main_routes.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/widgets.dart'; -import 'package:friflex_starter/features/main/presentation/screens/main_screen.dart'; -import 'package:go_router/go_router.dart'; - -abstract final class MainRoutes { - /// Название роута главной страницы - static const String mainScreenName = 'main_screen'; - - /// Путь роута страницы профиля пользователя - static const String _mainScreenPath = '/main'; - - /// Метод для построения ветки роутов по фиче профиля пользователя - /// - /// Принимает: - /// - [routes] - вложенные роуты - static StatefulShellBranch buildShellBranch({ - List routes = const [], - List? observers, - }) => - StatefulShellBranch( - initialLocation: _mainScreenPath, - observers: observers, - routes: [ - GoRoute( - path: _mainScreenPath, - name: mainScreenName, - builder: (context, state) => const MainScreen(), - routes: routes, - ), - ], - ); -} diff --git a/lib/features/main/presentation/screens/main_screen.dart b/lib/features/main/presentation/screens/main_screen.dart deleted file mode 100644 index eb1e19f..0000000 --- a/lib/features/main/presentation/screens/main_screen.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -class MainScreen extends StatelessWidget { - const MainScreen({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Main Screen'), - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ElevatedButton( - onPressed: () { - context.push('/profile'); - }, - child: const Text('Открыть профиль'), - ), - const SizedBox(height: 16), - ElevatedButton( - onPressed: () { - context.push('/profile_scope'); - }, - child: const Text('Открыть профиль с областью видимости'), - ), - ], - ), - ), - ); - } -} diff --git a/lib/features/profile/data/repository/profile_mock_repository.dart b/lib/features/profile/data/repository/profile_mock_repository.dart deleted file mode 100644 index 76c09a5..0000000 --- a/lib/features/profile/data/repository/profile_mock_repository.dart +++ /dev/null @@ -1,14 +0,0 @@ -import '../../domain/repository/i_profile_repository.dart'; - -/// {@template ProfileMockRepository} -/// -/// {@endtemplate} -final class ProfileMockRepository implements IProfileRepository { - @override - String get name => 'ProfileMockRepository'; - - @override - Future fetchUserProfile(String id) { - return Future.value('MOCK Yura Petrov'); - } -} diff --git a/lib/features/profile/data/repository/profile_repository.dart b/lib/features/profile/data/repository/profile_repository.dart deleted file mode 100644 index c1e8b84..0000000 --- a/lib/features/profile/data/repository/profile_repository.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:friflex_starter/app/http/i_http_client.dart'; - -import '../../domain/repository/i_profile_repository.dart'; - -/// {@template ProfileRepository} -/// -/// {@endtemplate} -final class ProfileRepository implements IProfileRepository { - final IHttpClient httpClient; - - ProfileRepository({required this.httpClient}); - - @override - String get name => 'ProfileRepository'; - - @override - Future fetchUserProfile(String id) async { - // Какой-то запрос к серверу - await Future.delayed(const Duration(seconds: 1)); - // httpClient.get('https://example.com/profile/$id'); - - return 'Yura Petrov'; - } -} diff --git a/lib/features/profile/domain/bloc/profile_bloc.dart b/lib/features/profile/domain/bloc/profile_bloc.dart deleted file mode 100644 index e53ffcf..0000000 --- a/lib/features/profile/domain/bloc/profile_bloc.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:friflex_starter/features/profile/domain/repository/i_profile_repository.dart'; - -part 'profile_event.dart'; -part 'profile_state.dart'; - -class ProfileBloc extends Bloc { - ProfileBloc(this._profileRepository) : super(ProfileInitialState()) { - // Вам необходимо добавлять только - // один обработчик событий в конструкторе - on((event, emit) async { - if (event is ProfileFetchProfileEvent) { - await _fetchProfile(event, emit); - } - }); - } - - final IProfileRepository _profileRepository; - - Future _fetchProfile( - ProfileFetchProfileEvent event, - Emitter emit, - ) async { - try { - emit(ProfileWaitingState()); - final data = await _profileRepository.fetchUserProfile(event.id); - emit(ProfileSuccessState(data: data)); - } on Object catch (error, stackTrace) { - emit( - ProfileErrorState( - message: 'Ошибка при загрузке профиля', - error: error, - stackTrace: stackTrace, - ), - ); - } - } -} diff --git a/lib/features/profile/domain/bloc/profile_event.dart b/lib/features/profile/domain/bloc/profile_event.dart deleted file mode 100644 index 88f7f40..0000000 --- a/lib/features/profile/domain/bloc/profile_event.dart +++ /dev/null @@ -1,17 +0,0 @@ -part of 'profile_bloc.dart'; - -sealed class ProfileEvent extends Equatable { - const ProfileEvent(); - - @override - List get props => []; -} - -final class ProfileFetchProfileEvent extends ProfileEvent { - final String id; - - const ProfileFetchProfileEvent({required this.id}); - - @override - List get props => [id]; -} diff --git a/lib/features/profile/domain/bloc/profile_state.dart b/lib/features/profile/domain/bloc/profile_state.dart deleted file mode 100644 index c368b35..0000000 --- a/lib/features/profile/domain/bloc/profile_state.dart +++ /dev/null @@ -1,36 +0,0 @@ -part of 'profile_bloc.dart'; - -sealed class ProfileState extends Equatable { - const ProfileState(); - - @override - List get props => []; -} - -final class ProfileInitialState extends ProfileState {} - -final class ProfileWaitingState extends ProfileState {} - -final class ProfileErrorState extends ProfileState { - final String message; - final Object error; - final StackTrace? stackTrace; - - const ProfileErrorState({ - required this.message, - required this.error, - this.stackTrace, - }); - - @override - List get props => [message, error]; -} - -final class ProfileSuccessState extends ProfileState { - final Object data; - - const ProfileSuccessState({required this.data}); - - @override - List get props => [data]; -} diff --git a/lib/features/profile/domain/repository/i_profile_repository.dart b/lib/features/profile/domain/repository/i_profile_repository.dart deleted file mode 100644 index 8209046..0000000 --- a/lib/features/profile/domain/repository/i_profile_repository.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:friflex_starter/di/di_base_repo.dart'; - -/// {@template IProfileRepository} -/// -/// {@endtemplate} -abstract interface class IProfileRepository with DiBaseRepo { - Future fetchUserProfile(String id); -} diff --git a/lib/features/profile/presentation/screens/profile_screen.dart b/lib/features/profile/presentation/screens/profile_screen.dart deleted file mode 100644 index d04b362..0000000 --- a/lib/features/profile/presentation/screens/profile_screen.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:friflex_starter/app/app_context_ext.dart'; -import 'package:friflex_starter/features/profile/domain/bloc/profile_bloc.dart'; - -// Класс экрана, где мы инициализируем ProfileBloc -// и вызываем событие ProfileFetchProfileEvent -class ProfileScreen extends StatelessWidget { - const ProfileScreen({super.key}); - - @override - Widget build(BuildContext context) { - final profileRepository = context.di.repositories.profileRepository; - // Здесь мы инициализируем ProfileBloc - // и вызываем событие ProfileFetchProfileEvent - // Или любые другие события, которые вам нужны - return BlocProvider( - create: (context) => ProfileBloc(profileRepository) - ..add(const ProfileFetchProfileEvent(id: '1')), - child: const _ProfileScreenView(), - ); - } -} - -/// Виджет, который отображает UI экрана -class _ProfileScreenView extends StatelessWidget { - const _ProfileScreenView(); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Profile'), - ), - body: Center( - child: BlocBuilder( - builder: (context, state) { - return switch (state) { - ProfileSuccessState() => Text('Data: ${state.props.first}'), - ProfileErrorState() => Text('Error: ${state.message}'), - _ => const CircularProgressIndicator(), - }; - }, - ), - ), - ); - } -} diff --git a/lib/features/profile_scope/data/repository/profile_scope_mock_repository.dart b/lib/features/profile_scope/data/repository/profile_scope_mock_repository.dart deleted file mode 100644 index 6ff04d0..0000000 --- a/lib/features/profile_scope/data/repository/profile_scope_mock_repository.dart +++ /dev/null @@ -1,14 +0,0 @@ -import '../../domain/repository/i_profile_scope_repository.dart'; - -/// {@template ProfileScopeMockRepository} -/// -/// {@endtemplate} -final class ProfileScopeMockRepository implements IProfileScopeRepository { - @override - String get name => 'ProfileScopeMockRepository'; - - @override - Future fetchUserProfile(String id) async { - return 'MOCK Yura Petrov'; - } -} diff --git a/lib/features/profile_scope/data/repository/profile_scope_repository.dart b/lib/features/profile_scope/data/repository/profile_scope_repository.dart deleted file mode 100644 index 7104f16..0000000 --- a/lib/features/profile_scope/data/repository/profile_scope_repository.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:friflex_starter/app/http/i_http_client.dart'; - -import '../../domain/repository/i_profile_scope_repository.dart'; - -/// {@template ProfileScopeRepository} -/// -/// {@endtemplate} -final class ProfileScopeRepository implements IProfileScopeRepository { - final IHttpClient httpClient; - - ProfileScopeRepository({required this.httpClient}); - - @override - String get name => 'ProfileScopeRepository'; - - @override - Future fetchUserProfile(String id) async { - // Какой-то запрос к серверу - await Future.delayed(const Duration(seconds: 1)); - // httpClient.get('https://example.com/profile/$id'); - - return 'Yura Petrov'; - } -} diff --git a/lib/features/profile_scope/domain/bloc/profile_scope_bloc.dart b/lib/features/profile_scope/domain/bloc/profile_scope_bloc.dart deleted file mode 100644 index c1b658d..0000000 --- a/lib/features/profile_scope/domain/bloc/profile_scope_bloc.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:friflex_starter/features/profile_scope/domain/repository/i_profile_scope_repository.dart'; - -part 'profile_scope_event.dart'; -part 'profile_scope_state.dart'; - -class ProfileScopeBloc extends Bloc { - ProfileScopeBloc({required IProfileScopeRepository profileRepository}) - : _profileRepository = profileRepository, - super(ProfileScopeInitialState()) { - // Вам необходимо добавлять только - // один обработчик событий в конструкторе - on((event, emit) async { - return switch (event) { - ProfileScopeFetchProfileEvent() => await _fetchProfile(event, emit), - }; - }); - } - - final IProfileScopeRepository _profileRepository; - - Future _fetchProfile( - ProfileScopeFetchProfileEvent event, - Emitter emit, - ) async { - try { - emit(ProfileScopeWaitingState()); - final data = await _profileRepository.fetchUserProfile(event.id); - emit(ProfileScopeSuccessState(data: data)); - } on Object catch (error, stackTrace) { - emit( - ProfileScopeErrorState( - message: 'Ошибка при загрузке профиля', - error: error, - stackTrace: stackTrace, - ), - ); - } - } -} diff --git a/lib/features/profile_scope/domain/bloc/profile_scope_event.dart b/lib/features/profile_scope/domain/bloc/profile_scope_event.dart deleted file mode 100644 index b8a0ef7..0000000 --- a/lib/features/profile_scope/domain/bloc/profile_scope_event.dart +++ /dev/null @@ -1,17 +0,0 @@ -part of 'profile_scope_bloc.dart'; - -sealed class ProfileScopeEvent extends Equatable { - const ProfileScopeEvent(); - - @override - List get props => []; -} - -final class ProfileScopeFetchProfileEvent extends ProfileScopeEvent { - final String id; - - const ProfileScopeFetchProfileEvent({required this.id}); - - @override - List get props => [id]; -} diff --git a/lib/features/profile_scope/domain/bloc/profile_scope_state.dart b/lib/features/profile_scope/domain/bloc/profile_scope_state.dart deleted file mode 100644 index 6d6b842..0000000 --- a/lib/features/profile_scope/domain/bloc/profile_scope_state.dart +++ /dev/null @@ -1,36 +0,0 @@ -part of 'profile_scope_bloc.dart'; - -sealed class ProfileScopeState extends Equatable { - const ProfileScopeState(); - - @override - List get props => []; -} - -final class ProfileScopeInitialState extends ProfileScopeState {} - -final class ProfileScopeWaitingState extends ProfileScopeState {} - -final class ProfileScopeErrorState extends ProfileScopeState { - final String message; - final Object error; - final StackTrace? stackTrace; - - const ProfileScopeErrorState({ - required this.message, - required this.error, - this.stackTrace, - }); - - @override - List get props => [message, error]; -} - -final class ProfileScopeSuccessState extends ProfileScopeState { - final Object data; - - const ProfileScopeSuccessState({required this.data}); - - @override - List get props => [data]; -} diff --git a/lib/features/profile_scope/domain/repository/i_profile_scope_repository.dart b/lib/features/profile_scope/domain/repository/i_profile_scope_repository.dart deleted file mode 100644 index d326ae2..0000000 --- a/lib/features/profile_scope/domain/repository/i_profile_scope_repository.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:friflex_starter/di/di_base_repo.dart'; - -/// {@template IProfileScopeRepository} -/// -/// {@endtemplate} -abstract interface class IProfileScopeRepository with DiBaseRepo { - Future fetchUserProfile(String id); -} diff --git a/lib/features/profile_scope/presentation/profile_scope.dart b/lib/features/profile_scope/presentation/profile_scope.dart deleted file mode 100644 index 99ba5fb..0000000 --- a/lib/features/profile_scope/presentation/profile_scope.dart +++ /dev/null @@ -1,77 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:friflex_starter/app/app_context_ext.dart'; -import 'package:friflex_starter/features/profile_scope/domain/bloc/profile_scope_bloc.dart'; - -class ProfileInheritedScope extends InheritedWidget { - const ProfileInheritedScope({ - required this.profileScopeBloc, - required super.child, - super.key, - }); - - final ProfileScopeBloc profileScopeBloc; - - @override - bool updateShouldNotify(ProfileInheritedScope oldWidget) => - profileScopeBloc != oldWidget.profileScopeBloc; -} - -class ProfileScope extends StatefulWidget { - const ProfileScope({ - required this.child, - super.key, - }); - - final Widget child; - - static ProfileInheritedScope? maybeOf( - BuildContext context, { - bool listen = false, - }) { - return listen - ? context.dependOnInheritedWidgetOfExactType() - : context.getInheritedWidgetOfExactType(); - } - - static ProfileInheritedScope of( - BuildContext context, { - bool listen = false, - }) { - final result = maybeOf(context, listen: listen); - - if (result == null) { - throw StateError( - 'ProfileScope is not found above widget ${context.widget}', - ); - } - - return result; - } - - @override - State createState() => _ProfileScopeState(); -} - -class _ProfileScopeState extends State { - late final ProfileScopeBloc _profileScopeBloc; - - @override - void initState() { - super.initState(); - - _profileScopeBloc = - ProfileScopeBloc(profileRepository: context.di.repositories.profileScopeRepository); - _profileScopeBloc.add(const ProfileScopeFetchProfileEvent(id: '1')); - } - - @override - void dispose() { - _profileScopeBloc.close(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return ProfileInheritedScope(profileScopeBloc: _profileScopeBloc, child: widget.child); - } -} diff --git a/lib/features/profile_scope/presentation/screens/profile_scope_screen.dart b/lib/features/profile_scope/presentation/screens/profile_scope_screen.dart deleted file mode 100644 index 72156cb..0000000 --- a/lib/features/profile_scope/presentation/screens/profile_scope_screen.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:friflex_starter/features/profile_scope/domain/bloc/profile_scope_bloc.dart'; -import 'package:friflex_starter/features/profile_scope/presentation/profile_scope.dart'; - -// Класс экрана, где мы инициализируем ProfileScopeBloc -class ProfileScopeScreen extends StatelessWidget { - const ProfileScopeScreen({super.key}); - - @override - Widget build(BuildContext context) { - return const ProfileScope( - child: _ProfileScopeView(), - ); - } -} - -class _ProfileScopeView extends StatelessWidget { - const _ProfileScopeView(); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text('Profile Scope')), - body: Center( - child: BlocBuilder( - bloc: ProfileScope.of(context).profileScopeBloc, - builder: (context, state) { - return switch (state) { - ProfileScopeSuccessState() => Text('Data: ${state.props.first}'), - ProfileScopeErrorState() => Text('Error: ${state.message}'), - _ => const CircularProgressIndicator(), - }; - }, - ), - ), - ); - } -} diff --git a/lib/features/root/root_screen.dart b/lib/features/root/root_screen.dart deleted file mode 100644 index 7797e6a..0000000 --- a/lib/features/root/root_screen.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -/// Класс для реализации корневой страницы приложения -class RootScreen extends StatelessWidget { - /// Создает корневую страницу приложения - /// - /// Принимает: - /// - [navigationShell] - текущая ветка навигации - const RootScreen({ - super.key, - required this.navigationShell, - }); - - /// Текущая ветка навигации - final StatefulNavigationShell navigationShell; - - @override - Widget build(BuildContext context) { - return Scaffold( - body: navigationShell, - bottomNavigationBar: BottomNavigationBar( - items: const [ - BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'), - BottomNavigationBarItem(icon: Icon(Icons.bug_report), label: 'Debug'), - ], - currentIndex: navigationShell.currentIndex, - onTap: navigationShell.goBranch, - ), - ); - } -} diff --git a/lib/features/splash/splash_screen.dart b/lib/features/splash/splash_screen.dart deleted file mode 100644 index 2bec9bb..0000000 --- a/lib/features/splash/splash_screen.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:friflex_starter/gen/assets.gen.dart'; - -/// {@template SplashScreen} -/// Экран загрузки приложения. -/// {@endtemplate} -class SplashScreen extends StatelessWidget { - /// {@macro SplashScreen} - const SplashScreen({super.key}); - - @override - Widget build(BuildContext context) { - return Center( - child: Assets.lottie.splash.lottie(), - ); - } -} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart deleted file mode 100644 index cd0b6e2..0000000 --- a/lib/gen/assets.gen.dart +++ /dev/null @@ -1,215 +0,0 @@ -/// GENERATED CODE - DO NOT MODIFY BY HAND -/// ***************************************************** -/// FlutterGen -/// ***************************************************** - -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use - -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_svg/flutter_svg.dart' as _svg; -import 'package:lottie/lottie.dart' as _lottie; -import 'package:vector_graphics/vector_graphics.dart' as _vg; - -class $AssetsFontsGen { - const $AssetsFontsGen(); - - /// File path: assets/fonts/Montserrat-Bold.ttf - String get montserratBold => 'assets/fonts/Montserrat-Bold.ttf'; - - /// File path: assets/fonts/Montserrat-ExtraBold.ttf - String get montserratExtraBold => 'assets/fonts/Montserrat-ExtraBold.ttf'; - - /// File path: assets/fonts/Montserrat-Medium.ttf - String get montserratMedium => 'assets/fonts/Montserrat-Medium.ttf'; - - /// File path: assets/fonts/Montserrat-Regular.ttf - String get montserratRegular => 'assets/fonts/Montserrat-Regular.ttf'; - - /// File path: assets/fonts/Montserrat-SemiBold.ttf - String get montserratSemiBold => 'assets/fonts/Montserrat-SemiBold.ttf'; - - /// List of all assets - List get values => [ - montserratBold, - montserratExtraBold, - montserratMedium, - montserratRegular, - montserratSemiBold - ]; -} - -class $AssetsIconsGen { - const $AssetsIconsGen(); - - /// File path: assets/icons/home.svg - SvgGenImage get home => const SvgGenImage('assets/icons/home.svg'); - - /// List of all assets - List get values => [home]; -} - -class $AssetsLottieGen { - const $AssetsLottieGen(); - - /// File path: assets/lottie/splash.json - LottieGenImage get splash => - const LottieGenImage('assets/lottie/splash.json'); - - /// List of all assets - List get values => [splash]; -} - -class Assets { - Assets._(); - - static const $AssetsFontsGen fonts = $AssetsFontsGen(); - static const $AssetsIconsGen icons = $AssetsIconsGen(); - static const $AssetsLottieGen lottie = $AssetsLottieGen(); -} - -class SvgGenImage { - const SvgGenImage( - this._assetName, { - this.size, - this.flavors = const {}, - }) : _isVecFormat = false; - - const SvgGenImage.vec( - this._assetName, { - this.size, - this.flavors = const {}, - }) : _isVecFormat = true; - - final String _assetName; - final Size? size; - final Set flavors; - final bool _isVecFormat; - - _svg.SvgPicture svg({ - Key? key, - bool matchTextDirection = false, - AssetBundle? bundle, - String? package, - double? width, - double? height, - BoxFit fit = BoxFit.contain, - AlignmentGeometry alignment = Alignment.center, - bool allowDrawingOutsideViewBox = false, - WidgetBuilder? placeholderBuilder, - String? semanticsLabel, - bool excludeFromSemantics = false, - _svg.SvgTheme? theme, - ColorFilter? colorFilter, - Clip clipBehavior = Clip.hardEdge, - @deprecated Color? color, - @deprecated BlendMode colorBlendMode = BlendMode.srcIn, - @deprecated bool cacheColorFilter = false, - }) { - final _svg.BytesLoader loader; - if (_isVecFormat) { - loader = _vg.AssetBytesLoader( - _assetName, - assetBundle: bundle, - packageName: package, - ); - } else { - loader = _svg.SvgAssetLoader( - _assetName, - assetBundle: bundle, - packageName: package, - theme: theme, - ); - } - return _svg.SvgPicture( - loader, - key: key, - matchTextDirection: matchTextDirection, - width: width, - height: height, - fit: fit, - alignment: alignment, - allowDrawingOutsideViewBox: allowDrawingOutsideViewBox, - placeholderBuilder: placeholderBuilder, - semanticsLabel: semanticsLabel, - excludeFromSemantics: excludeFromSemantics, - colorFilter: colorFilter ?? - (color == null ? null : ColorFilter.mode(color, colorBlendMode)), - clipBehavior: clipBehavior, - cacheColorFilter: cacheColorFilter, - ); - } - - String get path => _assetName; - - String get keyName => _assetName; -} - -class LottieGenImage { - const LottieGenImage( - this._assetName, { - this.flavors = const {}, - }); - - final String _assetName; - final Set flavors; - - _lottie.LottieBuilder lottie({ - Animation? controller, - bool? animate, - _lottie.FrameRate? frameRate, - bool? repeat, - bool? reverse, - _lottie.LottieDelegates? delegates, - _lottie.LottieOptions? options, - void Function(_lottie.LottieComposition)? onLoaded, - _lottie.LottieImageProviderFactory? imageProviderFactory, - Key? key, - AssetBundle? bundle, - Widget Function( - BuildContext, - Widget, - _lottie.LottieComposition?, - )? frameBuilder, - ImageErrorWidgetBuilder? errorBuilder, - double? width, - double? height, - BoxFit? fit, - AlignmentGeometry? alignment, - String? package, - bool? addRepaintBoundary, - FilterQuality? filterQuality, - void Function(String)? onWarning, - }) { - return _lottie.Lottie.asset( - _assetName, - controller: controller, - animate: animate, - frameRate: frameRate, - repeat: repeat, - reverse: reverse, - delegates: delegates, - options: options, - onLoaded: onLoaded, - imageProviderFactory: imageProviderFactory, - key: key, - bundle: bundle, - frameBuilder: frameBuilder, - errorBuilder: errorBuilder, - width: width, - height: height, - fit: fit, - alignment: alignment, - package: package, - addRepaintBoundary: addRepaintBoundary, - filterQuality: filterQuality, - onWarning: onWarning, - ); - } - - String get path => _assetName; - - String get keyName => _assetName; -} diff --git a/lib/gen/fonts.gen.dart b/lib/gen/fonts.gen.dart deleted file mode 100644 index 62059d8..0000000 --- a/lib/gen/fonts.gen.dart +++ /dev/null @@ -1,15 +0,0 @@ -/// GENERATED CODE - DO NOT MODIFY BY HAND -/// ***************************************************** -/// FlutterGen -/// ***************************************************** - -// coverage:ignore-file -// ignore_for_file: type=lint -// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use - -class FontFamily { - FontFamily._(); - - /// Font family: Montserrat - static const String montserrat = 'Montserrat'; -} diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb deleted file mode 100644 index 3975c9d..0000000 --- a/lib/l10n/app_en.arb +++ /dev/null @@ -1,6 +0,0 @@ -{ - "helloWorld": "Hello World!", - "@helloWorld": { - "description": "The conventional newborn programmer greeting" - } -} \ No newline at end of file diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb deleted file mode 100644 index 8a5bfbe..0000000 --- a/lib/l10n/app_ru.arb +++ /dev/null @@ -1,6 +0,0 @@ -{ - "helloWorld": "Привет, мир!", - "@helloWorld": { - "description": "Обычное приветствие новичка-программиста" - } -} \ No newline at end of file diff --git a/lib/l10n/gen/app_localizations.dart b/lib/l10n/gen/app_localizations.dart deleted file mode 100644 index ef6441b..0000000 --- a/lib/l10n/gen/app_localizations.dart +++ /dev/null @@ -1,135 +0,0 @@ -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:intl/intl.dart' as intl; - -import 'app_localizations_en.dart'; -import 'app_localizations_ru.dart'; - -// ignore_for_file: type=lint - -/// Callers can lookup localized strings with an instance of AppLocalizations -/// returned by `AppLocalizations.of(context)`. -/// -/// Applications need to include `AppLocalizations.delegate()` in their app's -/// `localizationDelegates` list, and the locales they support in the app's -/// `supportedLocales` list. For example: -/// -/// ```dart -/// import 'gen/app_localizations.dart'; -/// -/// return MaterialApp( -/// localizationsDelegates: AppLocalizations.localizationsDelegates, -/// supportedLocales: AppLocalizations.supportedLocales, -/// home: MyApplicationHome(), -/// ); -/// ``` -/// -/// ## Update pubspec.yaml -/// -/// Please make sure to update your pubspec.yaml to include the following -/// packages: -/// -/// ```yaml -/// dependencies: -/// # Internationalization support. -/// flutter_localizations: -/// sdk: flutter -/// intl: any # Use the pinned version from flutter_localizations -/// -/// # Rest of dependencies -/// ``` -/// -/// ## iOS Applications -/// -/// iOS applications define key application metadata, including supported -/// locales, in an Info.plist file that is built into the application bundle. -/// To configure the locales supported by your app, you’ll need to edit this -/// file. -/// -/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file. -/// Then, in the Project Navigator, open the Info.plist file under the Runner -/// project’s Runner folder. -/// -/// Next, select the Information Property List item, select Add Item from the -/// Editor menu, then select Localizations from the pop-up menu. -/// -/// Select and expand the newly-created Localizations item then, for each -/// locale your application supports, add a new item and select the locale -/// you wish to add from the pop-up menu in the Value field. This list should -/// be consistent with the languages listed in the AppLocalizations.supportedLocales -/// property. -abstract class AppLocalizations { - AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); - - final String localeName; - - static AppLocalizations? of(BuildContext context) { - return Localizations.of(context, AppLocalizations); - } - - static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); - - /// A list of this localizations delegate along with the default localizations - /// delegates. - /// - /// Returns a list of localizations delegates containing this delegate along with - /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, - /// and GlobalWidgetsLocalizations.delegate. - /// - /// Additional delegates can be added by appending to this list in - /// MaterialApp. This list does not have to be used at all if a custom list - /// of delegates is preferred or required. - static const List> localizationsDelegates = >[ - delegate, - GlobalMaterialLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - ]; - - /// A list of this localizations delegate's supported locales. - static const List supportedLocales = [ - Locale('en'), - Locale('ru') - ]; - - /// The conventional newborn programmer greeting - /// - /// In en, this message translates to: - /// **'Hello World!'** - String get helloWorld; -} - -class _AppLocalizationsDelegate extends LocalizationsDelegate { - const _AppLocalizationsDelegate(); - - @override - Future load(Locale locale) { - return SynchronousFuture(lookupAppLocalizations(locale)); - } - - @override - bool isSupported(Locale locale) => ['en', 'ru'].contains(locale.languageCode); - - @override - bool shouldReload(_AppLocalizationsDelegate old) => false; -} - -AppLocalizations lookupAppLocalizations(Locale locale) { - - - // Lookup logic when only language code is specified. - switch (locale.languageCode) { - case 'en': return AppLocalizationsEn(); - case 'ru': return AppLocalizationsRu(); - } - - throw FlutterError( - 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.' - ); -} diff --git a/lib/l10n/gen/app_localizations_en.dart b/lib/l10n/gen/app_localizations_en.dart deleted file mode 100644 index 2c753f4..0000000 --- a/lib/l10n/gen/app_localizations_en.dart +++ /dev/null @@ -1,13 +0,0 @@ -// ignore: unused_import -import 'package:intl/intl.dart' as intl; -import 'app_localizations.dart'; - -// ignore_for_file: type=lint - -/// The translations for English (`en`). -class AppLocalizationsEn extends AppLocalizations { - AppLocalizationsEn([String locale = 'en']) : super(locale); - - @override - String get helloWorld => 'Hello World!'; -} diff --git a/lib/l10n/gen/app_localizations_ru.dart b/lib/l10n/gen/app_localizations_ru.dart deleted file mode 100644 index d444152..0000000 --- a/lib/l10n/gen/app_localizations_ru.dart +++ /dev/null @@ -1,13 +0,0 @@ -// ignore: unused_import -import 'package:intl/intl.dart' as intl; -import 'app_localizations.dart'; - -// ignore_for_file: type=lint - -/// The translations for Russian (`ru`). -class AppLocalizationsRu extends AppLocalizations { - AppLocalizationsRu([String locale = 'ru']) : super(locale); - - @override - String get helloWorld => 'Привет, мир!'; -} diff --git a/lib/l10n/localization_notifier.dart b/lib/l10n/localization_notifier.dart deleted file mode 100644 index 7c47b95..0000000 --- a/lib/l10n/localization_notifier.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -typedef LocalizationBuilder = Widget Function(); - -/// Виджет для перестройки виджета в зависимости от локализации -class LocalizationConsumer extends StatelessWidget { - const LocalizationConsumer({super.key, required this.builder}); - - final LocalizationBuilder builder; - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (_, __, ___) { - return builder(); - }, - ); - } -} - -/// Класс для управления локализацией -final class LocalizationNotifier extends ChangeNotifier { - Locale _locale = const Locale('en', 'US'); - - Locale get locale => _locale; - - void changeLocal(Locale locale) { - _locale = locale; - notifyListeners(); - } -} diff --git a/lib/main.dart b/lib/main.dart index 6e22de4..5eb0432 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,6 @@ -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/runner/app_runner.dart'; +import 'package:flutter/material.dart'; +import 'package:friflex_starter/src/app.dart'; -void main() => AppRunner(AppEnv.prod).run(); +void main() { + runApp(const App()); +} diff --git a/lib/router/app_router.dart b/lib/router/app_router.dart deleted file mode 100644 index 60edc4a..0000000 --- a/lib/router/app_router.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:friflex_starter/features/debug/debug_routes.dart'; -import 'package:friflex_starter/features/debug/i_debug_service.dart'; -import 'package:friflex_starter/features/main/presentation/main_routes.dart'; -import 'package:friflex_starter/features/profile/presentation/screens/profile_screen.dart'; -import 'package:friflex_starter/features/profile_scope/presentation/screens/profile_scope_screen.dart'; -import 'package:friflex_starter/features/root/root_screen.dart'; -import 'package:friflex_starter/features/splash/splash_screen.dart'; -import 'package:go_router/go_router.dart'; - -/// Класс, реализующий роутер приложения и все поля классов -class AppRouter { - /// Конструктор для инициализации роутера - const AppRouter(); - - /// Ключ для доступа к корневому навигатору приложения - static final rootNavigatorKey = GlobalKey(); - - /// Начальный роут приложения - static String get initialLocation => '/debug'; - - /// Метод для создания экземпляра GoRouter - static GoRouter createRouter(IDebugService debugService) { - return GoRouter( - navigatorKey: rootNavigatorKey, - debugLogDiagnostics: true, - initialLocation: initialLocation, - routes: [ - StatefulShellRoute.indexedStack( - parentNavigatorKey: rootNavigatorKey, - builder: (context, state, navigationShell) => - RootScreen(navigationShell: navigationShell), - branches: [ - MainRoutes.buildShellBranch(), - DebugRoutes.buildShellBranch(), - ], - ), - GoRoute( - path: '/splash', - builder: (context, state) => const SplashScreen(), - ), - GoRoute( - path: '/profile', - builder: (context, state) => const ProfileScreen(), - ), - GoRoute( - path: '/profile_scope', - builder: (context, state) => const ProfileScopeScreen(), - ), - ], - ); - } -} diff --git a/lib/runner/app_runner.dart b/lib/runner/app_runner.dart deleted file mode 100644 index 0425979..0000000 --- a/lib/runner/app_runner.dart +++ /dev/null @@ -1,150 +0,0 @@ -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:friflex_starter/app/app.dart'; -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/di/di_container.dart'; -import 'package:friflex_starter/features/debug/debug_service.dart'; -import 'package:friflex_starter/features/debug/i_debug_service.dart'; -import 'package:friflex_starter/features/error/error_screen.dart'; -import 'package:friflex_starter/router/app_router.dart'; -import 'package:friflex_starter/runner/timer_runner.dart'; -import 'package:go_router/go_router.dart'; - -part 'errors_handlers.dart'; - -/// Время ожидания инициализации зависимостей -/// Если время превышено, то будет показан экран ошибки -/// В дальнейшем нужно убрать в env -const _initTimeout = Duration(seconds: 7); - -/// Класс, реализующий раннер для конфигурирования приложения при запуске -/// -/// Порядок инициализации: -/// 1. _initApp - инициализация конфигурации приложения -/// 2. инициализация репозиториев приложения (будет позже) -/// 3. runApp - запуск приложения -/// 4. _onAppLoaded - после запуска приложения -class AppRunner { - /// Создает экземпляр раннера приложения - /// - /// Принимает: - /// - [env] - тип окружения сборки приложения - AppRunner(this.env); - - /// Тип окружения сборки приложения¬ - final AppEnv env; - - /// Контейнер зависимостей приложения - late IDebugService _debugService; - - /// Роутер приложения - late GoRouter router; - - /// Таймер для отслеживания времени инициализации приложения - late TimerRunner _timerRunner; - - /// Метод для запуска приложения - Future run() async { - try { - WidgetsFlutterBinding.ensureInitialized(); - // Инициализация сервиса отладки - _debugService = DebugService(); - - _timerRunner = TimerRunner(_debugService); - - // Инициализация приложения - await _initApp(); - - // Инициализация метода обработки ошибок - _initErrorHandlers(_debugService); - - // Инициализация роутера - router = AppRouter.createRouter(_debugService); - - // throw Exception('Test error'); - - runApp( - App( - router: router, - initDependencies: () { - return _initDependencies( - debugService: _debugService, - env: env, - timerRunner: _timerRunner, - ).timeout( - _initTimeout, - onTimeout: () { - return Future.error( - TimeoutException( - 'Превышено время ожидания инициализации зависимостей', - ), - ); - }, - ); - }, - ), - ); - await _onAppLoaded(); - } on Object catch (e, stackTrace) { - await _onAppLoaded(); - - /// Если произошла ошибка при инициализации приложения, - /// то запускаем экран ошибки - runApp(ErrorScreen(error: e, stackTrace: stackTrace, onRetry: run)); - } - } - - /// Метод инициализации приложения, - /// выполняется до запуска приложения - Future _initApp() async { - // Запрет на поворот экрана - await SystemChrome.setPreferredOrientations( - [DeviceOrientation.portraitUp], - ); - - // Заморозка первого кадра (сплеш) - WidgetsBinding.instance.deferFirstFrame(); - } - - /// Метод срабатывает после запуска приложения - Future _onAppLoaded() async { - // Разморозка первого кадра (сплеш) - WidgetsBinding.instance.addPostFrameCallback((_) { - WidgetsBinding.instance.allowFirstFrame(); - }); - } - - // Метод для инициализации зависимостей приложения - Future _initDependencies({ - required IDebugService debugService, - required AppEnv env, - required TimerRunner timerRunner, - }) async { - // Имитация задержки инициализации - // TODO(yura): Удалить после проверки - await Future.delayed(const Duration(seconds: 3)); - debugService.log(() => 'Тип сборки: ${env.name}'); - final diContainer = DiContainer( - env: env, - dService: debugService, - ); - await diContainer.init( - onProgress: (name) => timerRunner.logOnProgress(name), - onComplete: (name) { - timerRunner - ..logOnComplete(name) - ..stop(); - }, - onError: (message, error, [stackTrace]) => debugService.logError( - message, - error: error, - stackTrace: stackTrace, - ), - ); - //throw Exception('Test error'); - return diContainer; - } -} diff --git a/lib/runner/errors_handlers.dart b/lib/runner/errors_handlers.dart deleted file mode 100644 index de69e46..0000000 --- a/lib/runner/errors_handlers.dart +++ /dev/null @@ -1,35 +0,0 @@ -part of 'app_runner.dart'; - -/// Метод инициализации обработчиков ошибок -void _initErrorHandlers(IDebugService debugService) { - // Обработка ошибок в приложении - FlutterError.onError = (details) { - _showErrorScreen(details.exception, details.stack); - debugService.logError( - () => 'FlutterError.onError: ${details.exceptionAsString()}', - error: details.exception, - stackTrace: details.stack, - ); - }; - // Обработка асинхронных ошибок в приложении - PlatformDispatcher.instance.onError = (error, stack) { - _showErrorScreen(error, stack); - debugService.logError( - () => 'PlatformDispatcher.instance.onError', - error: error, - stackTrace: stack, - ); - return true; - }; -} - -/// Метод для показа экрана ошибки -void _showErrorScreen(Object error, StackTrace? stackTrace) { - WidgetsBinding.instance.addPostFrameCallback((_) { - AppRouter.rootNavigatorKey.currentState?.push( - MaterialPageRoute( - builder: (_) => ErrorScreen(error: error, stackTrace: stackTrace), - ), - ); - }); -} diff --git a/lib/runner/timer_runner.dart b/lib/runner/timer_runner.dart deleted file mode 100644 index ba99236..0000000 --- a/lib/runner/timer_runner.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'package:friflex_starter/features/debug/i_debug_service.dart'; - -/// {@template TimerRunner} -/// Класс для подсчета времени запуска приложения -/// {@endtemplate} -class TimerRunner { - /// {@macro TimerRunner} - TimerRunner(this._debugService) { - _stopwatch.start(); - } - - /// Сервис для отладки - final IDebugService _debugService; - - /// Секундомер для подсчета времени инициализации - final _stopwatch = Stopwatch(); - - /// Метод для остановки секундомера и вывода времени - /// полной инициализации приложения - void stop() { - _stopwatch.stop(); - _debugService.log( - 'Время инициализации приложения: ${_stopwatch.elapsedMilliseconds} мс', - ); - } - - /// Метод для обработки прогресса инициализации зависимостей - void logOnProgress(String name) { - _debugService.log( - '$name успешная инициализация, прогресс: ${_stopwatch.elapsedMilliseconds} мс', - ); - } - - /// Метод для обработки прогресса инициализации зависимостей - void logOnComplete(String message) { - _debugService.log( - '$message, прогресс: ${_stopwatch.elapsedMilliseconds} мс', - ); - - } - - /// Метод для обработки прогресса инициализации зависимостей - void logOnError( - String message, - Object error, [ - StackTrace? stackTrace, - ]) { - _debugService.logError(() => message, error: error, stackTrace: stackTrace); - } -} diff --git a/lib/src/app.dart b/lib/src/app.dart new file mode 100644 index 0000000..6545a8a --- /dev/null +++ b/lib/src/app.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; +import 'package:friflex_starter/src/initialization/app_initialization_step_label.dart'; +import 'package:friflex_starter/src/initialization/app_initialization_steps.dart'; +import 'package:friflex_starter/src/initialization/initialization_scope.dart'; +import 'package:friflex_starter/src/router/app_router_delegate.dart'; +import 'package:friflex_starter/src/splash_screen.dart'; + +class App extends StatefulWidget { + const App({ + super.key, + }); + + @override + State createState() => _AppState(); +} + +class _AppState extends State { + late final GlobalKey _navigatorKey; + late final AppRouterDelegate _routerDelegate; + + @override + void initState() { + super.initState(); + + _navigatorKey = GlobalKey(); + _routerDelegate = AppRouterDelegate( + navigatorKey: _navigatorKey, + homePage: const MaterialPage( + child: SplashScreen(), + ), + ); + } + + @override + void dispose() { + _routerDelegate.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return InitializationScope( + labels: AppInitializableStepLabels.values, + // Factory метод для создания объектов для каждого шага + // При добавлении новых значений в AppInitializableStepLabels.values, здесь необходимо добавить их обработку + createStep: (context, label) { + if (label == AppInitializableStepLabels.step0) { + return const Step0(); + } else if (label == AppInitializableStepLabels.step1) { + return const Step1(); + } else if (label == AppInitializableStepLabels.step2) { + return const Step2(); + } else if (label == AppInitializableStepLabels.step3) { + return const Step3(); + } else { + throw StateError('Не указан шаг инициализации для "$label"'); + } + }, + // Здесь описываются взаимосвязи между шагами инициализации для выстраивания корректной последовательности выполнения + relations: >{ + AppInitializableStepLabels.step3: { + AppInitializableStepLabels.step2, + }, + AppInitializableStepLabels.step2: { + AppInitializableStepLabels.step1, + }, + }, + child: MaterialApp.router( + routerDelegate: _routerDelegate, + ), + ); + } +} diff --git a/lib/src/initialization/app_initialization_step_label.dart b/lib/src/initialization/app_initialization_step_label.dart new file mode 100644 index 0000000..069c039 --- /dev/null +++ b/lib/src/initialization/app_initialization_step_label.dart @@ -0,0 +1,21 @@ +import 'package:friflex_starter/src/initialization/initialization_step_label.dart'; + +abstract class AppInitializableStepLabels { + const AppInitializableStepLabels._(); + + static const step0 = AppInitializableStepLabel('step0'); + static const step1 = AppInitializableStepLabel('step1'); + static const step2 = AppInitializableStepLabel('step2'); + static const step3 = AppInitializableStepLabel('step3'); + + static Set values = { + step0, + step1, + step2, + step3, + }; +} + +class AppInitializableStepLabel extends InitializableStepLabel { + const AppInitializableStepLabel(super.value); +} diff --git a/lib/src/initialization/app_initialization_steps.dart b/lib/src/initialization/app_initialization_steps.dart new file mode 100644 index 0000000..1a4b17c --- /dev/null +++ b/lib/src/initialization/app_initialization_steps.dart @@ -0,0 +1,47 @@ +import 'dart:async'; + +import 'package:friflex_starter/src/initialization/app_initialization_step_label.dart'; +import 'package:friflex_starter/src/initialization/initialization_step.dart'; + +abstract class AppInitializationStep + extends InitializableStep { + const AppInitializationStep({ + required super.label, + }); +} + +class Step0 extends AppInitializationStep { + const Step0() : super(label: AppInitializableStepLabels.step0); + + @override + FutureOr initialize() async { + await Future.delayed(const Duration(seconds: 1)); + } +} + +class Step1 extends AppInitializationStep { + const Step1() : super(label: AppInitializableStepLabels.step1); + + @override + FutureOr initialize() async { + await Future.delayed(const Duration(seconds: 2)); + } +} + +class Step2 extends AppInitializationStep { + const Step2() : super(label: AppInitializableStepLabels.step2); + + @override + FutureOr initialize() async { + await Future.delayed(const Duration(seconds: 3)); + } +} + +class Step3 extends AppInitializationStep { + const Step3() : super(label: AppInitializableStepLabels.step3); + + @override + FutureOr initialize() async { + await Future.delayed(const Duration(seconds: 4)); + } +} diff --git a/lib/src/initialization/initialization_controller.dart b/lib/src/initialization/initialization_controller.dart new file mode 100644 index 0000000..9e56315 --- /dev/null +++ b/lib/src/initialization/initialization_controller.dart @@ -0,0 +1,257 @@ +import 'dart:async'; + +import 'package:equatable/equatable.dart'; +import 'package:flutter/foundation.dart'; +import 'package:friflex_starter/src/initialization/initialization_step.dart'; +import 'package:friflex_starter/src/initialization/initialization_step_label.dart'; +import 'package:friflex_starter/src/initialization/initialization_step_result.dart'; + +abstract class IInitializationController> + implements ValueListenable { + Future initialize( + Set steps, + Map> relations, + ); +} + +class InitializationController> + extends ValueNotifier + implements IInitializationController { + InitializationController() : super(const InitializationState$NotStarted()); + + @override + Future initialize( + Set steps, + Map> relations, + ) async { + final initializationSw = Stopwatch()..start(); + final totalSteps = steps.length; + var completedStepsCount = 0; + try { + value = InitializationState$InProgress( + completedSteps: completedStepsCount, + totalSteps: totalSteps, + ); + final stepsToPerform = {}; + final initialSteps = {}; + for (final step in steps) { + stepsToPerform[step.label] = step; + + final stepDependencies = relations[step.label]; + if (stepDependencies == null || stepDependencies.isEmpty) { + initialSteps.add(step); + } + } + if (initialSteps.isEmpty) { + initializationSw.stop(); + Error.throwWithStackTrace( + StateError( + 'Не найден ни один шаг без зависимостей, нет точки входа для инициализации', + ), + StackTrace.current, + ); + } + + final initializedStepsLabels = {}; + final notInitializedStepsLabels = {...stepsToPerform.keys}; + final results = >{ + for (final entry in stepsToPerform.entries) + entry.key: InitializationStepResult$NotInitialized(step: entry.value), + }; + final stepsInProgress = {}; + + Future handleSteps(Set stepsToHandle) { + print( + stepsToHandle.length == 1 + ? 'PERFORMING EXACT STEP ${stepsToHandle.first.runtimeType}' + : 'PERFORMING STEPS ${stepsToHandle.map((s) => s.runtimeType)}', + ); + + return Future.wait( + stepsToHandle.map((step) async { + final sw = Stopwatch()..start(); + results[step.label] = + InitializationStepResult$InProgress(step: step); + stepsInProgress.add(step.label); + + try { + final rawResult = await step.initialize(); + results[step.label] = InitializationStepResult$Completed( + result: rawResult, + step: step, + ); + completedStepsCount += 1; + final currentValue = value; + switch (currentValue) { + case InitializationState$Completed(): + // потенциально невозможный кейс + break; + case InitializationState$NotStarted(): + case InitializationState$InProgress(): + value = InitializationState$InProgress( + completedSteps: completedStepsCount, + totalSteps: totalSteps, + ); + break; + case InitializationState$Failed(): + value = InitializationState$Failed( + completedSteps: completedStepsCount, + totalSteps: totalSteps, + ); + } + + print('STEP COMPLETED ${step.runtimeType}'); + + initializedStepsLabels.add(step.label); + notInitializedStepsLabels.remove(step.label); + + if (notInitializedStepsLabels.isEmpty) { + return; + } + + final nextStepsToInitialize = {}; + for (final notInitializedStepLabel in notInitializedStepsLabels) { + final stepRelationsLabels = relations[notInitializedStepLabel]; + if (stepRelationsLabels == null || + stepRelationsLabels.isEmpty) { + if (results[notInitializedStepLabel] + is InitializationStepResult$NotInitialized) { + // TODO bang + nextStepsToInitialize.add( + stepsToPerform[notInitializedStepLabel]!, + ); + } + continue; + } + + var hasUninitializedRelation = false; + for (final stepRelationLabel in stepRelationsLabels) { + if (notInitializedStepsLabels.contains(stepRelationLabel)) { + hasUninitializedRelation = true; + break; + } + } + if (!hasUninitializedRelation && + results[notInitializedStepLabel] + is InitializationStepResult$NotInitialized) { + // TODO bang + nextStepsToInitialize.add( + stepsToPerform[notInitializedStepLabel]!, + ); + continue; + } + } + + // TODO сюда sw для подсчета времени инициализации конкретного шага + if (nextStepsToInitialize.isNotEmpty) { + await handleSteps(nextStepsToInitialize); + } + } on Object catch (e, s) { + sw.stop(); + results[step.label] = InitializationStepResult$Failed( + e: e, + s: s, + completionTimeInMicroseconds: sw.elapsedMicroseconds, + step: step, + ); + print('STEP FAILED ${step.runtimeType}'); + rethrow; + } finally { + stepsInProgress.remove(step.label); + } + }), + ); + } + + await handleSteps(initialSteps); + initializationSw.stop(); + if (completedStepsCount != totalSteps) { + Error.throwWithStackTrace( + StateError( + 'Какой-то из шагов инициализации был завершён с ошибкой', + ), + StackTrace.current, + ); + } + print( + 'INITIALIZATION COMPLETED (${initializationSw.elapsedMilliseconds} ms)', + ); + value = InitializationState$Completed( + completionTime: Duration( + milliseconds: initializationSw.elapsedMilliseconds, + ), + ); + } on Object catch (e, s) { + print( + 'INITIALIZATION FAILED ($completedStepsCount/$totalSteps | ${initializationSw.elapsedMilliseconds} ms)', + ); + value = InitializationState$Failed( + completedSteps: completedStepsCount, + totalSteps: totalSteps, + ); + } + } +} + +@immutable +sealed class InitializationState with EquatableMixin { + const InitializationState(); + + @override + @mustCallSuper + List get props => []; +} + +class InitializationState$NotStarted extends InitializationState { + const InitializationState$NotStarted(); +} + +class InitializationState$InProgress extends InitializationState { + const InitializationState$InProgress({ + required this.completedSteps, + required this.totalSteps, + }); + + final int completedSteps; + final int totalSteps; + + @override + List get props => [ + completedSteps, + totalSteps, + super.props, + ]; +} + +class InitializationState$Completed extends InitializationState { + const InitializationState$Completed({ + required this.completionTime, + }); + + final Duration completionTime; + + @override + List get props => [ + completionTime, + super.props, + ]; +} + +class InitializationState$Failed extends InitializationState { + const InitializationState$Failed({ + required this.completedSteps, + required this.totalSteps, + }); + + final int completedSteps; + final int totalSteps; + + @override + List get props => [ + completedSteps, + totalSteps, + super.props, + ]; +} diff --git a/lib/src/initialization/initialization_scope.dart b/lib/src/initialization/initialization_scope.dart new file mode 100644 index 0000000..8416d45 --- /dev/null +++ b/lib/src/initialization/initialization_scope.dart @@ -0,0 +1,97 @@ +import 'package:flutter/material.dart'; +import 'package:friflex_starter/src/initialization/initialization_controller.dart'; +import 'package:friflex_starter/src/initialization/initialization_step.dart'; +import 'package:friflex_starter/src/initialization/initialization_step_label.dart'; + +class InitializationScope> extends StatefulWidget { + const InitializationScope({ + required this.labels, + required this.createStep, + required this.relations, + required this.child, + super.key, + }); + + final Set labels; + final S? Function(BuildContext context, L label) createStep; + final Map> relations; + final Widget child; + + static InitializationInheritedScope of( + BuildContext context, { + bool listen = false, + }) { + // TODO bang + return _maybeOf(context, listen: listen)!; + } + + static InitializationInheritedScope? _maybeOf( + BuildContext context, { + bool listen = false, + }) { + return listen + ? context + .dependOnInheritedWidgetOfExactType() + : context.getInheritedWidgetOfExactType(); + } + + @override + State> createState() => + _InitializationScopeState(); +} + +class _InitializationScopeState> + extends State> { + late final InitializationController _initializationController; + + @override + void initState() { + super.initState(); + + final labelsWithSteps = {}; + for (final label in widget.labels) { + final createdStep = widget.createStep(context, label); + if (createdStep == null) continue; + labelsWithSteps[label] = createdStep; + } + + _initializationController = InitializationController() + ..initialize( + labelsWithSteps.values.toSet(), + widget.relations, + ); + } + + @override + void dispose() { + _initializationController.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return InitializationInheritedScope( + controller: _initializationController, + child: widget.child, + ); + } +} + +class InitializationInheritedScope extends InheritedWidget { + const InitializationInheritedScope({ + required this.controller, + required super.child, + super.key, + }); + + final IInitializationController controller; + + @override + bool updateShouldNotify(covariant InheritedWidget oldWidget) { + return oldWidget is InitializationInheritedScope && + oldWidget.controller != controller; + } +} diff --git a/lib/src/initialization/initialization_step.dart b/lib/src/initialization/initialization_step.dart new file mode 100644 index 0000000..7adf61a --- /dev/null +++ b/lib/src/initialization/initialization_step.dart @@ -0,0 +1,13 @@ +import 'dart:async'; + +import 'package:friflex_starter/src/initialization/initialization_step_label.dart'; + +abstract class InitializableStep { + const InitializableStep({ + required this.label, + }); + + final L label; + + FutureOr initialize(); +} diff --git a/lib/src/initialization/initialization_step_label.dart b/lib/src/initialization/initialization_step_label.dart new file mode 100644 index 0000000..b8cfb23 --- /dev/null +++ b/lib/src/initialization/initialization_step_label.dart @@ -0,0 +1,13 @@ +import 'package:equatable/equatable.dart'; +import 'package:meta/meta.dart'; + +@immutable +abstract class InitializableStepLabel with EquatableMixin { + final T value; + + const InitializableStepLabel(this.value); + + @override + @mustCallSuper + List get props => [value]; +} diff --git a/lib/src/initialization/initialization_step_result.dart b/lib/src/initialization/initialization_step_result.dart new file mode 100644 index 0000000..27ea0f1 --- /dev/null +++ b/lib/src/initialization/initialization_step_result.dart @@ -0,0 +1,74 @@ +import 'package:equatable/equatable.dart'; +import 'package:friflex_starter/src/initialization/initialization_step.dart'; +import 'package:friflex_starter/src/initialization/initialization_step_label.dart'; +import 'package:meta/meta.dart'; + +@immutable +sealed class InitializationStepResult> with EquatableMixin { + const InitializationStepResult({ + required this.step, + }); + + final S step; + + @override + @mustCallSuper + List get props => [step]; +} + +class InitializationStepResult$NotInitialized> + extends InitializationStepResult { + const InitializationStepResult$NotInitialized({ + required super.step, + }); +} + +class InitializationStepResult$InProgress> + extends InitializationStepResult { + const InitializationStepResult$InProgress({ + required super.step, + }); +} + +class InitializationStepResult$Completed> + extends InitializationStepResult { + const InitializationStepResult$Completed({ + required this.result, + required super.step, + }); + + final R result; + + @override + List get props => [ + result, + super.props, + ]; +} + +class InitializationStepResult$Failed> + extends InitializationStepResult { + const InitializationStepResult$Failed({ + required this.e, + required this.s, + required this.completionTimeInMicroseconds, + required super.step, + }); + + final Object e; + final StackTrace s; + final int completionTimeInMicroseconds; + + @override + List get props => [ + e, + s, + completionTimeInMicroseconds, + super.props, + ]; +} diff --git a/lib/src/router/app_router_delegate.dart b/lib/src/router/app_router_delegate.dart new file mode 100644 index 0000000..d794d28 --- /dev/null +++ b/lib/src/router/app_router_delegate.dart @@ -0,0 +1,38 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +class AppRouterDelegate extends RouterDelegate + with ChangeNotifier, PopNavigatorRouterDelegateMixin { + AppRouterDelegate({ + required GlobalKey navigatorKey, + required Page homePage, + }) : _navigatorKey = navigatorKey, + _pages = [homePage]; + + final GlobalKey _navigatorKey; + + late List _pages; + + @override + Widget build(BuildContext context) { + return Navigator( + key: navigatorKey, + restorationScopeId: 'rootNav', + pages: _pages, + onDidRemovePage: (page) { + _pages = [..._pages]..remove(page); + if (_pages.remove(page)) { + notifyListeners(); + } + }, + ); + } + + @override + GlobalKey? get navigatorKey => _navigatorKey; + + @override + Future setNewRoutePath(String configuration) { + return SynchronousFuture(null); + } +} diff --git a/lib/src/splash_screen.dart b/lib/src/splash_screen.dart new file mode 100644 index 0000000..5c46144 --- /dev/null +++ b/lib/src/splash_screen.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:friflex_starter/src/initialization/initialization_controller.dart'; +import 'package:friflex_starter/src/initialization/initialization_scope.dart'; + +class SplashScreen extends StatefulWidget { + const SplashScreen({ + super.key, + }); + + @override + State createState() => _SplashScreenState(); +} + +class _SplashScreenState extends State { + late final IInitializationController _initializationController; + + @override + void initState() { + super.initState(); + + _initializationController = InitializationScope.of(context).controller; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SafeArea( + child: Center( + child: ValueListenableBuilder( + valueListenable: _initializationController, + builder: (context, state, _) { + final String displayedText; + switch (state) { + case InitializationState$NotStarted(): + displayedText = 'Инициализация не начата'; + break; + case InitializationState$InProgress(): + displayedText = + 'Загружаем ${((state.completedSteps / state.totalSteps) * 100).toInt()}%'; + break; + case InitializationState$Completed(): + final seconds = state.completionTime.inSeconds; + displayedText = + 'Загрузка завершена (${seconds > 0 ? '$seconds сек. ${state.completionTime.inMilliseconds % Duration.millisecondsPerSecond} мс' : '${state.completionTime.inMilliseconds} мс'} )'; + break; + case InitializationState$Failed(): + displayedText = + 'Ошибка загрузки (${state.completedSteps}/${state.totalSteps})'; + break; + } + + return Text(displayedText); + }, + ), + ), + ), + ); + } +} diff --git a/lib/targets/dev.dart b/lib/targets/dev.dart deleted file mode 100644 index 95804b7..0000000 --- a/lib/targets/dev.dart +++ /dev/null @@ -1,4 +0,0 @@ -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/runner/app_runner.dart'; - -void main() => AppRunner(AppEnv.dev).run(); diff --git a/lib/targets/prod.dart b/lib/targets/prod.dart deleted file mode 100644 index 37ff7f0..0000000 --- a/lib/targets/prod.dart +++ /dev/null @@ -1,5 +0,0 @@ - -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/runner/app_runner.dart'; - -void main() => AppRunner(AppEnv.prod).run(); diff --git a/lib/targets/stage.dart b/lib/targets/stage.dart deleted file mode 100644 index 151e7cb..0000000 --- a/lib/targets/stage.dart +++ /dev/null @@ -1,5 +0,0 @@ - -import 'package:friflex_starter/app/app_env.dart'; -import 'package:friflex_starter/runner/app_runner.dart'; - -void main() => AppRunner(AppEnv.stage).run(); diff --git a/pubspec.lock b/pubspec.lock index b8e737b..468113c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,210 +1,46 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" - url: "https://pub.dev" - source: hosted - version: "76.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.3" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" - url: "https://pub.dev" - source: hosted - version: "6.11.0" - app_services: - dependency: "direct main" - description: - path: "app_services/aurora/app_services" - relative: true - source: path - version: "0.0.1" - archive: - dependency: transitive - description: - name: archive - sha256: "0c64e928dcbefddecd234205422bcfc2b5e6d31be0b86fef0d0dd48d7b4c9742" - url: "https://pub.dev" - source: hosted - version: "4.0.4" - args: - dependency: transitive - description: - name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 - url: "https://pub.dev" - source: hosted - version: "2.6.0" - asn1lib: - dependency: transitive - description: - name: asn1lib - sha256: "068190d6c99c436287936ba5855af2e1fa78d8083ae65b4db6a281780da727ae" - url: "https://pub.dev" - source: hosted - version: "1.6.0" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.12.0" - bloc: - dependency: transitive - description: - name: bloc - sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" - url: "https://pub.dev" - source: hosted - version: "8.1.4" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dev" source: hosted - version: "2.1.2" - build: - dependency: transitive - description: - name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 - url: "https://pub.dev" - source: hosted - version: "2.4.2" - build_config: - dependency: transitive - description: - name: build_config - sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" - url: "https://pub.dev" - source: hosted - version: "1.1.2" - build_daemon: - dependency: transitive - description: - name: build_daemon - sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" - url: "https://pub.dev" - source: hosted - version: "4.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 - url: "https://pub.dev" - source: hosted - version: "2.4.4" - build_runner: - dependency: "direct dev" - description: - name: build_runner - sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" - url: "https://pub.dev" - source: hosted - version: "2.4.14" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" - url: "https://pub.dev" - source: hosted - version: "8.0.0" - built_collection: - dependency: transitive - description: - name: built_collection - sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" - source: hosted - version: "5.1.1" - built_value: - dependency: transitive - description: - name: built_value - sha256: "8b158ab94ec6913e480dc3f752418348b5ae099eb75868b5f4775f0572999c61" - url: "https://pub.dev" - source: hosted - version: "8.9.4" + version: "2.1.1" characters: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.4.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" + version: "1.3.0" clock: dependency: transitive description: name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dev" source: hosted - version: "1.1.2" - code_builder: - dependency: transitive - description: - name: code_builder - sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" - url: "https://pub.dev" - source: hosted - version: "4.10.1" + version: "1.1.1" collection: dependency: transitive description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.1" - color: - dependency: transitive - description: - name: color - sha256: ddcdf1b3badd7008233f5acffaf20ca9f5dc2cd0172b75f68f24526a5f5725cb - url: "https://pub.dev" - source: hosted - version: "3.0.0" - convert: - dependency: transitive - description: - name: convert - sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 - url: "https://pub.dev" - source: hosted - version: "3.1.2" - crypto: - dependency: transitive - description: - name: crypto - sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://pub.dev" - source: hosted - version: "3.0.6" + version: "1.18.0" cupertino_icons: dependency: "direct main" description: @@ -213,62 +49,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" - url: "https://pub.dev" - source: hosted - version: "2.3.8" - dartx: - dependency: transitive - description: - name: dartx - sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - dio: - dependency: "direct main" - description: - name: dio - sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260" - url: "https://pub.dev" - source: hosted - version: "5.7.0" - dio_web_adapter: - dependency: transitive - description: - name: dio_web_adapter - sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - encrypt: - dependency: transitive - description: - name: encrypt - sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" - url: "https://pub.dev" - source: hosted - version: "5.0.3" - envied: - dependency: "direct main" - description: - name: envied - sha256: "08a9012e5d93e1a816919a52e37c7b8367e73ebb8d52d1ca7dd6fcd875a2cd2c" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - envied_generator: - dependency: "direct dev" - description: - name: envied_generator - sha256: "9a49ca9f3744069661c4f2c06993647699fae2773bca10b593fbb3228d081027" - url: "https://pub.dev" - source: hosted - version: "1.0.1" equatable: dependency: "direct main" description: @@ -281,71 +61,15 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dev" source: hosted - version: "1.3.2" - ffi: - dependency: transitive - description: - name: ffi - sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - file: - dependency: transitive - description: - name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.dev" - source: hosted - version: "7.0.1" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.dev" - source: hosted - version: "1.1.1" + version: "1.3.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_bloc: - dependency: "direct main" - description: - name: flutter_bloc - sha256: "890c51c8007f0182360e523518a0c732efb89876cb4669307af7efada5b55557" - url: "https://pub.dev" - source: hosted - version: "8.1.1" - flutter_gen: - dependency: "direct dev" - description: - name: flutter_gen - sha256: d7e4e57f606d73628b97765a67fdfb5a97e24cd2183e170afa8d1f62e48a9d5c - url: "https://pub.dev" - source: hosted - version: "5.8.0" - flutter_gen_core: - dependency: transitive - description: - name: flutter_gen_core - sha256: "46ecf0e317413dd065547887c43f93f55e9653e83eb98dc13dd07d40dd225325" - url: "https://pub.dev" - source: hosted - version: "5.8.0" - flutter_gen_runner: - dependency: "direct dev" - description: - name: flutter_gen_runner - sha256: "77f0a02fc30d9fcf2549fe874eb3fde091435724904bcbb1af60aa40cbfab1f4" - url: "https://pub.dev" - source: hosted - version: "5.8.0" flutter_lints: dependency: transitive description: @@ -354,86 +78,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_secure_storage: - dependency: transitive - description: - name: flutter_secure_storage - sha256: "98352186ee7ad3639ccc77ad7924b773ff6883076ab952437d20f18a61f0a7c5" - url: "https://pub.dev" - source: hosted - version: "8.0.0" - flutter_secure_storage_aurora: - dependency: transitive - description: - path: "." - ref: "aurora-0.5.3" - resolved-ref: "81fdc77c8211edc37398531f5b528786d8e7ac8b" - url: "https://gitlab.com/omprussia/flutter/flutter-community-plugins/flutter_secure_storage_aurora.git" - source: git - version: "0.5.3" - flutter_secure_storage_linux: - dependency: transitive - description: - name: flutter_secure_storage_linux - sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 - url: "https://pub.dev" - source: hosted - version: "1.2.2" - flutter_secure_storage_macos: - dependency: transitive - description: - name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" - url: "https://pub.dev" - source: hosted - version: "3.1.3" - flutter_secure_storage_platform_interface: - dependency: transitive - description: - name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 - url: "https://pub.dev" - source: hosted - version: "1.1.2" - flutter_secure_storage_web: - dependency: transitive - description: - name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - flutter_secure_storage_windows: - dependency: transitive - description: - name: flutter_secure_storage_windows - sha256: "38f9501c7cb6f38961ef0e1eacacee2b2d4715c63cc83fe56449c4d3d0b47255" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b - url: "https://pub.dev" - source: hosted - version: "2.0.17" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" friflex_lint_rules: dependency: "direct dev" description: @@ -442,133 +91,22 @@ packages: url: "https://pub.friflex.com" source: hosted version: "4.0.1" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 - url: "https://pub.dev" - source: hosted - version: "4.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de - url: "https://pub.dev" - source: hosted - version: "2.1.3" - go_router: - dependency: "direct main" - description: - name: go_router - sha256: "7c2d40b59890a929824f30d442e810116caf5088482629c894b9e4478c67472d" - url: "https://pub.dev" - source: hosted - version: "14.6.3" - graphs: - dependency: transitive - description: - name: graphs - sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - hashcodes: - dependency: transitive - description: - name: hashcodes - sha256: "80f9410a5b3c8e110c4b7604546034749259f5d6dcca63e0d3c17c9258f1a651" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - http: - dependency: transitive - description: - name: http - sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f - url: "https://pub.dev" - source: hosted - version: "1.3.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 - url: "https://pub.dev" - source: hosted - version: "3.2.2" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.dev" - source: hosted - version: "4.1.2" - i_app_services: - dependency: "direct main" - description: - path: "app_services/i_app_services" - relative: true - source: path - version: "0.0.1" - image_size_getter: - dependency: transitive - description: - name: image_size_getter - sha256: "9a299e3af2ebbcfd1baf21456c3c884037ff524316c97d8e56035ea8fdf35653" - url: "https://pub.dev" - source: hosted - version: "2.4.0" - intl: - dependency: "direct main" - description: - name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf - url: "https://pub.dev" - source: hosted - version: "0.19.0" - io: - dependency: transitive - description: - name: io - sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b - url: "https://pub.dev" - source: hosted - version: "1.0.5" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.dev" - source: hosted - version: "4.9.0" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -585,38 +123,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - logging: - dependency: transitive - description: - name: logging - sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - lottie: - dependency: "direct main" - description: - name: lottie - sha256: c5fa04a80a620066c15cf19cc44773e19e9b38e989ff23ea32e5903ef1015950 - url: "https://pub.dev" - source: hosted - version: "3.3.1" - macros: - dependency: transitive - description: - name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" - url: "https://pub.dev" - source: hosted - version: "0.1.3-main.0" matcher: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: @@ -626,323 +140,74 @@ packages: source: hosted version: "0.11.1" meta: - dependency: transitive + dependency: "direct main" description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" - mime: - dependency: transitive - description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - package_config: - dependency: transitive - description: - name: package_config - sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" - url: "https://pub.dev" - source: hosted - version: "2.1.1" + version: "1.15.0" path: dependency: transitive description: name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.9.1" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 - url: "https://pub.dev" - source: hosted - version: "2.1.4" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" - url: "https://pub.dev" - source: hosted - version: "2.2.15" - path_provider_aurora: - dependency: transitive - description: - path: "packages/path_provider_aurora" - ref: "aurora-path_provider_aurora-0.6.0" - resolved-ref: "82e13309171cb454aae989dbbde477282dfa7e20" - url: "https://gitlab.com/omprussia/flutter/packages.git" - source: git - version: "0.6.0" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.dev" - source: hosted - version: "2.3.0" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" - url: "https://pub.dev" - source: hosted - version: "6.1.0" - platform: - dependency: transitive - description: - name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.dev" - source: hosted - version: "3.1.6" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - pointycastle: - dependency: transitive - description: - name: pointycastle - sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" - url: "https://pub.dev" - source: hosted - version: "3.9.1" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - posix: - dependency: transitive - description: - name: posix - sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a - url: "https://pub.dev" - source: hosted - version: "6.0.1" - provider: - dependency: "direct main" - description: - name: provider - sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c - url: "https://pub.dev" - source: hosted - version: "6.1.2" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" - url: "https://pub.dev" - source: hosted - version: "1.5.0" - recase: - dependency: transitive - description: - name: recase - sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - shelf: - dependency: transitive - description: - name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 - url: "https://pub.dev" - source: hosted - version: "1.4.2" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 - url: "https://pub.dev" - source: hosted - version: "2.0.1" + version: "1.9.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.0" - source_gen: - dependency: transitive - description: - name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" - url: "https://pub.dev" - source: hosted - version: "1.5.0" + version: "0.0.99" source_span: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.12.1" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.4" - stream_transform: - dependency: transitive - description: - name: stream_transform - sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 - url: "https://pub.dev" - source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.4" - time: - dependency: transitive - description: - name: time - sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - timing: - dependency: transitive - description: - name: timing - sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" - url: "https://pub.dev" - source: hosted - version: "1.1.18" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" - url: "https://pub.dev" - source: hosted - version: "1.1.13" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" - url: "https://pub.dev" - source: hosted - version: "1.1.16" + version: "0.7.2" vector_math: dependency: transitive description: @@ -955,66 +220,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.3.1" - watcher: - dependency: transitive - description: - name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - web: - dependency: transitive - description: - name: web - sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - web_socket: - dependency: transitive - description: - name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" - url: "https://pub.dev" - source: hosted - version: "0.1.6" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - xml: - dependency: transitive - description: - name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.dev" - source: hosted - version: "6.5.0" - yaml: - dependency: transitive - description: - name: yaml - sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce - url: "https://pub.dev" - source: hosted - version: "3.1.3" + version: "14.2.5" sdks: - dart: ">=3.7.0 <4.0.0" - flutter: ">=3.27.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 314d147..a63ed1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,38 +1,19 @@ name: friflex_starter description: "A new Flutter project." -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: 'none' version: 1.0.0+1 environment: - sdk: ^3.6.0 + sdk: ^3.3.0 dependencies: flutter: sdk: flutter cupertino_icons: 1.0.8 - envied: 1.0.1 - go_router: 14.6.3 - flutter_bloc: 8.1.1 - provider: 6.1.2 - dio: 5.7.0 - intl: 0.19.0 - flutter_svg: 2.0.17 - flutter_localizations: - sdk: flutter - lottie: 3.3.1 - - ### основной сервис с интерфейсами - i_app_services: - path: ./app_services/i_app_services - - app_services: - ### Базовая реализация ### - - ### Аврора реализация ### - path: app_services/aurora/app_services - equatable: ^2.0.7 + meta: 1.15.0 + equatable: 2.0.7 dev_dependencies: flutter_test: @@ -40,11 +21,6 @@ dev_dependencies: friflex_lint_rules: hosted: https://pub.friflex.com version: 4.0.1 - envied_generator: 1.0.1 - build_runner: 2.4.14 - flutter_gen_runner: 5.8.0 - flutter_gen: 5.8.0 - flutter: uses-material-design: true