File tree 2 files changed +7
-7
lines changed
packages/supabase_flutter 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
- // ignore: avoid_web_libraries_in_flutter
2
- import 'dart:html' as html;
1
+ import 'package:web/web.dart' ;
3
2
4
- final _localStorage = html. window.localStorage;
3
+ final _localStorage = window.localStorage;
5
4
6
5
Future <bool > hasAccessToken (String persistSessionKey) async =>
7
- _localStorage.containsKey (persistSessionKey);
6
+ _localStorage.getItem (persistSessionKey) != null ;
8
7
9
8
Future <String ?> accessToken (String persistSessionKey) async =>
10
- _localStorage[ persistSessionKey] ;
9
+ _localStorage. getItem ( persistSessionKey) ;
11
10
12
11
Future <void > removePersistedSession (String persistSessionKey) async =>
13
- _localStorage.remove (persistSessionKey);
12
+ _localStorage.removeItem (persistSessionKey);
14
13
15
14
Future <void > persistSession (
16
15
String persistSessionKey, persistSessionString) async =>
17
- _localStorage[ persistSessionKey] = persistSessionString;
16
+ _localStorage. setItem ( persistSessionKey, persistSessionString) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ dependencies:
22
22
path_provider : ^2.0.0
23
23
shared_preferences : ^2.0.0
24
24
logging : ^1.2.0
25
+ web : ' >=0.5.0 <2.0.0'
25
26
26
27
dev_dependencies :
27
28
dart_jsonwebtoken : ^2.4.1
You can’t perform that action at this time.
0 commit comments