cleanup code
This commit is contained in:
@@ -35,7 +35,7 @@ class CartonDataProvider {
|
||||
}
|
||||
|
||||
Future<List<Carton>> searchCarton(String term) async {
|
||||
if (term == null || term == '') return [];
|
||||
if (term == '') return [];
|
||||
|
||||
// var bytes = utf8.encode(term);
|
||||
// var base64Str = base64.encode(bytes);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
|
||||
@@ -59,7 +59,6 @@ class MessagingFCM {
|
||||
}
|
||||
|
||||
_onNotify(Map<String, dynamic> message, OnNotify onNotify) {
|
||||
var data = message['data'] ?? message;
|
||||
onNotify(Map<String, dynamic>.from(message));
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class PackageDataProvider {
|
||||
}
|
||||
|
||||
Future<List<Package>?> ftsSearchPackage(String term) async {
|
||||
if (term == null || term == '') return [];
|
||||
if (term == '') return [];
|
||||
|
||||
var bytes = utf8.encode(term);
|
||||
var base64Str = base64.encode(bytes);
|
||||
@@ -86,8 +86,7 @@ class PackageDataProvider {
|
||||
}
|
||||
|
||||
Future<List<Package>> searchPackage(String term) async {
|
||||
if (term == null || term == '') return [];
|
||||
|
||||
if (term == '') return [];
|
||||
List<Package> packages = [];
|
||||
|
||||
try {
|
||||
|
||||
@@ -18,7 +18,7 @@ class PickupDataProvider {
|
||||
}
|
||||
|
||||
Future<List<Pickup>> searchPickup(String term) async {
|
||||
if (term == null || term == '') return [];
|
||||
if (term == '') return [];
|
||||
|
||||
List<Pickup> pickups = [];
|
||||
|
||||
|
||||
@@ -86,10 +86,10 @@ class RateDataProvider {
|
||||
}
|
||||
}
|
||||
|
||||
late StreamSubscription<Rate> rateListener;
|
||||
late StreamSubscription<List<CargoType>> cargoListener;
|
||||
late StreamSubscription<List<CargoType>> customListener;
|
||||
late StreamSubscription<List<DiscountByWeight>> discountListener;
|
||||
late StreamSubscription<Rate>? rateListener;
|
||||
late StreamSubscription<List<CargoType>>? cargoListener;
|
||||
late StreamSubscription<List<CargoType>>? customListener;
|
||||
late StreamSubscription<List<DiscountByWeight>>? discountListener;
|
||||
Stream<Rate> rate() {
|
||||
Future<void> _start() async {
|
||||
rateListener = _rateStream().listen((rate) {
|
||||
@@ -115,18 +115,10 @@ class RateDataProvider {
|
||||
}
|
||||
|
||||
void _stop() {
|
||||
if (rateListener != null) {
|
||||
rateListener.cancel();
|
||||
}
|
||||
if (cargoListener != null) {
|
||||
cargoListener.cancel();
|
||||
}
|
||||
if (customListener != null) {
|
||||
customListener.cancel();
|
||||
}
|
||||
if (discountListener != null) {
|
||||
discountListener.cancel();
|
||||
}
|
||||
rateListener?.cancel();
|
||||
cargoListener?.cancel();
|
||||
customListener?.cancel();
|
||||
discountListener?.cancel();
|
||||
}
|
||||
|
||||
controller = StreamController<Rate>(
|
||||
|
||||
@@ -53,7 +53,7 @@ class UserDataProvider {
|
||||
}
|
||||
|
||||
Future<List<User>> searchUser(String term) async {
|
||||
if (term == null || term == '') return [];
|
||||
if (term == '') return [];
|
||||
|
||||
var bytes = utf8.encode(term);
|
||||
var base64Str = base64.encode(bytes);
|
||||
|
||||
Reference in New Issue
Block a user