sellAlias method Null safety

Future<MsgSellAliasResponse?> sellAlias(
  1. String alias,
  2. int amount,
  3. [ResponseCallback<MsgSellAliasResponse>? callback]
)

sellAlias is a function that takes a String and an int and returns a Future<MsgSellAliasResponse>

Args: alias (String): The alias to sell amount (int): The amount of coins to sell the alias for. callback (ResponseCallback): A function that will be called when the response is received.

Implementation

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