refactor: Refines reception validation and quick actions
Allows reception validation regardless of its synchronization status, enabling more flexible use cases. Simplifies the quick actions available on the reception list page by removing the 'Add' and 'Scan' buttons, retaining only the 'Search' option. Adds vertical spacing before the search button within the QuickActionComponent for improved visual layout.
This commit is contained in:
parent
a9d0e4485d
commit
ba1d7a6264
@ -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(
|
||||
@ -125,6 +126,7 @@ class QuickActionComponent extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -55,13 +55,9 @@ class _ReceptionDetailsPageState extends ConsumerState<ReceptionDetailsPage> {
|
||||
const SizedBox(height: 16),
|
||||
if (reception?.isDone == false) ...[
|
||||
QuickActionComponent(
|
||||
onTapValidateReception: reception?.synchronized == false
|
||||
? () {
|
||||
onTapValidateReception: () {
|
||||
ref
|
||||
.read(
|
||||
receptionDetailsPageModelProvider
|
||||
.notifier,
|
||||
)
|
||||
.read(receptionDetailsPageModelProvider.notifier)
|
||||
.validate(
|
||||
receptionId: widget.receptionId,
|
||||
onSuccess: () {
|
||||
@ -75,8 +71,7 @@ class _ReceptionDetailsPageState extends ConsumerState<ReceptionDetailsPage> {
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
},
|
||||
validateReceptionLoading: state.validateLoading,
|
||||
syncReceptionLoading: state.saveLoading,
|
||||
onTapSyncReception: reception?.synchronized == false
|
||||
|
@ -48,11 +48,7 @@ class _ReceptionPageState extends ConsumerState<ReceptionPage> {
|
||||
child: ListView(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
QuickActionComponent(
|
||||
onTapAdd: () {},
|
||||
onTapScan: () {},
|
||||
onTapSearch: () {},
|
||||
),
|
||||
QuickActionComponent(onTapSearch: () {}),
|
||||
const SizedBox(height: 16),
|
||||
Consumer(
|
||||
builder: (_, WidgetRef ref, _) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user