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