check null safety
This commit is contained in:
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user