transferAlias method Null safety

Future<MsgTransferAliasResponse?> transferAlias(
  1. String alias,
  2. String recipient,
  3. int amount,
  4. [ResponseCallback<MsgTransferAliasResponse>? callback]
)

transferAlias is a function that takes a String called alias, a String called recipient, an int called amount, and an optional ResponseCallback<MsgTransferAliasResponse> called callback and returns a Future<void>

Args: alias (String): The alias of the account to transfer from recipient (String): The address of the recipient. amount (int): The amount of coins to transfer. callback (ResponseCallback): A callback function that will be called when the response is received.

Implementation

Future<MsgTransferAliasResponse?> transferAlias(String alias, String recipient, int amount,
    [ResponseCallback<MsgTransferAliasResponse>? callback]) async {
  final resp = await MotorFlutterPlatform.instance.transferAlias(MsgTransferAlias(
    alias: alias,
    amount: amount,
    recipient: recipient,
    creator: address.value,
  ));
  if (callback != null) {
    callback(resp);
  }
  if (resp != null) {
    domain.value = alias;
  }
  return resp;
}