Reputation: 8599
When using
to access Google Api's thru Flutter using this code
import 'dart:convert';
import 'dart:io';
import 'package:googleapis_auth/auth.dart';
import 'package:googleapis_auth/auth_browser.dart';
import 'package:googleapis_auth/auth_io.dart';
import 'package:googleapis/androidpublisher/v3.dart';
Future main() async {
dynamic jsonData = json.decode(
await File('api-xxxxxxxxxxxxxxxxxxxx.json')
.readAsString());
var scopes = [AndroidpublisherApi.AndroidpublisherScope];
final accountCredentials = new ServiceAccountCredentials.fromJson(jsonData);
AuthClient client = await clientViaServiceAccount(accountCredentials, scopes);
}
you will get this error
Error: Not found: 'dart:html' import 'dart:html' as html;
Upvotes: 2
Views: 6072
Reputation: 8599
Can Flutter run any Dart code?
Flutter should be able to run most Dart code that does not import (transitively, or directly) dart:mirrors or dart:html.
Look like you are using a package
which depends on 'dart:html'
which is not supported in Flutter
remove
import 'package:googleapis_auth/auth_browser.dart';
Upvotes: 9