Skip to content

Commit

Permalink
6.0.0.0+pre2
Browse files Browse the repository at this point in the history
  • Loading branch information
escamoteur committed Jul 21, 2024
1 parent 938f3ec commit 506e2cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions lib/command_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ class CommandBuilder<TParam, TResult> 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);
},
);
},
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 506e2cc

Please sign in to comment.