mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-26 04:07:56 +00:00
push factory reset logic and call for all devices
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class FactoryResetModel {
|
||||
final List<String> devicesUuid;
|
||||
|
||||
FactoryResetModel({
|
||||
required this.devicesUuid,
|
||||
});
|
||||
|
||||
factory FactoryResetModel.fromJson(Map<String, dynamic> json) {
|
||||
return FactoryResetModel(
|
||||
devicesUuid: List<String>.from(json['devicesUuid']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'devicesUuid': devicesUuid,
|
||||
};
|
||||
}
|
||||
|
||||
FactoryResetModel copyWith({
|
||||
List<String>? devicesUuid,
|
||||
}) {
|
||||
return FactoryResetModel(
|
||||
devicesUuid: devicesUuid ?? this.devicesUuid,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'devicesUuid': devicesUuid,
|
||||
};
|
||||
}
|
||||
|
||||
factory FactoryResetModel.fromMap(Map<String, dynamic> map) {
|
||||
return FactoryResetModel(
|
||||
devicesUuid: List<String>.from(map['devicesUuid']),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'FactoryReset(devicesUuid: $devicesUuid)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is FactoryResetModel &&
|
||||
listEquals(other.devicesUuid, devicesUuid);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => devicesUuid.hashCode;
|
||||
}
|
||||
Reference in New Issue
Block a user