Added smart door bloc

This commit is contained in:
Abdullah Alassaf
2024-05-23 02:45:31 +03:00
parent 44b08c482d
commit 0eea5242e1
11 changed files with 291 additions and 291 deletions
@@ -1,7 +1,7 @@
import 'package:syncrow_app/features/devices/model/status_model.dart';
class SmartDoorModel {
String unlockFingerprint;
int unlockFingerprint;
int unlockPassword;
int unlockTemporary;
int unlockCard;
@@ -39,7 +39,7 @@ class SmartDoorModel {
required this.normalOpenSwitch});
factory SmartDoorModel.fromJson(List<StatusModel> jsonList) {
late String _unlockFingerprint;
late int _unlockFingerprint;
late int _unlockPassword;
late int _unlockTemporary;
late int _unlockCard;
@@ -59,7 +59,7 @@ class SmartDoorModel {
for (int i = 0; i < jsonList.length; i++) {
if (jsonList[i].code == 'unlock_fingerprint') {
_unlockFingerprint = jsonList[i].value ?? '';
_unlockFingerprint = jsonList[i].value ?? 0;
} else if (jsonList[i].code == 'unlock_password') {
_unlockPassword = jsonList[i].value ?? 0;
} else if (jsonList[i].code == 'unlock_temporary') {