check null safety

This commit is contained in:
tzw
2021-09-10 14:27:38 +06:30
parent a144c945b6
commit 7670779b03
57 changed files with 620 additions and 626 deletions

View File

@@ -1,10 +1,11 @@
class CartonSize {
String id;
String name;
String? id;
String? name;
double length;
double width;
double height;
CartonSize({this.id, this.name, this.length, this.width, this.height});
CartonSize(
{this.id, this.name, this.length = 0, this.width = 0, this.height = 0});
Map<String, dynamic> toMap() {
return {
@@ -27,19 +28,10 @@ class CartonSize {
}
@override
bool operator ==(other) {
if (identical(this, other)) {
return true;
}
return other.id == this.id;
}
bool operator ==(Object other) => other is CartonSize && other.id == id;
@override
int get hashCode {
int result = 17;
result = 37 * result + id.hashCode;
return result;
}
int get hashCode => id.hashCode;
bool isChangedForEdit(CartonSize cartonSize) {
return cartonSize.name != this.name ||