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

example能跑起来?

Open lh9403 opened this issue 3 years ago • 2 comments

自己的项目pub安装完导入使用就报错,example也跑不起来

lh9403 avatar May 19 '21 09:05 lh9403

##这个问题何解啊,自己的工程和demo都报类似的错误

../lib/jpush_flutter.dart:29:12: Error: The parameter 'appKey' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. String appKey,
^^^^^^
../lib/jpush_flutter.dart:30:10: Error: The parameter 'production' can't have a value of 'null' because of its type 'bool', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. bool production,
^^^^^^^^^^
../lib/jpush_flutter.dart:48:18: Error: The parameter 'onReceiveNotification' can't have a value of 'null' because of its type 'Future Function(Map<String, dynamic>)', but the implicit default value is 'null'.

  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    Try adding either an explicit non-'null' default value or the 'required' modifier. EventHandler onReceiveNotification,
    ^^^^^^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:49:18: Error: The parameter 'onOpenNotification' can't have a value of 'null' because of its type 'Future Function(Map<String, dynamic>)', but the implicit default value is 'null'.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    Try adding either an explicit non-'null' default value or the 'required' modifier. EventHandler onOpenNotification,
    ^^^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:50:18: Error: The parameter 'onReceiveMessage' can't have a value of 'null' because of its type 'Future Function(Map<String, dynamic>)', but the implicit default value is 'null'.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    Try adding either an explicit non-'null' default value or the 'required' modifier. EventHandler onReceiveMessage,
    ^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:51:18: Error: The parameter 'onReceiveNotificationAuthorization' can't have a value of 'null' because of its type 'Future Function(Map<String, dynamic>)', but the implicit default value is 'null'.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    Try adding either an explicit non-'null' default value or the 'required' modifier. EventHandler onReceiveNotificationAuthorization,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:242:41: Error: The parameter 'notificationId' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. void clearNotification({@required int notificationId}) {
    ^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:341:23: Error: The parameter 'id' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. {@required this.id,
    ^^
    ../lib/jpush_flutter.dart:342:22: Error: The parameter 'title' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. @required this.title,
    ^^^^^
    ../lib/jpush_flutter.dart:343:22: Error: The parameter 'content' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. @required this.content,
    ^^^^^^^
    ../lib/jpush_flutter.dart:344:22: Error: The parameter 'fireTime' can't have a value of 'null' because of its type 'DateTime', but the implicit default value is 'null'.
  • 'DateTime' is from 'dart:core'.
    Try adding either an explicit non-'null' default value or the 'required' modifier. @required this.fireTime,
    ^^^^^^^^
    ../lib/jpush_flutter.dart:345:12: Error: The parameter 'buildId' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. this.buildId,
    ^^^^^^^
    ../lib/jpush_flutter.dart:346:12: Error: The parameter 'extra' can't have a value of 'null' because of its type 'Map<String, String>', but the implicit default value is 'null'.
  • 'Map' is from 'dart:core'.
    Try adding either an explicit non-'null' default value or the 'required' modifier. this.extra,
    ^^^^^
    ../lib/jpush_flutter.dart:348:12: Error: The parameter 'soundName' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. this.soundName,
    ^^^^^^^^^
    ../lib/jpush_flutter.dart:349:12: Error: The parameter 'subtitle' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'. Try adding either an explicit non-'null' default value or the 'required' modifier. this.subtitle})
    ^^^^^^^^
    ../lib/jpush_flutter.dart:67:54: Error: A value of type 'Future' can't be returned from an async function with return type 'Future<Null>'.
  • 'Future' is from 'dart:async'.
    return _onReceiveNotification(call.arguments.cast<String, dynamic>()); ^
    ../lib/jpush_flutter.dart:69:51: Error: A value of type 'Future' can't be returned from an async function with return type 'Future<Null>'.
  • 'Future' is from 'dart:async'.
    return _onOpenNotification(call.arguments.cast<String, dynamic>()); ^
    ../lib/jpush_flutter.dart:71:49: Error: A value of type 'Future' can't be returned from an async function with return type 'Future<Null>'.
  • 'Future' is from 'dart:async'.
    return _onReceiveMessage(call.arguments.cast<String, dynamic>()); ^
    ../lib/jpush_flutter.dart:73:67: Error: A value of type 'Future' can't be returned from an async function with return type 'Future<Null>'.
  • 'Future' is from 'dart:async'.
    return _onReceiveNotificationAuthorization(call.arguments.cast<String, dynamic>()); ^
    ../lib/jpush_flutter.dart:23:16: Error: Field '_onReceiveNotification' should be initialized because its type 'Future Function(Map<String, dynamic>)' doesn't allow null.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    EventHandler _onReceiveNotification;
    ^^^^^^^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:24:16: Error: Field '_onOpenNotification' should be initialized because its type 'Future Function(Map<String, dynamic>)' doesn't allow null.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    EventHandler _onOpenNotification;
    ^^^^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:25:16: Error: Field '_onReceiveMessage' should be initialized because its type 'Future Function(Map<String, dynamic>)' doesn't allow null.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    EventHandler _onReceiveMessage;
    ^^^^^^^^^^^^^^^^^
    ../lib/jpush_flutter.dart:26:16: Error: Field '_onReceiveNotificationAuthorization' should be initialized because its type 'Future Function(Map<String, dynamic>)' doesn't allow null.
  • 'Future' is from 'dart:async'.
  • 'Map' is from 'dart:core'.
    EventHandler _onReceiveNotificationAuthorization;
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

busyboy1991 avatar May 20 '21 05:05 busyboy1991

2.0.9 修改了。

skill20 avatar May 24 '21 08:05 skill20