init method

  1. @override
Future<String?> init(
  1. Config config
)
override

Implementation

@override
Future<String?> init(Config config) async {
  final Auth auth = await authenticate(config);
  SharedPreferences prefs = await SharedPreferences.getInstance();
  if (auth.token != null) {
    await prefs.setString('gol_token', auth.token ?? "");
  }
  CONFIG = config;
  CONFIG!.token = auth.token;
  return auth.token;
}