fromFile static method

Future<DialogAuthCredentials> fromFile(
  1. String path
)

Creates the auth credentials from the file in the given path

Implementation

static Future<DialogAuthCredentials> fromFile(String path) async {
  try {
    String data = await rootBundle.loadString(path);
    Map<String, dynamic> json = jsonDecode(data);
    return DialogAuthCredentials.fromJson(json);
    // ignore: avoid_catches_without_on_clauses
  } catch (e) {
    throw Exception(
      '$path file not found. '
      'Remember to add the file to your pubspec.yaml',
    );
  }
}