mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2026-02-05 11:42:17 +00:00
refactor(full refactor): Рефакторинг стартера (#8)
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import 'package:i_app_services/i_app_services.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
/// Класс для Aurora реализации сервиса работы с путями
|
||||
/// {@template app_path_provider}
|
||||
/// Класс для Аврора реализации сервиса работы с путями
|
||||
/// {@endtemplate}
|
||||
class AppPathProvider implements IPathProvider {
|
||||
/// {@macro app_path_provider}
|
||||
const AppPathProvider();
|
||||
|
||||
/// Наименование сервиса
|
||||
static const name = 'AuroraAppPathProvider';
|
||||
|
||||
|
||||
@@ -2,21 +2,23 @@ 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';
|
||||
|
||||
/// {@template app_secure_storage}
|
||||
/// Класс для Aurora реализации сервис по работе с защищенным хранилищем
|
||||
/// [secretKey] - ключ для шифрования данных, обязательный параметр для Авроры
|
||||
/// {@endtemplate}
|
||||
final class AppSecureStorage implements ISecureStorage {
|
||||
/// Создает сервис для работы с защищенным хранилищем
|
||||
///
|
||||
/// Принимает:
|
||||
/// - [secretKey] - ключ шифрования данных
|
||||
AppSecureStorage({required this.secretKey}){
|
||||
FlutterSecureStorageAurora.setSecret(secretKey);
|
||||
AppSecureStorage({required this.secretKey}) {
|
||||
FlutterSecureStorageAurora.setSecret(secretKey);
|
||||
}
|
||||
|
||||
@override
|
||||
final String secretKey;
|
||||
|
||||
|
||||
static const name = 'AuroraAppSecureStorage';
|
||||
static const name = 'AuroraAppSecureStorage';
|
||||
|
||||
/// Экземпляр хранилища данных
|
||||
final _box = const FlutterSecureStorage();
|
||||
@@ -46,6 +48,6 @@ final class AppSecureStorage implements ISecureStorage {
|
||||
await _box.write(key: key, value: value);
|
||||
}
|
||||
|
||||
@override
|
||||
@override
|
||||
String get nameImpl => AppSecureStorage.name;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ version: 0.0.1
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ^3.5.0
|
||||
flutter: ^3.24.0
|
||||
sdk: ^3.6.0
|
||||
flutter: ">=3.24.0"
|
||||
|
||||
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user