createAccount method Null safety

dynamic createAccount(
  1. {required String password}
)

Implementation

createAccount({required String password}) async {
  // Set status to loading
  change(null, status: RxStatus.loading());
  _stopwatch.start();
  Timer.periodic(const Duration(milliseconds: 125), _handleTimer);

  // Create account
  try {
    final res = await MotorFlutter.to.createAccount(password);
    // Set account address
    _closeTimer();
    change(res, status: RxStatus.success());
  } catch (e) {
    _closeTimer();
    change(null, status: RxStatus.error("Internal Error - Failed to create account"));
    return;
  }
}