mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
padding and text them
This commit is contained in:
4
assets/images/time_icon.svg
Normal file
4
assets/images/time_icon.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5.00005 0C2.24302 0 0 2.24297 0 4.99995C0 7.75712 2.24302 10.0002 5.00005 10.0002C7.75703 10.0002 10 7.75708 10 4.99995C10 2.24297 7.75703 0 5.00005 0ZM5.00005 9.28343C2.63824 9.28343 0.716757 7.36186 0.716757 4.99995C0.716757 2.63819 2.63824 0.716757 5.00005 0.716757C7.36181 0.716757 9.28324 2.63819 9.28324 4.99995C9.28324 7.36186 7.36181 9.28343 5.00005 9.28343Z" fill="#999999"/>
|
||||
<path d="M7.57087 4.91629H5.22115V2.34782C5.22115 2.1499 5.06074 1.98944 4.86277 1.98944C4.66485 1.98944 4.50439 2.1499 4.50439 2.34782V5.27467C4.50439 5.47259 4.66485 5.63305 4.86277 5.63305H7.57087C7.76884 5.63305 7.92925 5.47259 7.92925 5.27467C7.92925 5.07675 7.76879 4.91629 7.57087 4.91629Z" fill="#999999"/>
|
||||
</svg>
|
After Width: | Height: | Size: 813 B |
@ -59,7 +59,6 @@ class MyApp extends StatelessWidget {
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), // Set up color scheme
|
||||
useMaterial3: true, // Enable Material 3
|
||||
),
|
||||
// home: VisitorPasswordDialog()
|
||||
home:isLoggedIn == 'Success' ? const HomePage() : const LoginPage(),
|
||||
));
|
||||
}
|
||||
|
@ -125,6 +125,7 @@ class AccessManagementPage extends StatelessWidget {
|
||||
width: 15,
|
||||
),
|
||||
DateTimeWebWidget(
|
||||
isTime: false,
|
||||
isRequired: false,
|
||||
title: 'Access Time',
|
||||
size: size,
|
||||
|
@ -143,7 +143,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
child: Text(title, style: const TextStyle(fontWeight: FontWeight.w400,fontSize: 13,color: Color(0xFF999999))),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -37,8 +37,7 @@ class CustomWebTextField extends StatelessWidget {
|
||||
.bodyMedium!
|
||||
.copyWith(color: Colors.red),
|
||||
),
|
||||
Text(textFieldName,
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
Text(textFieldName, style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: Colors.black,fontSize: 13),),
|
||||
],
|
||||
),
|
||||
|
@ -12,6 +12,7 @@ class DateTimeWebWidget extends StatelessWidget {
|
||||
required this.title,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.isTime,
|
||||
required this.firstString,
|
||||
required this.secondString,
|
||||
});
|
||||
@ -19,6 +20,7 @@ class DateTimeWebWidget extends StatelessWidget {
|
||||
final Size size;
|
||||
final String title;
|
||||
final bool isRequired;
|
||||
final bool isTime;
|
||||
final String firstString;
|
||||
final String secondString;
|
||||
final Function()? startTime;
|
||||
@ -66,6 +68,8 @@ class DateTimeWebWidget extends StatelessWidget {
|
||||
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,
|
||||
),
|
||||
],
|
||||
|
@ -262,12 +262,10 @@ class VisitorPasswordBloc
|
||||
Emitter<VisitorPasswordState> emit) async {
|
||||
try {
|
||||
generate7DigitNumber();
|
||||
// emit(DeviceLoaded());
|
||||
await AccessMangApi().postOffLineOneTime(
|
||||
email: event.email,
|
||||
devicesUuid: selectedDevices,
|
||||
passwordName: event.passwordName);
|
||||
// emit(TableLoaded(data));
|
||||
} catch (e) {
|
||||
emit(FailedState(e.toString()));
|
||||
}
|
||||
@ -278,14 +276,14 @@ class VisitorPasswordBloc
|
||||
Emitter<VisitorPasswordState> emit) async {
|
||||
try {
|
||||
generate7DigitNumber();
|
||||
// emit(DeviceLoaded());
|
||||
await AccessMangApi().postOffLineMultipleTime(
|
||||
email: event.email,
|
||||
devicesUuid: selectedDevices,
|
||||
passwordName: event.passwordName,
|
||||
invalidTime: event.invalidTime,
|
||||
effectiveTime: event.effectiveTime);
|
||||
// emit(TableLoaded(data));
|
||||
invalidTime: expirationTimeTimeStamp.toString(),
|
||||
effectiveTime: effectiveTimeTimeStamp.toString(),
|
||||
|
||||
);
|
||||
} catch (e) {
|
||||
emit(FailedState(e.toString()));
|
||||
}
|
||||
@ -335,8 +333,6 @@ class VisitorPasswordBloc
|
||||
|
||||
return matchesDeviceName && matchesDeviceId;
|
||||
}).toList();
|
||||
// emit(TableLoaded(filteredData));
|
||||
|
||||
add(UpdateFilteredDevicesEvent(filteredData));
|
||||
}
|
||||
|
||||
@ -414,11 +410,6 @@ class VisitorPasswordBloc
|
||||
expirationTimeTimeStamp = selectedTimestamp;
|
||||
}
|
||||
}
|
||||
print('effectiveTime=$effectiveTime');
|
||||
print('expirationTime=$expirationTime');
|
||||
|
||||
print('expirationTimeTimeStamp=$expirationTimeTimeStamp');
|
||||
print('effectiveTimeTimeStamp=$effectiveTimeTimeStamp');
|
||||
emit(TimeSelectedState());
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,11 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Text('Only online accessible devices can be added'),
|
||||
Text('Only online accessible devices can be added',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12,
|
||||
color: ColorsManager.grayColor),),
|
||||
],
|
||||
)
|
||||
),
|
||||
|
@ -14,28 +14,29 @@ class RepeatWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
|
||||
return BlocBuilder<VisitorPasswordBloc, VisitorPasswordState>(
|
||||
builder: (context, state) {
|
||||
final visitorBloc = BlocProvider.of<VisitorPasswordBloc>(context);
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
||||
Container(
|
||||
width: size.width * 0.8,
|
||||
height: size.height * 0.06, // Adjust height as needed
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
height: size.height * 0.05, // Adjust height as needed
|
||||
child: Wrap(
|
||||
children: visitorBloc.days.map((day) {
|
||||
return Container(
|
||||
width: size.width* 0.09,
|
||||
width: size.width * 0.05,
|
||||
child: CheckboxListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: Text(
|
||||
day['day']!,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontSize: 12,
|
||||
color: visitorBloc.selectedDays.contains(day['key'])
|
||||
? Colors.black
|
||||
: ColorsManager.grayColor,
|
||||
: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
value: visitorBloc.selectedDays.contains(day['key']),
|
||||
@ -52,27 +53,23 @@ class RepeatWidget extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: DateTimeWebWidget(
|
||||
isTime: true,
|
||||
isRequired: false,
|
||||
title: '',
|
||||
size: size,
|
||||
endTime: () {
|
||||
print('sadasd');
|
||||
visitorBloc.add(SelectTimeEvent(
|
||||
context: context,
|
||||
isEffective: false));
|
||||
new 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: () {
|
||||
new 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 ,
|
||||
|
@ -245,10 +245,10 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
height: 20,
|
||||
),
|
||||
if ((visitorBloc.usageFrequencySelected != 'One-Time' ||
|
||||
visitorBloc.accessTypeSelected !=
|
||||
'Offline Password') &&
|
||||
(visitorBloc.usageFrequencySelected != ''))
|
||||
visitorBloc.accessTypeSelected != 'Offline Password') &&
|
||||
(visitorBloc.usageFrequencySelected != ''))
|
||||
DateTimeWebWidget(
|
||||
isTime: false,
|
||||
isRequired: true,
|
||||
title: 'Access Period',
|
||||
size: size,
|
||||
@ -282,42 +282,44 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
.bodyMedium!
|
||||
.copyWith(color: Colors.red),
|
||||
),
|
||||
Text('Access Devices', style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
Text('Access Devices',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: Colors.black,fontSize: 13),),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Within the validity period, each device can be unlocked only once.',style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
'Within the validity period, each device can be unlocked only once.',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.grayColor,fontSize: 9),),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
if (visitorBloc.usageFrequencySelected ==
|
||||
'Periodic' &&
|
||||
visitorBloc.accessTypeSelected ==
|
||||
'Online Password')
|
||||
if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Online Password')
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Text('Repeat'),
|
||||
trailing: Transform.scale(
|
||||
scale: .8,
|
||||
child: CupertinoSwitch(
|
||||
value: visitorBloc.repeat,
|
||||
onChanged: (value) {
|
||||
visitorBloc.add(ToggleRepeatEvent());
|
||||
},
|
||||
applyTheme: true,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text('Repeat',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
color: Colors.black,fontSize: 13),),
|
||||
Transform.scale(
|
||||
scale: .8,
|
||||
child: CupertinoSwitch(
|
||||
value: visitorBloc.repeat,
|
||||
onChanged: (value) {
|
||||
visitorBloc.add(ToggleRepeatEvent());
|
||||
},
|
||||
applyTheme: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
),
|
||||
),
|
||||
if (visitorBloc.usageFrequencySelected ==
|
||||
'Periodic' &&
|
||||
visitorBloc.accessTypeSelected ==
|
||||
'Online Password')
|
||||
if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Online Password')
|
||||
isRepeat ? const RepeatWidget() : const SizedBox(),
|
||||
Container(
|
||||
decoration: containerDecoration,
|
||||
@ -406,70 +408,40 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
child: DefaultButton(
|
||||
borderRadius: 8,
|
||||
onPressed: () {
|
||||
if (visitorBloc.usageFrequencySelected ==
|
||||
'One-Time' &&
|
||||
visitorBloc.accessTypeSelected ==
|
||||
'Online Password') {
|
||||
if (visitorBloc.usageFrequencySelected == 'One-Time' &&
|
||||
visitorBloc.accessTypeSelected == 'Online Password') {
|
||||
visitorBloc.add(
|
||||
OnlineOneTimePasswordEvent(
|
||||
context: context,
|
||||
passwordName: visitorBloc
|
||||
.userNameController.text,
|
||||
email: visitorBloc
|
||||
.emailController.text));
|
||||
} else if (visitorBloc
|
||||
.usageFrequencySelected ==
|
||||
'Periodic' &&
|
||||
visitorBloc.accessTypeSelected ==
|
||||
'Online Password') {
|
||||
visitorBloc.add(
|
||||
OnlineMultipleTimePasswordEvent(
|
||||
passwordName:
|
||||
visitorBloc
|
||||
.userNameController
|
||||
.text,
|
||||
email:
|
||||
visitorBloc
|
||||
.emailController.text,
|
||||
effectiveTime: visitorBloc
|
||||
.effectiveTimeTimeStamp
|
||||
.toString(),
|
||||
invalidTime: visitorBloc
|
||||
.expirationTimeTimeStamp
|
||||
.toString()));
|
||||
} else if (visitorBloc
|
||||
.usageFrequencySelected ==
|
||||
'One-Time' &&
|
||||
visitorBloc.accessTypeSelected ==
|
||||
'Offline Password') {
|
||||
visitorBloc
|
||||
.add(OfflineOneTimePasswordEvent(
|
||||
passwordName: visitorBloc
|
||||
.userNameController.text,
|
||||
email:
|
||||
visitorBloc.emailController.text,
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
email: visitorBloc.emailController.text));
|
||||
} else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Online Password') {
|
||||
visitorBloc.add(OnlineMultipleTimePasswordEvent(
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
email: visitorBloc.emailController.text,
|
||||
effectiveTime: visitorBloc.effectiveTimeTimeStamp.toString(),
|
||||
invalidTime: visitorBloc.expirationTimeTimeStamp.toString()));
|
||||
} else if (visitorBloc.usageFrequencySelected == 'One-Time' &&
|
||||
visitorBloc.accessTypeSelected == 'Offline Password') {
|
||||
visitorBloc.add(OfflineOneTimePasswordEvent(
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
email: visitorBloc.emailController.text,
|
||||
));
|
||||
} else if (visitorBloc
|
||||
.usageFrequencySelected ==
|
||||
'Periodic' &&
|
||||
visitorBloc.accessTypeSelected ==
|
||||
'Offline Password') {
|
||||
} else if (visitorBloc.usageFrequencySelected == 'Periodic' &&
|
||||
visitorBloc.accessTypeSelected == 'Offline Password') {
|
||||
visitorBloc.add(
|
||||
OfflineMultipleTimePasswordEvent(
|
||||
passwordName: visitorBloc
|
||||
.userNameController.text,
|
||||
email: visitorBloc
|
||||
.emailController.text,
|
||||
effectiveTime: visitorBloc
|
||||
.effectiveTimeTimeStamp
|
||||
.toString(),
|
||||
invalidTime: visitorBloc
|
||||
.expirationTimeTimeStamp
|
||||
.toString()));
|
||||
passwordName: visitorBloc.userNameController.text,
|
||||
email: visitorBloc.emailController.text,
|
||||
effectiveTime: visitorBloc.effectiveTimeTimeStamp.toString(),
|
||||
invalidTime: visitorBloc.expirationTimeTimeStamp.toString()));
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
'Ok',
|
||||
child: Text('Ok',
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.whiteColors,fontSize: 16),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -531,7 +503,9 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
borderRadius: 8,
|
||||
child: Text('Ok'),
|
||||
child: Text('Ok', style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
color: ColorsManager.whiteColors,fontSize: 16),),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -25,4 +25,5 @@ class Assets {
|
||||
static const String assetIcon = "assets/images/asset_icon.svg";
|
||||
static const String calendarIcon = "assets/images/calendar_icon.svg";
|
||||
static const String deviceNoteIcon = "assets/images/device_note.svg";
|
||||
static const String timeIcon = "assets/images/time_icon.svg";
|
||||
}
|
||||
|
Reference in New Issue
Block a user