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