add cartion filter and search

This commit is contained in:
tzw
2024-02-07 17:26:29 +06:30
parent 2d4cdb9620
commit caf20f4e67
39 changed files with 1274 additions and 1181 deletions

View File

@@ -1,5 +1,4 @@
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:fcs/domain/constants.dart';
import 'package:fcs/domain/entities/carton.dart';
@@ -40,18 +39,15 @@ class CartonDataProvider {
// var bytes = utf8.encode(term);
// var base64Str = base64.encode(bytes);
// HtmlEscape htmlEscape = const HtmlEscape();
// String escapeBuyer = htmlEscape.convert(base64Str);
// String escapeTerm = htmlEscape.convert(base64Str);
try {
String path = "/$cartons_collection";
var querySnap = await FirebaseFirestore.instance
.collection(path)
.where("carton_number", isEqualTo: term)
.where("carton_type",
whereIn: [carton_from_packages, carton_from_cartons])
.where("status", isEqualTo: carton_packed_status)
.where("is_deleted", isEqualTo: false)
.orderBy("user_name")
.orderBy("created_at",descending: true)
.get();
return querySnap.docs.map((e) => Carton.fromMap(e.data(), e.id)).toList();
} catch (e) {