getUserInfo method Null safety

Future<JMUserInfo> getUserInfo(
  1. {@required String? username,
  2. String? appKey}
)

Implementation

Future<JMUserInfo> getUserInfo(
    {@required String? username, String? appKey}) async {
  Map userJson = await _channel.invokeMethod(
      'getUserInfo',
      {'username': username, 'appKey': appKey}
        ..removeWhere((key, value) => value == null));
  return JMUserInfo.fromJson(userJson);
}