feat: initial Cutdex application
Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
This commit is contained in:
commit
27e77fff39
718 files changed
+183958
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'agent_credentials.g.dart';
|
||||
|
||||
abstract interface class AgentCredentialStore {
|
||||
Future<String?> read(String id);
|
||||
Future<void> write(String id, String value);
|
||||
Future<void> delete(String id);
|
||||
}
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
AgentCredentialStore agentCredentialStore(Ref ref) {
|
||||
final storage = Platform.isMacOS
|
||||
? const FlutterSecureStorage(
|
||||
mOptions: MacOsOptions(usesDataProtectionKeychain: false),
|
||||
)
|
||||
: const FlutterSecureStorage();
|
||||
return FlutterSecureAgentCredentialStore(storage);
|
||||
}
|
||||
|
||||
class FlutterSecureAgentCredentialStore implements AgentCredentialStore {
|
||||
FlutterSecureAgentCredentialStore(this._storage);
|
||||
|
||||
final FlutterSecureStorage _storage;
|
||||
|
||||
@override
|
||||
Future<String?> read(String id) => _storage.read(key: id);
|
||||
|
||||
@override
|
||||
Future<void> write(String id, String value) =>
|
||||
_storage.write(key: id, value: value);
|
||||
|
||||
@override
|
||||
Future<void> delete(String id) => _storage.delete(key: id);
|
||||
}
|
||||
|
||||
class MemoryAgentCredentialStore implements AgentCredentialStore {
|
||||
final Map<String, String> _values = {};
|
||||
|
||||
@override
|
||||
Future<String?> read(String id) async => _values[id];
|
||||
|
||||
@override
|
||||
Future<void> write(String id, String value) async => _values[id] = value;
|
||||
|
||||
@override
|
||||
Future<void> delete(String id) async => _values.remove(id);
|
||||
}
|
||||
Reference in new issue
Block a user