mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 09:17:37 +00:00
Add deviceName field to FailedOperation and SuccessOperation models (#295)
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Description <!--- Describe your changes in detail --> Add deviceName field to FailedOperation and SuccessOperation models ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) - [x] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [ ] 🗑️ Chore
This commit is contained in:
@ -2,11 +2,13 @@ class FailedOperation {
|
|||||||
final bool success;
|
final bool success;
|
||||||
final dynamic deviceUuid;
|
final dynamic deviceUuid;
|
||||||
final dynamic error;
|
final dynamic error;
|
||||||
|
final String deviceName;
|
||||||
|
|
||||||
FailedOperation({
|
FailedOperation({
|
||||||
required this.success,
|
required this.success,
|
||||||
required this.deviceUuid,
|
required this.deviceUuid,
|
||||||
required this.error,
|
required this.error,
|
||||||
|
required this.deviceName,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory FailedOperation.fromJson(Map<String, dynamic> json) {
|
factory FailedOperation.fromJson(Map<String, dynamic> json) {
|
||||||
@ -14,6 +16,7 @@ class FailedOperation {
|
|||||||
success: json['success'],
|
success: json['success'],
|
||||||
deviceUuid: json['deviceUuid'],
|
deviceUuid: json['deviceUuid'],
|
||||||
error: json['error'],
|
error: json['error'],
|
||||||
|
deviceName: json['deviceName'] as String? ?? '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,21 +25,22 @@ class FailedOperation {
|
|||||||
'success': success,
|
'success': success,
|
||||||
'deviceUuid': deviceUuid,
|
'deviceUuid': deviceUuid,
|
||||||
'error': error,
|
'error': error,
|
||||||
|
'deviceName': deviceName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SuccessOperation {
|
class SuccessOperation {
|
||||||
final bool success;
|
final bool success;
|
||||||
// final Result result;
|
// final Result result;
|
||||||
final String deviceUuid;
|
final String deviceUuid;
|
||||||
|
final String deviceName;
|
||||||
|
|
||||||
SuccessOperation({
|
SuccessOperation({
|
||||||
required this.success,
|
required this.success,
|
||||||
// required this.result,
|
// required this.result,
|
||||||
required this.deviceUuid,
|
required this.deviceUuid,
|
||||||
|
required this.deviceName,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory SuccessOperation.fromJson(Map<String, dynamic> json) {
|
factory SuccessOperation.fromJson(Map<String, dynamic> json) {
|
||||||
@ -44,6 +48,7 @@ class SuccessOperation {
|
|||||||
success: json['success'],
|
success: json['success'],
|
||||||
// result: Result.fromJson(json['result']),
|
// result: Result.fromJson(json['result']),
|
||||||
deviceUuid: json['deviceUuid'],
|
deviceUuid: json['deviceUuid'],
|
||||||
|
deviceName: json['deviceName'] as String? ?? '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +57,7 @@ class SuccessOperation {
|
|||||||
'success': success,
|
'success': success,
|
||||||
// 'result': result.toJson(),
|
// 'result': result.toJson(),
|
||||||
'deviceUuid': deviceUuid,
|
'deviceUuid': deviceUuid,
|
||||||
|
'deviceName': deviceName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,8 +98,6 @@ class SuccessOperation {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PasswordStatus {
|
class PasswordStatus {
|
||||||
final List<SuccessOperation> successOperations;
|
final List<SuccessOperation> successOperations;
|
||||||
final List<FailedOperation> failedOperations;
|
final List<FailedOperation> failedOperations;
|
||||||
@ -121,4 +125,3 @@ class PasswordStatus {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
|||||||
child: Text(visitorBloc
|
child: Text(visitorBloc
|
||||||
.passwordStatus!
|
.passwordStatus!
|
||||||
.failedOperations[index]
|
.failedOperations[index]
|
||||||
.deviceUuid)),
|
.deviceName)),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -92,7 +92,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
|||||||
child: Text(visitorBloc
|
child: Text(visitorBloc
|
||||||
.passwordStatus!
|
.passwordStatus!
|
||||||
.successOperations[index]
|
.successOperations[index]
|
||||||
.deviceUuid)),
|
.deviceName)),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user