mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
change some padding and when bake to AccessManagementPage get table
This commit is contained in:
@ -8,6 +8,7 @@ import 'package:syncrow_web/pages/common/date_time_widget.dart';
|
||||
import 'package:syncrow_web/pages/common/default_button.dart';
|
||||
import 'package:syncrow_web/pages/visitor_password/view/visitor_password_dialog.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/constants/const.dart';
|
||||
import 'package:syncrow_web/utils/style.dart';
|
||||
import 'package:syncrow_web/web_layout/web_scaffold.dart';
|
||||
@ -126,7 +127,7 @@ class AccessManagementPage extends StatelessWidget {
|
||||
width: 15,
|
||||
),
|
||||
DateTimeWebWidget(
|
||||
isTime: false,
|
||||
icon: Assets.calendarIcon,
|
||||
isRequired: false,
|
||||
title: 'Access Time',
|
||||
size: size,
|
||||
@ -202,7 +203,11 @@ class AccessManagementPage extends StatelessWidget {
|
||||
builder: (BuildContext context) {
|
||||
return const VisitorPasswordDialog();
|
||||
},
|
||||
);
|
||||
).then((v){
|
||||
if(v!=null){
|
||||
accessBloc.add(FetchTableData());
|
||||
}
|
||||
});
|
||||
},
|
||||
borderRadius: 8,
|
||||
child: const Text('+ Create Visitor Password ')),
|
||||
|
@ -12,17 +12,17 @@ class DateTimeWebWidget extends StatelessWidget {
|
||||
required this.title,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.isTime,
|
||||
required this.firstString,
|
||||
required this.secondString,
|
||||
required this.icon,
|
||||
});
|
||||
|
||||
final Size size;
|
||||
final String title;
|
||||
final bool isRequired;
|
||||
final bool isTime;
|
||||
final String firstString;
|
||||
final String secondString;
|
||||
final String icon;
|
||||
final Function()? startTime;
|
||||
final Function()? endTime;
|
||||
|
||||
@ -49,34 +49,45 @@ class DateTimeWebWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 8,),
|
||||
Container(
|
||||
width: size.width * 0.25,
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: containerDecoration,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: startTime,
|
||||
child: Text(firstString, style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,fontSize: 12,fontWeight: FontWeight.w400),)
|
||||
),
|
||||
const Icon(Icons.arrow_right_alt),
|
||||
InkWell(
|
||||
onTap:endTime,
|
||||
child: Text(secondString, style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,fontSize: 12,fontWeight: FontWeight.w400),)),
|
||||
SvgPicture.asset(
|
||||
isTime?
|
||||
Assets.timeIcon:
|
||||
Assets.calendarIcon,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
height:size.height * 0.055 ,
|
||||
padding: EdgeInsets.only(top: 10,bottom: 10,right: 30,left: 30),
|
||||
decoration: containerDecoration,
|
||||
child: FittedBox(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: startTime,
|
||||
child: FittedBox(
|
||||
child: Text(firstString,
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,fontSize: 12,fontWeight: FontWeight.w400),),
|
||||
)
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
const Icon(Icons.arrow_right_alt),
|
||||
SizedBox(width: 10,),
|
||||
|
||||
InkWell(
|
||||
onTap:endTime,
|
||||
child: FittedBox(
|
||||
child: Text(secondString,
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.grayColor,fontSize: 12,fontWeight: FontWeight.w400),
|
||||
),
|
||||
)),
|
||||
SizedBox(width: 10,),
|
||||
|
||||
SvgPicture.asset(
|
||||
icon,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_bloc.da
|
||||
import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_event.dart';
|
||||
import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_state.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class RepeatWidget extends StatelessWidget {
|
||||
const RepeatWidget({
|
||||
@ -21,19 +22,20 @@ class RepeatWidget extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
||||
Container(
|
||||
height: size.height * 0.05, // Adjust height as needed
|
||||
child: Wrap(
|
||||
// Wrap the Row in a SingleChildScrollView to handle overflow
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: visitorBloc.days.map((day) {
|
||||
return Container(
|
||||
width: size.width * 0.05,
|
||||
width: 70, // Adjust width as needed
|
||||
margin: EdgeInsets.all(5),
|
||||
child: CheckboxListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(
|
||||
day['day']!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontSize: 10,
|
||||
color: visitorBloc.selectedDays.contains(day['key'])
|
||||
? Colors.black
|
||||
: ColorsManager.blackColor,
|
||||
@ -53,33 +55,32 @@ class RepeatWidget extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: DateTimeWebWidget(
|
||||
isTime: true,
|
||||
icon: Assets.timeIcon,
|
||||
isRequired: false,
|
||||
title: '',
|
||||
size: size,
|
||||
endTime: () {
|
||||
visitorBloc.add(SelectTimeEvent(
|
||||
context: context,
|
||||
isEffective: false));
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
visitorBloc.add(SelectTimeEvent(
|
||||
context: context,
|
||||
isEffective: false));
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
visitorBloc.add(ChangeTimeEvent(val: visitorBloc.endTime, isStartEndTime: true));
|
||||
});
|
||||
},
|
||||
startTime: () {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
visitorBloc.add(ChangeTimeEvent(val: visitorBloc.endTime, isStartEndTime: true));
|
||||
});
|
||||
visitorBloc.add(SelectTimeEvent(context: context, isEffective: true));
|
||||
},
|
||||
firstString:visitorBloc.effectiveTime ,
|
||||
secondString: visitorBloc.expirationTime ,
|
||||
firstString: visitorBloc.effectiveTime,
|
||||
secondString: visitorBloc.expirationTime,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -100,20 +100,20 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'* ',
|
||||
Text('* ',
|
||||
style: Theme.of(context).textTheme
|
||||
.bodyMedium!.copyWith(color: Colors.red),
|
||||
),
|
||||
Text('Access Type',
|
||||
style:text ),
|
||||
],
|
||||
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: size.width * 0.15,
|
||||
Flexible(
|
||||
child: RadioListTile<String>(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text('Online Password',
|
||||
style: text,
|
||||
),
|
||||
@ -129,9 +129,10 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: size.width * 0.15,
|
||||
Flexible(
|
||||
child: RadioListTile<String>(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
|
||||
title: Text('Offline Password',
|
||||
style:text ),
|
||||
value: 'Offline Password',
|
||||
@ -145,9 +146,10 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: size.width * 0.15,
|
||||
Flexible(
|
||||
child: RadioListTile<String>(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
|
||||
title: Text('Dynamic Password',
|
||||
style: text,),
|
||||
value: 'Dynamic Password',
|
||||
@ -191,9 +193,9 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 200,
|
||||
Flexible(
|
||||
child: RadioListTile<String>(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text('One-Time',
|
||||
style:text ,),
|
||||
value: 'One-Time',
|
||||
@ -209,9 +211,9 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
Flexible(
|
||||
child: RadioListTile<String>(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text('Periodic',
|
||||
style: text),
|
||||
value: 'Periodic',
|
||||
@ -241,7 +243,6 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
visitorBloc.accessTypeSelected != 'Offline Password') &&
|
||||
(visitorBloc.usageFrequencySelected != ''))
|
||||
DateTimeWebWidget(
|
||||
isTime: false,
|
||||
isRequired: true,
|
||||
title: 'Access Period',
|
||||
size: size,
|
||||
@ -259,6 +260,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
},
|
||||
firstString: visitorBloc.startTimeAccess.toString(),
|
||||
secondString: visitorBloc.endTimeAccess.toString(),
|
||||
icon: Assets.calendarIcon
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
@ -311,7 +313,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
isRepeat ? const RepeatWidget() : const SizedBox(),
|
||||
Container(
|
||||
decoration: containerDecoration,
|
||||
width: size.width * 0.08,
|
||||
width: size.width / 9,
|
||||
child: DefaultButton(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
@ -347,7 +349,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
child: DefaultButton(
|
||||
borderRadius: 8,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(); // Close the dialog
|
||||
Navigator.of(context).pop(true);
|
||||
},
|
||||
backgroundColor: Colors.white,
|
||||
child: Text(
|
||||
|
Reference in New Issue
Block a user