jmessage-flutter-plugin icon indicating copy to clipboard operation
jmessage-flutter-plugin copied to clipboard

未适配flutter2.0的null safe

Open fcloud89 opened this issue 4 years ago • 2 comments

yaml文件中的dart sdk要求大于2.12.0 但lib中的dart文件未适配null safe 该插件暂时无法使用 @skill20 @raoxudong

fcloud89 avatar May 21 '21 01:05 fcloud89

2.1.2 已适配

skill20 avatar May 26 '21 07:05 skill20

@skill20 登录抛异常,未适配

  Future<JMUserInfo?> login({
    @required String? username,
    @required String? password,
  }) async {
    if (username == null || password == null) {
      throw ("username or password was passed null");
    }
    print("Action - login: username=$username,pw=$password");

    // line: 446
    Map userJson = await _channel
        .invokeMethod('login', {'username': username, 'password': password});
    if (userJson == null) {
      return null;
    } else {
      return JMUserInfo.fromJson(userJson);
    }
  }

exception = {_TypeError} type 'Null' is not a subtype of type 'Map<dynamic, dynamic>' _stackTrace = null _url = "package:jmessage_flutter/jmessage_flutter.dart" _line = 446 _column = 9 _message = "type 'Null' is not a subtype of type 'Map<dynamic, dynamic>'"

jing-pei avatar Jul 04 '21 03:07 jing-pei