diff --git a/CHANGELOG.md b/CHANGELOG.md index 8627af6..79bf8bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [4.0.0+1] +* docs: Update CHANGELOG.md + +## [4.0.0] +* refactor: Migrate to sound null safety + ## [3.0.5] * fix: cancel the use of `nullOk` attribute diff --git a/README.md b/README.md index ce7b89b..c231888 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,10 @@ Loading|Text|CustomWidget ### 🐮Getting started #### 1. add dependencies into you project pubspec.yaml file -``` dart +``` yaml dependencies: - bot_toast: ^3.0.5 + bot_toast: ^3.0.5 +# bot_toast: ^4.0.0 #null safety ``` #### 2. import BotToast lib diff --git a/README_zh.md b/README_zh.md index ec98932..ad238fa 100644 --- a/README_zh.md +++ b/README_zh.md @@ -53,9 +53,10 @@ Loading|Text|CustomWidget ### 🐮快速使用 #### 1. pubspec.yaml文件里添加依赖 -``` dart +``` yaml dependencies: - bot_toast: ^3.0.5 + bot_toast: ^3.0.5 +# bot_toast: ^4.0.0 #null safety ``` #### 2. 导入BotToast库 diff --git a/pubspec.yaml b/pubspec.yaml index 627ed93..84092f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A really easy to use flutter toast library.Easy to use and feature homepage: https://github.com/MMMzq/bot_toast email: vivask770@163.com -version: 3.0.5 +version: 4.0.0+1 environment: sdk: '>=2.12.0-0 <3.0.0' diff --git a/test/widget_test.dart b/test/widget_test.dart index 0e03972..f87545e 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -370,9 +370,9 @@ void main() { // ignore: must_be_immutable class TestApp extends StatelessWidget { - final VoidCallback callback; - final void Function(BuildContext ctx) contextCallback; - final Widget child; + final VoidCallback? callback; + final void Function(BuildContext ctx)? contextCallback; + final Widget? child; TestApp({this.callback, this.child, this.contextCallback}); @@ -391,17 +391,15 @@ class TestApp extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Builder( - builder: (ctx) => - FlatButton( - key: ValueKey('main'), - onPressed: () async { - callback?.call(); - contextCallback?.call(ctx); - }, - child: Text(''))), - child - ] - ..removeWhere((test) => test == null), + builder: (ctx) => FlatButton( + key: ValueKey('main'), + onPressed: () async { + callback?.call(); + contextCallback?.call(ctx); + }, + child: Text(''))), + if (child != null) child! + ], ), ), );