mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Add deviceName field to FailedOperation and SuccessOperation models
This commit is contained in:
@ -2,11 +2,13 @@ class FailedOperation {
|
||||
final bool success;
|
||||
final dynamic deviceUuid;
|
||||
final dynamic error;
|
||||
final String deviceName;
|
||||
|
||||
FailedOperation({
|
||||
required this.success,
|
||||
required this.deviceUuid,
|
||||
required this.error,
|
||||
required this.deviceName,
|
||||
});
|
||||
|
||||
factory FailedOperation.fromJson(Map<String, dynamic> json) {
|
||||
@ -14,6 +16,7 @@ class FailedOperation {
|
||||
success: json['success'],
|
||||
deviceUuid: json['deviceUuid'],
|
||||
error: json['error'],
|
||||
deviceName: json['deviceName'] as String? ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
@ -22,21 +25,22 @@ class FailedOperation {
|
||||
'success': success,
|
||||
'deviceUuid': deviceUuid,
|
||||
'error': error,
|
||||
'deviceName': deviceName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class SuccessOperation {
|
||||
final bool success;
|
||||
// final Result result;
|
||||
final String deviceUuid;
|
||||
final String deviceName;
|
||||
|
||||
SuccessOperation({
|
||||
required this.success,
|
||||
// required this.result,
|
||||
required this.deviceUuid,
|
||||
required this.deviceName,
|
||||
});
|
||||
|
||||
factory SuccessOperation.fromJson(Map<String, dynamic> json) {
|
||||
@ -44,6 +48,7 @@ class SuccessOperation {
|
||||
success: json['success'],
|
||||
// result: Result.fromJson(json['result']),
|
||||
deviceUuid: json['deviceUuid'],
|
||||
deviceName: json['deviceName'] as String? ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
@ -52,6 +57,7 @@ class SuccessOperation {
|
||||
'success': success,
|
||||
// 'result': result.toJson(),
|
||||
'deviceUuid': deviceUuid,
|
||||
'deviceName': deviceName,
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -92,8 +98,6 @@ class SuccessOperation {
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
class PasswordStatus {
|
||||
final List<SuccessOperation> successOperations;
|
||||
final List<FailedOperation> failedOperations;
|
||||
@ -121,4 +125,3 @@ class PasswordStatus {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
child: Text(visitorBloc
|
||||
.passwordStatus!
|
||||
.failedOperations[index]
|
||||
.deviceUuid)),
|
||||
.deviceName)),
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -92,7 +92,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
child: Text(visitorBloc
|
||||
.passwordStatus!
|
||||
.successOperations[index]
|
||||
.deviceUuid)),
|
||||
.deviceName)),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user