mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 23:44:53 +00:00
fix bugs on create password
This commit is contained in:
@ -152,8 +152,7 @@ class CreateTemporaryPassword extends StatelessWidget {
|
||||
child: TextFormField(
|
||||
controller:
|
||||
BlocProvider.of<SmartDoorBloc>(context).passwordNameController,
|
||||
decoration: const InputDecoration(hintText: 'Enter The Name',hintStyle:
|
||||
TextStyle(fontSize: 14,color: ColorsManager.textGray)),
|
||||
decoration: const InputDecoration(hintText: 'Enter The Name',hintStyle: TextStyle(fontSize: 14,color: ColorsManager.textGray)),
|
||||
)),],
|
||||
), const Divider(color:ColorsManager.graysColor,),
|
||||
Padding(
|
||||
@ -169,14 +168,13 @@ class CreateTemporaryPassword extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
width: MediaQuery.of(context).size.width / 3.5,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
BlocProvider.of<SmartDoorBloc>(context)..add(SelectTimeEvent(context: context, isEffective: true));
|
||||
},
|
||||
child: Text(
|
||||
BlocProvider.of<SmartDoorBloc>(context).effectiveTime,style: TextStyle(fontSize: 14,color:BlocProvider.of<SmartDoorBloc>(context)
|
||||
.expirationTime!='Select Time'?ColorsManager.blackColor:ColorsManager.textGray),),
|
||||
BlocProvider.of<SmartDoorBloc>(context).effectiveTime,style: TextStyle(fontSize: 14,color: ColorsManager.textGray),),
|
||||
)),
|
||||
],
|
||||
),
|
||||
@ -194,18 +192,14 @@ class CreateTemporaryPassword extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 4,
|
||||
width: MediaQuery.of(context).size.width / 3.5,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
BlocProvider.of<SmartDoorBloc>(context)..add(SelectTimeEvent(context: context, isEffective: false));
|
||||
},
|
||||
child: Text(
|
||||
BlocProvider.of<SmartDoorBloc>(context)
|
||||
.expirationTime,style: TextStyle(fontSize: 14,color:
|
||||
|
||||
|
||||
BlocProvider.of<SmartDoorBloc>(context)
|
||||
.expirationTime!='Select Time'?ColorsManager.blackColor:ColorsManager.textGray),),
|
||||
.expirationTime,style: TextStyle(fontSize: 14,color: ColorsManager.textGray),),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@ -32,10 +32,15 @@ class DoorDialogState extends State<DoorDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final DateTime effectiveDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(widget.value.effectiveTime);
|
||||
DateTime.fromMillisecondsSinceEpoch(widget.value.effectiveTime * 1000, isUtc: true);
|
||||
String formattedDateEffectiveTime = DateFormat('yyyy-MM-dd').format(effectiveDateTime);
|
||||
String formattedTimeEffectiveTime = DateFormat('HH:mm:ss').format(effectiveDateTime);
|
||||
|
||||
final DateTime expiredDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(widget.value.invalidTime);
|
||||
final DateFormat formatter = DateFormat('HH:mm');
|
||||
DateTime.fromMillisecondsSinceEpoch(widget.value.invalidTime * 1000, isUtc: true);
|
||||
String formattedDateExpiredDateTime = DateFormat('yyyy-MM-dd').format(expiredDateTime);
|
||||
String formattedTimeExpiredDateTime = DateFormat('HH:mm:ss').format(expiredDateTime);
|
||||
|
||||
return Dialog(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -73,15 +78,32 @@ class DoorDialogState extends State<DoorDialog> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Effective Time :'),
|
||||
Text(formatter.format(effectiveDateTime)),
|
||||
const Text('Effective Date:'),
|
||||
Text(formattedDateEffectiveTime),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Expired Time :'),
|
||||
Text(formatter.format(expiredDateTime)),
|
||||
const Text('Effective Time:'),
|
||||
Text(formattedTimeEffectiveTime),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Expired Date:'),
|
||||
Text(formattedDateExpiredDateTime),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('Expired Time:'),
|
||||
Text(formattedTimeExpiredDateTime),
|
||||
],
|
||||
),
|
||||
],
|
||||
@ -102,8 +124,7 @@ class DoorDialogState extends State<DoorDialog> {
|
||||
child: Center(
|
||||
child: BodyMedium(
|
||||
text: 'Cancel',
|
||||
style: context.bodyMedium
|
||||
.copyWith(color: ColorsManager.greyColor),
|
||||
style: context.bodyMedium.copyWith(color: ColorsManager.greyColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -115,13 +136,11 @@ class DoorDialogState extends State<DoorDialog> {
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context, 'delete');
|
||||
|
||||
},
|
||||
child: Center(
|
||||
child: BodyMedium(
|
||||
text: 'Delete Password',
|
||||
style: context.bodyMedium.copyWith(
|
||||
color: ColorsManager.primaryColorWithOpacity),
|
||||
style: context.bodyMedium.copyWith(color: ColorsManager.primaryColorWithOpacity),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user