mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
delete dynamic password
This commit is contained in:
@ -212,28 +212,28 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: size.width * 0.12,
|
||||
child: RadioListTile<String>(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(
|
||||
'Dynamic Password',
|
||||
style: text,
|
||||
),
|
||||
value: 'Dynamic Password',
|
||||
groupValue: (state is PasswordTypeSelected)
|
||||
? state.selectedType
|
||||
: visitorBloc.accessTypeSelected,
|
||||
onChanged: (String? value) {
|
||||
if (value != null) {
|
||||
context
|
||||
.read<VisitorPasswordBloc>()
|
||||
.add(SelectPasswordType(value));
|
||||
visitorBloc.usageFrequencySelected = '';
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// width: size.width * 0.12,
|
||||
// child: RadioListTile<String>(
|
||||
// contentPadding: EdgeInsets.zero,
|
||||
// title: Text(
|
||||
// 'Dynamic Password',
|
||||
// style: text,
|
||||
// ),
|
||||
// value: 'Dynamic Password',
|
||||
// groupValue: (state is PasswordTypeSelected)
|
||||
// ? state.selectedType
|
||||
// : visitorBloc.accessTypeSelected,
|
||||
// onChanged: (String? value) {
|
||||
// if (value != null) {
|
||||
// context
|
||||
// .read<VisitorPasswordBloc>()
|
||||
// .add(SelectPasswordType(value));
|
||||
// visitorBloc.usageFrequencySelected = '';
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
const Spacer(
|
||||
@ -257,14 +257,14 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 9),
|
||||
),
|
||||
if (visitorBloc.accessTypeSelected == 'Dynamic Password')
|
||||
Text(
|
||||
'Quick and short-acting password, only valid within 5 minutes after creation, the system randomly generates a digital password.',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.grayColor,
|
||||
fontSize: 9),
|
||||
),
|
||||
// if (visitorBloc.accessTypeSelected == 'Dynamic Password')
|
||||
// Text(
|
||||
// 'Quick and short-acting password, only valid within 5 minutes after creation, the system randomly generates a digital password.',
|
||||
// style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
// fontWeight: FontWeight.w400,
|
||||
// color: ColorsManager.grayColor,
|
||||
// fontSize: 9),
|
||||
// ),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
@ -524,9 +524,20 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
if (visitorBloc.usageFrequencySelected == 'One-Time' &&
|
||||
visitorBloc.accessTypeSelected == 'Offline Password') {
|
||||
setPasswordFunction(context, size, visitorBloc);
|
||||
} else if (visitorBloc.accessTypeSelected == 'Dynamic Password') {
|
||||
} else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Offline Password') {
|
||||
if (visitorBloc.expirationTime != 'End Time' &&
|
||||
visitorBloc.effectiveTime != 'Start Time' ) {
|
||||
setPasswordFunction(context, size, visitorBloc);
|
||||
} else if(visitorBloc.endTimeAccess.toString()!='End Time'&&visitorBloc.startTimeAccess.toString()!='Start Time') {
|
||||
}else{
|
||||
visitorBloc.stateDialog(
|
||||
context: context,
|
||||
message: 'Please select Access Period to continue',
|
||||
title: 'Access Period');
|
||||
}
|
||||
} else if(
|
||||
visitorBloc.endTimeAccess.toString()!='End Time'
|
||||
&&visitorBloc.startTimeAccess.toString()!='Start Time') {
|
||||
if (visitorBloc.effectiveTimeTimeStamp != null &&
|
||||
visitorBloc.expirationTimeTimeStamp != null) {
|
||||
if (isRepeat == true) {
|
||||
@ -724,8 +735,6 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
borderRadius: 8,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
if (visitorBloc.accessTypeSelected == 'Dynamic Password') {
|
||||
} else {
|
||||
if (visitorBloc.usageFrequencySelected == 'One-Time' &&
|
||||
visitorBloc.accessTypeSelected == 'Online Password') {
|
||||
visitorBloc.add(OnlineOneTimePasswordEvent(
|
||||
@ -733,7 +742,8 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
email: visitorBloc.emailController.text,
|
||||
));
|
||||
} else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
}
|
||||
else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Online Password') {
|
||||
visitorBloc.add(OnlineMultipleTimePasswordEvent(
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
@ -741,14 +751,16 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
effectiveTime: visitorBloc.effectiveTimeTimeStamp.toString(),
|
||||
invalidTime: visitorBloc.expirationTimeTimeStamp.toString(),
|
||||
));
|
||||
} else if (visitorBloc.usageFrequencySelected == 'One-Time' &&
|
||||
}
|
||||
else if (visitorBloc.usageFrequencySelected == 'One-Time' &&
|
||||
visitorBloc.accessTypeSelected == 'Offline Password') {
|
||||
visitorBloc.add(OfflineOneTimePasswordEvent(
|
||||
context: context,
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
email: visitorBloc.emailController.text,
|
||||
));
|
||||
} else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
}
|
||||
else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Offline Password') {
|
||||
visitorBloc.add(OfflineMultipleTimePasswordEvent(
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
@ -757,7 +769,6 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
invalidTime: visitorBloc.expirationTimeTimeStamp.toString(),
|
||||
));
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Ok',
|
||||
|
Reference in New Issue
Block a user