fromApi method Null safety

Future<TMAccount> fromApi(
  1. String address,
  2. String password,
  3. [String? token]
)

Retrieves an account from MailTm API

Implementation

static Future<TMAccount> fromApi(
  String address,
  String password, [
  String? token,
]) async {
  token ??= await getToken(address, password);
  var data = await Requests.get('/me', {'Authorization': 'Bearer $token'});
  return TMAccount._fromJson(data, password);
}