diff --git a/lib/components/quick_action_component.dart b/lib/components/quick_action_component.dart index 43ee5ae..44b32ec 100644 --- a/lib/components/quick_action_component.dart +++ b/lib/components/quick_action_component.dart @@ -114,7 +114,8 @@ class QuickActionComponent extends StatelessWidget { ), const SizedBox(height: 12), ], - if (onTapSearch != null) + if (onTapSearch != null) ...[ + const SizedBox(height: 12), SizedBox( width: double.maxFinite, child: OutlineButtonComponent( @@ -124,6 +125,7 @@ class QuickActionComponent extends StatelessWidget { onPressed: onTapSearch, ), ), + ], ], ), ), diff --git a/lib/pages/operation/reception/reception_details_page.dart b/lib/pages/operation/reception/reception_details_page.dart index e5efaec..20a83fb 100644 --- a/lib/pages/operation/reception/reception_details_page.dart +++ b/lib/pages/operation/reception/reception_details_page.dart @@ -55,28 +55,23 @@ class _ReceptionDetailsPageState extends ConsumerState { const SizedBox(height: 16), if (reception?.isDone == false) ...[ QuickActionComponent( - onTapValidateReception: reception?.synchronized == false - ? () { - ref - .read( - receptionDetailsPageModelProvider - .notifier, - ) - .validate( - receptionId: widget.receptionId, - onSuccess: () { - Toast.showSuccess( - 'Réception validée avec succès.', - ); - }, - onError: () { - Toast.showError( - 'Connexion impossible. Les données seront synchronisées plus tard.', - ); - }, - ); - } - : null, + onTapValidateReception: () { + ref + .read(receptionDetailsPageModelProvider.notifier) + .validate( + receptionId: widget.receptionId, + onSuccess: () { + Toast.showSuccess( + 'Réception validée avec succès.', + ); + }, + onError: () { + Toast.showError( + 'Connexion impossible. Les données seront synchronisées plus tard.', + ); + }, + ); + }, validateReceptionLoading: state.validateLoading, syncReceptionLoading: state.saveLoading, onTapSyncReception: reception?.synchronized == false diff --git a/lib/pages/operation/reception/reception_page.dart b/lib/pages/operation/reception/reception_page.dart index bf49635..0849eac 100644 --- a/lib/pages/operation/reception/reception_page.dart +++ b/lib/pages/operation/reception/reception_page.dart @@ -48,11 +48,7 @@ class _ReceptionPageState extends ConsumerState { child: ListView( children: [ const SizedBox(height: 16), - QuickActionComponent( - onTapAdd: () {}, - onTapScan: () {}, - onTapSearch: () {}, - ), + QuickActionComponent(onTapSearch: () {}), const SizedBox(height: 16), Consumer( builder: (_, WidgetRef ref, _) {