
Integrates the `toastification` package to provide clear and non-intrusive user feedback for operations like product not found. Refactors the reception scan page UI by extracting reusable widgets for the scan information text, the scan box, and the flash button. This improves code organization and readability. Switches the data source for reception details from API calls to the local ObjectBox database, improving performance and enabling offline access for this specific data. Corrects the display of scanned product information to show the barcode instead of a generic ID. Updates `go_router` to version 16.0.0.
25 lines
683 B
Dart
25 lines
683 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:toastification/toastification.dart';
|
|
|
|
class Toast {
|
|
static void showError(String message) {
|
|
toastification.show(
|
|
type: ToastificationType.error,
|
|
description: Text(message),
|
|
style: ToastificationStyle.flatColored,
|
|
alignment: Alignment.bottomCenter,
|
|
autoCloseDuration: Duration(seconds: 5),
|
|
);
|
|
}
|
|
|
|
static void showSuccess(String message) {
|
|
toastification.show(
|
|
type: ToastificationType.success,
|
|
description: Text(message),
|
|
style: ToastificationStyle.flatColored,
|
|
alignment: Alignment.bottomCenter,
|
|
autoCloseDuration: Duration(seconds: 5),
|
|
);
|
|
}
|
|
}
|