refactor(full refactor): Рефакторинг стартера (#8)

This commit is contained in:
Yuri Petrov
2025-04-27 17:08:34 +03:00
committed by GitHub
parent 18eb7b1fe1
commit 5d7d29ecf8
206 changed files with 1065 additions and 20102 deletions

View File

@@ -0,0 +1,29 @@
# 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/

View File

@@ -0,0 +1,10 @@
# 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

View File

@@ -0,0 +1 @@
# Базовые сервисы для приложения

View File

@@ -0,0 +1 @@
include: package:friflex_lint_rules/analysis_options.yaml

View File

@@ -0,0 +1,4 @@
library app_services;
export 'src/app_path_provider.dart';
export 'src/app_secure_storage.dart';

View File

@@ -0,0 +1,18 @@
import 'package:i_app_services/i_app_services.dart';
import 'package:path_provider/path_provider.dart';
/// {@template app_path_provider}
/// Класс для базовой реализации сервиса работы с путями
/// {@endtemplate}
class AppPathProvider implements IPathProvider {
/// {@macro app_path_provider}
const AppPathProvider();
/// Наименование сервиса
static const name = 'BaseAppPathProvider';
@override
Future<String> getAppDocumentsDirectoryPath() async {
return (await getApplicationDocumentsDirectory()).path;
}
}

View File

@@ -0,0 +1,46 @@
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:i_app_services/i_app_services.dart';
/// {@template app_secure_storage}
/// Класс для Aurora реализации сервис по работе с защищенным хранилищем
/// [secretKey] - ключ для шифрования данных, если нужен
/// {@endtemplate}
final class AppSecureStorage implements ISecureStorage {
AppSecureStorage({this.secretKey});
@override
final String? secretKey;
static const name = 'BaseAppSecureStorage';
/// Экземпляр хранилища данных
final _box = const FlutterSecureStorage();
@override
Future<void> deleteAll() async {
await _box.deleteAll();
}
@override
Future<void> delete(String key) async {
await _box.delete(key: key);
}
@override
Future<bool> containsKey(String key) {
return _box.containsKey(key: key);
}
@override
Future<String?> read(String key) async {
return _box.read(key: key);
}
@override
Future<void> write(String key, String value) async {
await _box.write(key: key, value: value);
}
@override
String get nameImpl => AppSecureStorage.name;
}

View File

@@ -0,0 +1,30 @@
name: app_services
description: "Базовые сервисы для приложения"
version: 0.0.1
publish_to: none
environment:
sdk: ^3.6.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