feat: Sorts receptions by name descending

Improves the display of receptions by sorting them alphabetically in reverse order based on their name. This ensures a consistent and organized view.

Includes a minor version increment.
This commit is contained in:
mandreshope 2025-08-06 12:07:35 +03:00
parent 35f76b919a
commit 5668f31cbe
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:e_scan/backend/api/api_calls.dart';
import 'package:e_scan/backend/objectbox/entities/stock_picking/stock_picking_record_entity.dart';
import 'package:e_scan/backend/objectbox/objectbox_manager.dart';
@ -96,6 +97,7 @@ class ReceptionPageModel extends StateNotifier<ReceptionPageState> {
final res = await ApiCalls.getAllStockPiking();
res.when(
(data) {
data.sort((a, b) => (b.name ?? '').compareTo((a.name ?? '')));
state = state.copyWith(receptions: data, loadingReceptions: false);
},
(error) {
@ -114,6 +116,7 @@ class ReceptionPageModel extends StateNotifier<ReceptionPageState> {
final res = await ApiCalls.getAllStockPiking();
res.when(
(data) {
data.sort((a, b) => (b.name ?? '').compareTo((a.name ?? '')));
state = state.copyWith(receptions: data, loadingReceptions: false);
},
(error) {

View File

@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.3.0+9
version: 0.4.0+10
environment:
sdk: ^3.8.1