door lock

This commit is contained in:
mohammad
2024-07-24 16:58:50 +03:00
parent 7495c0f67e
commit b6053e1ceb
10 changed files with 176 additions and 57 deletions
@@ -200,6 +200,9 @@ class OfflineOneTimePasswordPage extends StatelessWidget {
if(generated==false){
smartDoorBloc.add(GenerateAndSavePasswordOneTimeEvent(context: context));
}else{
if(smartDoorBloc.passwordNameController.text.isNotEmpty){
smartDoorBloc.add(RenamePasswordEvent());
}
Navigator.pop(context);
}
},
@@ -163,7 +163,6 @@ class CreateTemporaryPassword extends StatelessWidget {
const SizedBox(
height: 20,
),
type == 'Online Password'?
DefaultContainer(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: ListTile(
@@ -182,33 +181,7 @@ class CreateTemporaryPassword extends StatelessWidget {
applyTheme: true,
)),
),
) :
Center(
child: SizedBox(
width: MediaQuery.of(context).size.width/1.5,
child: DefaultButton(
isDone: generated,
isLoading: smartDoorBloc.isSavingPassword ,
borderRadius: 30,
backgroundColor:Colors.blueGrey ,
onPressed: () {
if(generated==false){
if(type =='Time-Limited'){
smartDoorBloc.add(GenerateAndSavePasswordTimeLimitEvent(context: context));
}else{
smartDoorBloc.add(GenerateAndSavePasswordOneTimeEvent(context: context));
}
}else{
Navigator.pop(context);
}
},
child: const BodyMedium(
text: 'Generate & Save Password',
fontWeight: FontWeight.normal,
fontColor: Colors.white,
),),
),
),
) ,
const SizedBox(
height: 20,
),
@@ -264,6 +264,9 @@ class OfflineTimeLimitPasswordPage extends StatelessWidget {
GenerateAndSavePasswordTimeLimitEvent(
context: context));
} else {
if(smartDoorBloc.passwordNameController.text.isNotEmpty){
smartDoorBloc.add(RenamePasswordEvent());
}
Navigator.pop(context);
}
},