I have a class
import 'package:core/core.dart';
import 'package:injectable/injectable.dart';
import 'package:parse_server_sdk_flutter/parse_server_sdk.dart';
@LazySingleton()
class LoginGoogle {
Future<void> call(String token, String id, String idToken) async {
final res = await ParseUser.loginWith("google", {
"access_token": token,
"id": id,
"id_token": idToken,
});
if (res.success) {
logger?.i("User is logged in with google");
} else {
logger?.e("Login with google failed", res.error?.exception);
}
}
}
It works well when user is not registered but if user is already in a database I get this error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type ‘_InternalLinkedHashMap<String, dynamic>’ is not a subtype of type ‘List?’
Full log:
E/flutter (28704): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type ‘_InternalLinkedHashMap<String, dynamic>’ is not a subtype of type ‘List?’
E/flutter (28704): #0 isSuccessButNoResults (package:parse_server_sdk/src/objects/response/parse_response_utils.dart:56:5)
E/flutter (28704): #1 _ParseResponseBuilder.handleResponse (package:parse_server_sdk/src/objects/response/parse_response_builder.dart:22:16)
E/flutter (28704): #2 handleResponse (package:parse_server_sdk/src/objects/response/parse_response_utils.dart:8:31)
E/flutter (28704): #3 ParseUser._handleResponse (package:parse_server_sdk/src/objects/parse_user.dart:480:9)
E/flutter (28704): #4 ParseUser._loginWith (package:parse_server_sdk/src/objects/parse_user.dart:307:20)
E/flutter (28704):
E/flutter (28704): #5 ParseUser.loginWith (package:parse_server_sdk/src/objects/parse_user.dart:283:36)
E/flutter (28704):
E/flutter (28704): #6 LoginGoogle.call (package:data_transport/domain/usecases/auth/login_google.dart:8:17)
E/flutter (28704):
E/flutter (28704):