From 506e2cc14dbaf4f4531435759ed8eba5ee0bf322 Mon Sep 17 00:00:00 2001 From: Thomas Burkhart Date: Sun, 21 Jul 2024 12:04:09 +0100 Subject: [PATCH] 6.0.0.0+pre2 --- CHANGELOG.md | 2 ++ lib/command_builder.dart | 6 ++++-- pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95131d4..4d09cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +[6.0.0+pre2] +* fixing asssert in CommandBuilder [6.0.0+pre1] * breaking changes: Command.debugName -> Command.name, ErrorReaction.defaultHandler -> ErrorReaction.defaulErrorFilter * unless an error filter returns none or throwException all errors will be published on the `resultsProperty` including diff --git a/lib/command_builder.dart b/lib/command_builder.dart index 5260d30..d90034d 100644 --- a/lib/command_builder.dart +++ b/lib/command_builder.dart @@ -41,12 +41,14 @@ class CommandBuilder extends StatelessWidget { whileExecuting?.call(context, lastData, paramData) ?? const SizedBox(), onError: (lastData, error, paramData) { + if (onError == null) { + return const SizedBox(); + } assert( result.errorReaction?.shouldCallLocalHandler == true, 'This CommandBuilder received an error from Command ${command.name} ' 'but the errorReaction indidates that the error should not be handled locally. '); - return onError?.call(context, lastData, error, paramData) ?? - const SizedBox(); + return onError!.call(context, lastData, error, paramData); }, ); }, diff --git a/pubspec.yaml b/pubspec.yaml index 3d73686..920a21c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_command description: flutter_command is a way to manage your state based on `ValueListenable` and the `Command` design pattern. -version: 6.0.0+pre1 +version: 6.0.0+pre2 homepage: https://github.com/escamoteur/flutter_command environment: