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:
mohammadnemer1
2025-06-25 16:12:42 +03:00
committed by GitHub
2 changed files with 10 additions and 7 deletions

View File

@ -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 {
};
}
}

View File

@ -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)),
);
},
),