Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/supabase_flutter/lib/src/local_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,23 @@ class EmptyLocalStorage extends LocalStorage {
Future<void> persistSession(persistSessionString) async {}
}

/// A [LocalStorage] implementation that implements SharedPreferences as the
/// A [LocalStorage] implementation that implements SharedPreferencesAsync as the
/// storage method.
class SharedPreferencesLocalStorage extends LocalStorage {
late final SharedPreferences _prefs;
late final SharedPreferencesAsync _prefs;

SharedPreferencesLocalStorage({required this.persistSessionKey});

final String persistSessionKey;

static const _useWebLocalStorage =
kIsWeb && bool.fromEnvironment("dart.library.js_interop");

@override
Future<void> initialize() async {
if (!_useWebLocalStorage) {
WidgetsFlutterBinding.ensureInitialized();
_prefs = await SharedPreferences.getInstance();
_prefs = SharedPreferencesAsync();
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/supabase_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/sup
documentation: 'https://supabase.com/docs/reference/dart/introduction'

environment:
sdk: '>=3.3.0 <4.0.0'
flutter: '>=3.19.0'
sdk: '>=3.4.0 <4.0.0'
flutter: '>=3.22.0'

dependencies:
app_links: '>=3.5.0 <7.0.0'
Expand All @@ -20,7 +20,7 @@ dependencies:
supabase: 2.8.0
url_launcher: ^6.1.2
path_provider: ^2.0.0
shared_preferences: ^2.0.0
shared_preferences: ^2.3.0
logging: ^1.2.0
web: '>=0.5.0 <2.0.0'

Expand Down