Skip to content

Commit

Permalink
fixing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
escamoteur committed Dec 25, 2024
1 parent 9d7b276 commit 06be833
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/command_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ class CommandBuilder<TParam, TResult> extends StatelessWidget {
valueListenable: command.results,
builder: (context, result, _) {
return result.toWidget(
onSuccess: (paramData) =>
onSuccess?.call(context, paramData) ?? const SizedBox(),
onData: (data, paramData) =>
onData?.call(context, data, paramData) ?? const SizedBox(),
onNullData: (paramData) =>
onNullData?.call(context, paramData) ?? const SizedBox(),
whileExecuting: (lastData, paramData) =>
whileExecuting?.call(context, lastData, paramData) ??
const SizedBox(),
onData: onData != null
? (data, paramData) => onData!.call(context, data, paramData)
: null,
onNullData: onNullData != null
? (paramData) => onNullData!.call(context, paramData)
: null,
whileExecuting: whileExecuting != null
? (lastData, paramData) =>
whileExecuting!.call(context, lastData, paramData)
: null,
onError: (lastData, error, paramData) {
if (onError == null) {
return const SizedBox();
Expand Down

0 comments on commit 06be833

Please sign in to comment.