null safety

This commit is contained in:
phyothandar
2021-09-10 12:00:08 +06:30
parent a144c945b6
commit 5e672937b5
67 changed files with 901 additions and 896 deletions

View File

@@ -1,17 +1,17 @@
class CargoType {
String id;
String name;
double rate;
double weight;
bool isChecked;
int qty;
bool isCutomDuty;
double customDutyFee;
String? id;
String? name;
double? rate;
double? weight;
bool? isChecked;
int? qty;
bool? isCutomDuty;
double? customDutyFee;
double get calAmount => (calRate ?? 0) * (calWeight ?? 0);
double calRate;
double calWeight;
double? calRate;
double? calWeight;
CargoType(
{this.id,
this.name,
@@ -52,7 +52,7 @@ class CargoType {
}
CargoType clone() {
return CargoType.fromMap(toMap(), this.id);
return CargoType.fromMap(toMap(), this.id!);
}
@override
@@ -63,7 +63,7 @@ class CargoType {
@override
String toString() {
return name;
return name!;
}
bool isChangedForEdit(CargoType cargoType) {