0maru / twitter_login

MIT License
54 stars 54 forks source link

fix: parse json as nullable value #99

Closed mj-hd closed 2 years ago

mj-hd commented 2 years ago

This PR fixes an error:

TwitterLoginStatus.error: type 'Null' is not a subtype of type 'String' in type cast

I also added some tests to verify the fix.

❯ fvm flutter test
00:00 +0: loading /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart
00:01 +0: loading /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart
00:02 +0: loading /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart
00:02 +0: loading /Users/s01052/Projects/twitter_login_forked/test/access_token_test.dart
00:02 +0: /Users/s01052/Projects/twitter_login_forked/test/access_token_test.dart: access token json parse test parse
00:02 +1: /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart: user response json parse test parse
00:02 +2: /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart: user response json parse test parse
00:02 +3: /Users/s01052/Projects/twitter_login_forked/test/access_token_test.dart: access token json parse test all undefined
00:02 +4: /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart: user response json parse test email is null
00:02 +5: /Users/s01052/Projects/twitter_login_forked/test/twitter_login_test.dart: user response json parse test email is null
00:02 +5: All tests passed!
0maru commented 2 years ago

LGTM. Thanks.

0maru commented 2 years ago

Now Released.