password expired.

This commit is contained in:
mohammad
2024-08-21 09:22:31 +03:00
parent bb959bcc61
commit 50ef283b52
7 changed files with 26 additions and 15 deletions

View File

@ -133,7 +133,7 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
// Check if the password name should be used for filtering
if (event.passwordName != null && event.passwordName!.isNotEmpty) {
final bool matchesName = item.passwodName != null &&
item.passwodName.contains(event.passwordName!);
item.passwodName.contains(event.passwordName);
if (!matchesName) {
matchesCriteria = false;
}

View File

@ -151,7 +151,7 @@ class AccessManagementPage extends StatelessWidget {
child: DefaultButton(
onPressed: () {
accessBloc.add(FilterDataEvent(
passwordName: accessBloc.passwordName.text,
passwordName: accessBloc.passwordName.text.toLowerCase(),
startTime: accessBloc.effectiveTimeTimeStamp,
endTime: accessBloc.expirationTimeTimeStamp
));

View File

@ -85,6 +85,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
} else if (response == "You entered wrong otp") {
forgetValidate = 'Wrong one time password.';
emit(AuthInitialState());
}else if (response == "OTP expired") {
forgetValidate = 'One time password has been expired.';
emit(AuthInitialState());
}
} catch (failure) {
// forgetValidate='Invalid Credentials!';
@ -92,7 +95,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
// emit(FailureForgetState(error: failure.toString()));
}
}
//925207
String? validateCode(String? value) {
if (value == null || value.isEmpty) {
return 'Code is required';

View File

@ -25,7 +25,11 @@ class AddDeviceDialog extends StatelessWidget {
final visitorBloc = BlocProvider.of<VisitorPasswordBloc>(context);
return AlertDialog(
backgroundColor: Colors.white,
title: const Text('Add Accessible Device'),
title: Text('Add Accessible Device',
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
fontWeight: FontWeight.w400,
fontSize: 24,
color: Colors.black),),
content: Container(
height: MediaQuery.of(context).size.height/1.7,
width: MediaQuery.of(context).size.width/2,

View File

@ -17,7 +17,7 @@ class RepeatWidget extends StatelessWidget {
return BlocBuilder<VisitorPasswordBloc, VisitorPasswordState>(
builder: (context, state) {
final smartDoorBloc = BlocProvider.of<VisitorPasswordBloc>(context);
final visitorBloc = BlocProvider.of<VisitorPasswordBloc>(context);
return Column(
children: <Widget>[
Container(
@ -25,7 +25,7 @@ class RepeatWidget extends StatelessWidget {
height: size.height * 0.06, // Adjust height as needed
child: ListView(
scrollDirection: Axis.horizontal,
children: smartDoorBloc.days.map((day) {
children: visitorBloc.days.map((day) {
return Container(
width: size.width* 0.09,
child: CheckboxListTile(
@ -33,15 +33,15 @@ class RepeatWidget extends StatelessWidget {
day['day']!,
style: TextStyle(
fontSize: 18,
color: smartDoorBloc.selectedDays.contains(day['key'])
color: visitorBloc.selectedDays.contains(day['key'])
? Colors.black
: ColorsManager.grayColor,
),
),
value: smartDoorBloc.selectedDays.contains(day['key']),
value: visitorBloc.selectedDays.contains(day['key']),
onChanged: (bool? value) {
if (value != null) {
smartDoorBloc.add(ToggleDaySelectionEvent(key: day['key']!));
visitorBloc.add(ToggleDaySelectionEvent(key: day['key']!));
}
},
),
@ -56,19 +56,19 @@ class RepeatWidget extends StatelessWidget {
title: '',
size: size,
endTime: () {
smartDoorBloc.add(SelectTimeVisitorPassword(
visitorBloc.add(SelectTimeVisitorPassword(
isRepeat: true,
context: context, isStart: false
));
},
startTime: () {
smartDoorBloc.add(SelectTimeVisitorPassword(
visitorBloc.add(SelectTimeVisitorPassword(
isRepeat: true,
context: context, isStart: true
));
},
firstString: smartDoorBloc.repeatStartTime.toString(),
secondString: smartDoorBloc.repeatEndTime.toString(),
firstString: visitorBloc.repeatStartTime.toString(),
secondString: visitorBloc.repeatEndTime.toString(),
),
),

View File

@ -26,7 +26,11 @@ class VisitorPasswordDialog extends StatelessWidget {
bool isRepeat = state is IsRepeatState ? state.repeat : visitorBloc.repeat;
return AlertDialog(
backgroundColor: Colors.white,
title: const Text('Create visitor password'),
title: Text('Create visitor password',
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
fontWeight: FontWeight.w400,
fontSize: 24,
color: Colors.black),),
content: SingleChildScrollView(
child: Form(
key: visitorBloc.forgetFormKey,

View File

@ -25,7 +25,7 @@ abstract class ColorsManager {
static const Color blackColor = Color(0xFF000000);
static const Color lightGreen = Color(0xFF00FF0A);
static const Color grayColor = Color(0xFF999999);
static const Color red = Colors.red;
static const Color red = Color(0xFFFF0000);
static const Color graysColor = Color(0xffEBEBEB);
static const Color textGray = Color(0xffD5D5D5);
static const Color btnColor = Color(0xFF00008B);