hitherejoe / FlutterOAuth

A Flutter OAuth package for performing user authentication for your apps.
Other
178 stars 56 forks source link

Fitbit Api Oauth Issue #5

Open Sheing opened 6 years ago

Sheing commented 6 years ago

I am trying to connect to fitbit oauth, here is my code:

Map<String, String> customParameters = {"scope": "activity"}; final OAuth flutterOAuth = new FlutterOAuth(new Config( "https://www.fitbit.com/oauth2/authorize", "https://api.fitbit.com/oauth2/token", "######", "################", "http://localhost:8080", "code", parameters:customParameters, contentType: "application/x-www-form-urlencoded"));

But i keep getting a null return after I logged in and allowed access to app.

Error: I/flutter ( 6554): null E/flutter ( 6554): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter ( 6554): 'package:flutter/src/widgets/text.dart': Failed assertion: line 212 pos 15: 'data != null': is not true. E/flutter ( 6554): #0 _AssertionError._doThrowNew (dart:core-patch/dart:core/errors_patch.dart:37) E/flutter ( 6554): #1 _AssertionError._throwNew (dart:core-patch/dart:core/errors_patch.dart:33) E/flutter ( 6554): #2 new Text (package:flutter/src/widgets/text.dart:212:15) E/flutter ( 6554): #3 MainState.authorise (/data/user/0/co.joebirch.tide/cache/exampleFJXSCW/example/lib/main.dart:71:20) E/flutter ( 6554): E/flutter ( 6554): #4 MainState.build. (/data/user/0/co.joebirch.tide/cache/exampleFJXSCW/example/lib/main.dart:47:36) E/flutter ( 6554): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:478:14) E/flutter ( 6554): #6 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:530:30)