use flutter secure storage not simple secure storage

This commit is contained in:
Henry Hiles 2026-01-08 18:51:20 -05:00
commit e3d051767c
No known key found for this signature in database
7 changed files with 69 additions and 117 deletions

View file

@ -1,26 +1,19 @@
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:simple_secure_storage/simple_secure_storage.dart";
import "package:flutter_secure_storage/flutter_secure_storage.dart";
class SecureStorageController extends AsyncNotifier<void> {
class SecureStorageController extends Notifier<FlutterSecureStorage> {
@override
Future<void> build() => SimpleSecureStorage.initialize();
FlutterSecureStorage build() => FlutterSecureStorage();
Future<String?> get(String key) async {
await future;
return SimpleSecureStorage.read(key);
}
Future<String?> get(String key) => state.read(key: key);
Future<void> set(String key, String value) async {
await future;
return SimpleSecureStorage.write(key, value);
}
Future<void> set(String key, String value) =>
state.write(key: key, value: value);
Future<void> clear() async {
await future;
return SimpleSecureStorage.clear();
}
Future<void> clear() => state.deleteAll();
static final provider = AsyncNotifierProvider<SecureStorageController, void>(
SecureStorageController.new,
);
static final provider =
NotifierProvider<SecureStorageController, FlutterSecureStorage>(
SecureStorageController.new,
);
}

View file

@ -8,10 +8,9 @@
#include <dynamic_system_colors/dynamic_color_plugin.h>
#include <file_selector_linux/file_selector_plugin.h>
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
#include <simple_secure_storage_linux/simple_secure_storage_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <webcrypto/webcrypto_plugin.h>
#include <window_manager/window_manager_plugin.h>
#include <window_size/window_size_plugin.h>
@ -22,18 +21,15 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
g_autoptr(FlPluginRegistrar) simple_secure_storage_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SimpleSecureStorageLinuxPlugin");
simple_secure_storage_linux_plugin_register_with_registrar(simple_secure_storage_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) webcrypto_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WebcryptoPlugin");
webcrypto_plugin_register_with_registrar(webcrypto_registrar);
g_autoptr(FlPluginRegistrar) window_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
window_manager_plugin_register_with_registrar(window_manager_registrar);

View file

@ -5,10 +5,9 @@
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_system_colors
file_selector_linux
flutter_secure_storage_linux
screen_retriever_linux
simple_secure_storage_linux
url_launcher_linux
webcrypto
window_manager
window_size
)

View file

@ -517,6 +517,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.1"
flutter_secure_storage:
dependency: "direct main"
description:
name: flutter_secure_storage
sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40
url: "https://pub.dev"
source: hosted
version: "10.0.0"
flutter_secure_storage_darwin:
dependency: transitive
description:
name: flutter_secure_storage_darwin
sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
flutter_secure_storage_linux:
dependency: transitive
description:
name: flutter_secure_storage_linux
sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
flutter_secure_storage_platform_interface:
dependency: transitive
description:
name: flutter_secure_storage_platform_interface
sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
flutter_secure_storage_web:
dependency: transitive
description:
name: flutter_secure_storage_web
sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
flutter_secure_storage_windows:
dependency: transitive
description:
name: flutter_secure_storage_windows
sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
flutter_svg:
dependency: "direct main"
description:
@ -808,14 +856,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.11.3"
just_throttle_it:
dependency: transitive
description:
name: just_throttle_it
sha256: af2d0c1e5c7f4e0bef79a55edf3d74c180908253f89203467bc432730f5fac5b
url: "https://pub.dev"
source: hosted
version: "3.0.1"
leak_tracker:
dependency: transitive
description:
@ -1176,14 +1216,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.8.5+2"
sembast_web:
dependency: transitive
description:
name: sembast_web
sha256: "0362c7c241ad6546d3e27b4cfffaae505e5a9661e238dbcdd176756cc960fe7a"
url: "https://pub.dev"
source: hosted
version: "2.4.2"
shared_preferences:
dependency: "direct main"
description:
@ -1272,62 +1304,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0"
simple_secure_storage:
dependency: "direct main"
description:
name: simple_secure_storage
sha256: ca823a355bb7bb0e9b969876508e7d3a5dc0d1fb2dcb681c85b6e315f1e876e9
url: "https://pub.dev"
source: hosted
version: "0.3.7"
simple_secure_storage_android:
dependency: transitive
description:
name: simple_secure_storage_android
sha256: "50fb27267755843af039da116d0e545f313ae329ef8838101880802259e0f741"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
simple_secure_storage_darwin:
dependency: transitive
description:
name: simple_secure_storage_darwin
sha256: "8bd2ffcc62b478957ce20046bb96618b91a11e74af5d9fe2b4b229117bad18a7"
url: "https://pub.dev"
source: hosted
version: "0.2.2"
simple_secure_storage_linux:
dependency: transitive
description:
name: simple_secure_storage_linux
sha256: a7b7dccfaf496c27f882c26634ac083f2f545c0a4ca0818534c6261205a83686
url: "https://pub.dev"
source: hosted
version: "0.2.5"
simple_secure_storage_platform_interface:
dependency: transitive
description:
name: simple_secure_storage_platform_interface
sha256: "04fd4ce4c2b97c01a12eba46f51e3075a793d11f13340d06a64eb9b45a463ca5"
url: "https://pub.dev"
source: hosted
version: "0.2.3"
simple_secure_storage_web:
dependency: transitive
description:
name: simple_secure_storage_web
sha256: "63a3474a9931ab2587e01d22e7e95c0b7cc31338c0fafed5db9d1d798d1d3e0e"
url: "https://pub.dev"
source: hosted
version: "0.2.3"
simple_secure_storage_windows:
dependency: transitive
description:
name: simple_secure_storage_windows
sha256: cf31d2a97c26cf854aeb3c9774cd253f6600fb3fdfc6d807d480afae678cef10
url: "https://pub.dev"
source: hosted
version: "0.3.2"
sky_engine:
dependency: transitive
description: flutter
@ -1670,14 +1646,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
webcrypto:
dependency: transitive
description:
name: webcrypto
sha256: "6b43001c4110856ff7fa5e5e65e7b2d44bec1d8b54a4d84d5fa2c7622267c5c1"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
webkit_inspection_protocol:
dependency: transitive
description:

View file

@ -65,12 +65,12 @@ dependencies:
flutter_vodozemac: ^0.4.1
flutter_widget_from_html_core: ^0.17.0
flutter_svg: ^2.2.2
simple_secure_storage: ^0.3.6
json_annotation: ^4.9.0
vodozemac: ^0.4.0
shared_preferences: ^2.5.3
mention_tag_text_field: ^0.0.9
fluttertagger: ^2.3.1
flutter_secure_storage: ^10.0.0
dev_dependencies:
build_runner: ^2.4.11

View file

@ -8,10 +8,9 @@
#include <dynamic_system_colors/dynamic_color_plugin_c_api.h>
#include <file_selector_windows/file_selector_windows.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
#include <simple_secure_storage_windows/simple_secure_storage_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <webcrypto/webcrypto_plugin.h>
#include <window_manager/window_manager_plugin.h>
#include <window_size/window_size_plugin.h>
@ -20,14 +19,12 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
SimpleSecureStorageWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SimpleSecureStorageWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WebcryptoPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WebcryptoPlugin"));
WindowManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowManagerPlugin"));
WindowSizePluginRegisterWithRegistrar(

View file

@ -5,10 +5,9 @@
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_system_colors
file_selector_windows
flutter_secure_storage_windows
screen_retriever_windows
simple_secure_storage_windows
url_launcher_windows
webcrypto
window_manager
window_size
)