This commit is contained in:
petrovyuri
2025-01-21 14:24:31 +03:00
parent e7b2c31e86
commit 17d096baac
96 changed files with 3575 additions and 0 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,13 @@
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<String> getAppDocumentsDirectoryPath() async {
return (await getApplicationDocumentsDirectory()).path;
}
}

View File

@@ -0,0 +1,48 @@
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;
@override
String get name => 'AuroraAppSecureStorage';
/// Экземпляр хранилища данных
final _box = const FlutterSecureStorage();
@override
Future<void> clear() async {
await _box.deleteAll();
}
@override
Future<void> delete(String key) async {
await _box.delete(key: key);
}
@override
Future<bool> exists(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);
}
}

View File

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