
Introduces the ability to validate a stock reception by sending updated move line quantities to the backend. This includes: - Adding a new API call to update stock picking move lines. - Integrating a "Validate Reception" button within the quick actions component on the reception details page. - Implementing the logic to gather move line data and call the new API endpoint. - Enhancing error messages on the scan page for products not expected in the current reception. - Improving type safety for API response data.
65 lines
1.8 KiB
Dart
65 lines
1.8 KiB
Dart
import 'package:e_scan/themes/app_theme.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class MainAppbarComponent extends StatelessWidget
|
|
implements PreferredSizeWidget {
|
|
const MainAppbarComponent({
|
|
super.key,
|
|
this.title,
|
|
this.subTitle,
|
|
this.scaffoledKey,
|
|
this.leading,
|
|
this.actions,
|
|
});
|
|
final GlobalKey<ScaffoldState>? scaffoledKey;
|
|
final String? title;
|
|
final String? subTitle;
|
|
final Widget? leading;
|
|
final List<Widget>? actions;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBar(
|
|
leading:
|
|
leading ??
|
|
IconButton(
|
|
icon: Icon(Icons.menu, color: AppTheme.of(context).white),
|
|
onPressed: () {
|
|
scaffoledKey?.currentState?.openDrawer();
|
|
},
|
|
),
|
|
title: title == null || subTitle == null
|
|
? null
|
|
: Row(
|
|
children: [
|
|
Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title ?? '',
|
|
style: AppTheme.of(
|
|
context,
|
|
).titleMedium.copyWith(color: AppTheme.of(context).white),
|
|
),
|
|
Text(
|
|
subTitle ?? '',
|
|
style: AppTheme.of(
|
|
context,
|
|
).bodyMedium.copyWith(color: AppTheme.of(context).white),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
actions: actions,
|
|
toolbarHeight: 60,
|
|
backgroundColor: AppTheme.of(context).primary,
|
|
elevation: 4,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => Size.fromHeight(kToolbarHeight);
|
|
}
|