작성
·
523
0
flutter_secure_storage: ^6.0.0
이 버전을 사용했어 그런지
write 문장에서 특별한 에러가 없는데
바로 read 해도 null 입니다
이것은 버전 문제 일까요?
-----------------------
print(resp.data);
final refreshToken = resp.data['refreshToken'];
final accessToken = resp.data['accessToken'];
print('login refreshToken:$refreshToken');
print('login accessToken:$accessToken');
await storage.write(key: REFRESH_TOKEN_KEY, value: refreshToken);
await storage.write(key: ACCESS_TOKEN_KEY, value: accessToken);
final readRefreshToken = await storage.read(key: 'REFRESH_TOKEN_KEY');
final readAccessToken = await storage.read(key: 'ACCESS_TOKEN_KEY');
print('readRefreshToken:$readRefreshToken');
print('readAccessToken:$readAccessToken');
-----------------------
{refreshToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RAY29kZWZhY3RvcnkuYWkiLCJzdWIiOiJmNTViMzJkMi00ZDY4LTRjMWUtYTNjYS1kYTlkN2QwZDkyZTUiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY2NzM4NTQ3OSwiZXhwIjoxNjY3NDcxODc5fQ.B8Bik9YKNZ8VtCO7BQypqwnR8i9HCpKjWSwDuAwneZk, accessToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RAY29kZWZhY3RvcnkuYWkiLCJzdWIiOiJmNTViMzJkMi00ZDY4LTRjMWUtYTNjYS1kYTlkN2QwZDkyZTUiLCJ0eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjY3Mzg1NDc5LCJleHAiOjE2NjczODU3Nzl9.pUQfDzJ4dd9pMv1FgHJqj7Pv3firnaz7s0JLAtjd5BE}
I/flutter (10390): login refreshToken:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RAY29kZWZhY3RvcnkuYWkiLCJzdWIiOiJmNTViMzJkMi00ZDY4LTRjMWUtYTNjYS1kYTlkN2QwZDkyZTUiLCJ0eXBlIjoicmVmcmVzaCIsImlhdCI6MTY2NzM4NTQ3OSwiZXhwIjoxNjY3NDcxODc5fQ.B8Bik9YKNZ8VtCO7BQypqwnR8i9HCpKjWSwDuAwneZk
I/flutter (10390): login accessToken:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RAY29kZWZhY3RvcnkuYWkiLCJzdWIiOiJmNTViMzJkMi00ZDY4LTRjMWUtYTNjYS1kYTlkN2QwZDkyZTUiLCJ0eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjY3Mzg1NDc5LCJleHAiOjE2NjczODU3Nzl9.pUQfDzJ4dd9pMv1FgHJqj7Pv3firnaz7s0JLAtjd5BE
I/flutter (10390): readRefreshToken:null
I/flutter (10390): readAccessToken:null
답변 3
0
감사합니다.
이런 단순한 실수를 하고
버전 문제인가 한참을 고생했습니다.....
에휴 코딩 초보자가 하는 실수를 했네요....
flutter는 한참 초보가 맞습니다.
flutter_secure_storage: ^6.0.0
에서도 잘됩니다.
감사합니다
0
0
현재 설치된 버전 정보 입니다.
PS D:\01_web\work_flutter\flutter_study_codefactory> flutter --version
Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision eb6d86ee27 (4 weeks ago) • 2022-10-04 22:31:45 -0700
Engine • revision c08d7d5efc
Tools • Dart 2.18.2 • DevTools 2.15.0