add cartion filter and search
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user