mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
merge with dev
This commit is contained in:
@ -3,25 +3,27 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:syncrow_web/pages/access_management/bloc/access_event.dart';
|
import 'package:syncrow_web/pages/access_management/bloc/access_event.dart';
|
||||||
import 'package:syncrow_web/pages/access_management/bloc/access_state.dart';
|
import 'package:syncrow_web/pages/access_management/bloc/access_state.dart';
|
||||||
import 'package:syncrow_web/pages/access_management/model/password_model.dart';
|
import 'package:syncrow_web/pages/access_management/model/password_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/common/hour_picker_dialog.dart';
|
||||||
import 'package:syncrow_web/services/access_mang_api.dart';
|
import 'package:syncrow_web/services/access_mang_api.dart';
|
||||||
|
import 'package:syncrow_web/utils/color_manager.dart';
|
||||||
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
||||||
import 'package:syncrow_web/utils/snack_bar.dart';
|
import 'package:syncrow_web/utils/snack_bar.dart';
|
||||||
|
|
||||||
class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
||||||
AccessBloc() : super((AccessInitial())) {
|
AccessBloc() : super((AccessInitial())) {
|
||||||
on<FetchTableData>(_onFetchTableData);
|
on<FetchTableData>(_onFetchTableData);
|
||||||
// on<TabChangedEvent>(selectFilterTap);
|
|
||||||
on<SelectTime>(selectTime);
|
on<SelectTime>(selectTime);
|
||||||
on<FilterDataEvent>(_filterData);
|
on<FilterDataEvent>(_filterData);
|
||||||
on<ResetSearch>(resetSearch);
|
on<ResetSearch>(resetSearch);
|
||||||
on<TabChangedEvent>(onTabChanged);
|
on<TabChangedEvent>(onTabChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
String startTime = 'Start Date';
|
String startTime = 'Start Date';
|
||||||
String endTime = 'End Date';
|
String endTime = 'End Date';
|
||||||
|
|
||||||
int? effectiveTimeTimeStamp;
|
int? effectiveTimeTimeStamp;
|
||||||
int? expirationTimeTimeStamp;
|
int? expirationTimeTimeStamp;
|
||||||
TextEditingController passwordName = TextEditingController();
|
TextEditingController passwordName = TextEditingController();
|
||||||
|
TextEditingController emailAuthorizer = TextEditingController();
|
||||||
List<PasswordModel> filteredData = [];
|
List<PasswordModel> filteredData = [];
|
||||||
List<PasswordModel> data = [];
|
List<PasswordModel> data = [];
|
||||||
|
|
||||||
@ -62,57 +64,61 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> selectTime(SelectTime event, Emitter<AccessState> emit) async {
|
|
||||||
|
Future<void> selectTime(SelectTime event, Emitter<AccessState> emit,) async {
|
||||||
emit(AccessLoaded());
|
emit(AccessLoaded());
|
||||||
final DateTime? picked = await showDatePicker(
|
final DateTime? picked = await showDatePicker(
|
||||||
context: event.context,
|
context: event.context,
|
||||||
initialDate: DateTime.now(),
|
initialDate: DateTime.now(),
|
||||||
firstDate: DateTime(2015, 8),
|
firstDate: DateTime.now().add(const Duration(days: -5095)),
|
||||||
lastDate: DateTime(2101),
|
lastDate: DateTime.now().add(const Duration(days: 2095)),
|
||||||
);
|
);
|
||||||
if (picked != null) {
|
if (picked != null) {
|
||||||
final selectedDateTime = DateTime(
|
final TimeOfDay? timePicked = await showHourPicker(
|
||||||
picked.year,
|
context: event.context,
|
||||||
picked.month,
|
initialTime: TimeOfDay.now(),
|
||||||
picked.day,
|
|
||||||
);
|
);
|
||||||
final selectedTimestamp = DateTime(
|
|
||||||
selectedDateTime.year,
|
if (timePicked != null) {
|
||||||
selectedDateTime.month,
|
final DateTime selectedDateTime = DateTime(
|
||||||
selectedDateTime.day,
|
picked.year,
|
||||||
selectedDateTime.hour,
|
picked.month,
|
||||||
selectedDateTime.minute,
|
picked.day,
|
||||||
).millisecondsSinceEpoch ~/
|
timePicked.hour,
|
||||||
1000; // Divide by 1000 to remove milliseconds
|
timePicked.minute,
|
||||||
if (event.isStart) {
|
);
|
||||||
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
|
final int selectedTimestamp = selectedDateTime.millisecondsSinceEpoch ~/ 1000;
|
||||||
CustomSnackBar.displaySnackBar('Effective Time cannot be later than Expiration Time.');
|
if (event.isStart) {
|
||||||
|
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
|
||||||
|
CustomSnackBar.displaySnackBar('Effective Time cannot be later than Expiration Time.');
|
||||||
|
} else {
|
||||||
|
startTime = selectedDateTime.toString().split('.').first;
|
||||||
|
effectiveTimeTimeStamp = selectedTimestamp;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
startTime =
|
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
|
||||||
selectedDateTime.toString().split('.').first; // Remove seconds and milliseconds
|
CustomSnackBar.displaySnackBar('Expiration Time cannot be earlier than Effective Time.');
|
||||||
effectiveTimeTimeStamp = selectedTimestamp;
|
} else {
|
||||||
}
|
endTime = selectedDateTime.toString().split('.').first;
|
||||||
} else {
|
expirationTimeTimeStamp = selectedTimestamp;
|
||||||
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
|
}
|
||||||
CustomSnackBar.displaySnackBar('Expiration Time cannot be earlier than Effective Time.');
|
|
||||||
} else {
|
|
||||||
endTime = selectedDateTime.toString().split('.').first; // Remove seconds and milliseconds
|
|
||||||
expirationTimeTimeStamp = selectedTimestamp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit(ChangeTimeState());
|
emit(ChangeTimeState());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> _filterData(FilterDataEvent event, Emitter<AccessState> emit) async {
|
Future<void> _filterData(FilterDataEvent event, Emitter<AccessState> emit) async {
|
||||||
emit(AccessLoaded());
|
emit(AccessLoaded());
|
||||||
try {
|
try {
|
||||||
|
print(event.emailAuthorizer?.toLowerCase());
|
||||||
// Convert search text to lower case for case-insensitive search
|
// Convert search text to lower case for case-insensitive search
|
||||||
final searchText = event.passwordName?.toLowerCase() ?? '';
|
final searchText = event.passwordName?.toLowerCase() ?? '';
|
||||||
|
final searchEmailText = event.emailAuthorizer?.toLowerCase() ?? '';
|
||||||
filteredData = data.where((item) {
|
filteredData = data.where((item) {
|
||||||
bool matchesCriteria = true;
|
bool matchesCriteria = true;
|
||||||
|
|
||||||
// Convert timestamp to DateTime and extract date component
|
// Convert timestamp to DateTime and extract date component
|
||||||
DateTime effectiveDate =
|
DateTime effectiveDate =
|
||||||
DateTime.fromMillisecondsSinceEpoch(int.parse(item.effectiveTime.toString()) * 1000)
|
DateTime.fromMillisecondsSinceEpoch(int.parse(item.effectiveTime.toString()) * 1000)
|
||||||
@ -122,9 +128,8 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
DateTime.fromMillisecondsSinceEpoch(int.parse(item.invalidTime.toString()) * 1000)
|
DateTime.fromMillisecondsSinceEpoch(int.parse(item.invalidTime.toString()) * 1000)
|
||||||
.toUtc()
|
.toUtc()
|
||||||
.toLocal();
|
.toLocal();
|
||||||
DateTime effectiveDateOnly =
|
DateTime effectiveDateAndTime = DateTime(effectiveDate.year, effectiveDate.month, effectiveDate.day,effectiveDate.hour,effectiveDate.minute);
|
||||||
DateTime(effectiveDate.year, effectiveDate.month, effectiveDate.day);
|
DateTime invalidDateAndTime = DateTime(invalidDate.year, invalidDate.month, invalidDate.day,invalidDate.hour,invalidDate.minute);
|
||||||
DateTime invalidDateOnly = DateTime(invalidDate.year, invalidDate.month, invalidDate.day);
|
|
||||||
|
|
||||||
// Filter by password name, making the search case-insensitive
|
// Filter by password name, making the search case-insensitive
|
||||||
if (searchText.isNotEmpty) {
|
if (searchText.isNotEmpty) {
|
||||||
@ -133,36 +138,51 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
matchesCriteria = false;
|
matchesCriteria = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (searchEmailText.isNotEmpty) {
|
||||||
// Filter by start date only
|
final bool matchesName = item.authorizerEmail.toString().toLowerCase().contains(searchEmailText);
|
||||||
if (event.startTime != null && event.endTime == null) {
|
if (!matchesName) {
|
||||||
DateTime startDateOnly =
|
matchesCriteria = false;
|
||||||
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
}
|
||||||
startDateOnly = DateTime(startDateOnly.year, startDateOnly.month, startDateOnly.day);
|
}
|
||||||
if (effectiveDateOnly.isBefore(startDateOnly)) {
|
// Filter by start date only
|
||||||
|
if (event.startTime != null && event.endTime == null) {
|
||||||
|
DateTime startDateTime =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
||||||
|
startDateTime = DateTime(
|
||||||
|
startDateTime.year,
|
||||||
|
startDateTime.month,
|
||||||
|
startDateTime.day,
|
||||||
|
startDateTime.hour,
|
||||||
|
startDateTime.minute);
|
||||||
|
if (effectiveDateAndTime.isBefore(startDateTime)) {
|
||||||
matchesCriteria = false;
|
matchesCriteria = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter by end date only
|
// Filter by end date only
|
||||||
if (event.endTime != null && event.startTime == null) {
|
if (event.endTime != null && event.startTime == null) {
|
||||||
DateTime endDateOnly =
|
DateTime startDateTime =
|
||||||
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
||||||
endDateOnly = DateTime(endDateOnly.year, endDateOnly.month, endDateOnly.day);
|
startDateTime = DateTime(
|
||||||
if (invalidDateOnly.isAfter(endDateOnly)) {
|
startDateTime.year,
|
||||||
|
startDateTime.month,
|
||||||
|
startDateTime.day,
|
||||||
|
startDateTime.hour,
|
||||||
|
startDateTime.minute
|
||||||
|
);
|
||||||
|
if (invalidDateAndTime.isAfter(startDateTime)) {
|
||||||
matchesCriteria = false;
|
matchesCriteria = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter by both start date and end date
|
// Filter by both start date and end date
|
||||||
if (event.startTime != null && event.endTime != null) {
|
if (event.startTime != null && event.endTime != null) {
|
||||||
DateTime startDateOnly =
|
DateTime startDateTime =
|
||||||
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
DateTime.fromMillisecondsSinceEpoch(event.startTime! * 1000).toUtc().toLocal();
|
||||||
DateTime endDateOnly =
|
DateTime endDateTime =
|
||||||
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
DateTime.fromMillisecondsSinceEpoch(event.endTime! * 1000).toUtc().toLocal();
|
||||||
startDateOnly = DateTime(startDateOnly.year, startDateOnly.month, startDateOnly.day);
|
startDateTime = DateTime(startDateTime.year, startDateTime.month, startDateTime.day,startDateTime.hour,startDateTime.minute);
|
||||||
endDateOnly = DateTime(endDateOnly.year, endDateOnly.month, endDateOnly.day);
|
endDateTime = DateTime(endDateTime.year, endDateTime.month, endDateTime.day,endDateTime.hour,endDateTime.minute);
|
||||||
if (effectiveDateOnly.isBefore(startDateOnly) || invalidDateOnly.isAfter(endDateOnly)) {
|
if (effectiveDateAndTime.isBefore(startDateTime) || invalidDateAndTime.isAfter(endDateTime)) {
|
||||||
matchesCriteria = false;
|
matchesCriteria = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -186,12 +206,12 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resetSearch(ResetSearch event, Emitter<AccessState> emit) async {
|
resetSearch(ResetSearch event, Emitter<AccessState> emit) async {
|
||||||
emit(AccessLoaded());
|
emit(AccessLoaded());
|
||||||
startTime = 'Start Time';
|
startTime = 'Start Time';
|
||||||
endTime = 'End Time';
|
endTime = 'End Time';
|
||||||
passwordName.clear();
|
passwordName.clear();
|
||||||
|
emailAuthorizer.clear();
|
||||||
selectedIndex = 0;
|
selectedIndex = 0;
|
||||||
effectiveTimeTimeStamp = null;
|
effectiveTimeTimeStamp = null;
|
||||||
expirationTimeTimeStamp = null;
|
expirationTimeTimeStamp = null;
|
||||||
@ -200,9 +220,11 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
|
|
||||||
String timestampToDate(dynamic timestamp) {
|
String timestampToDate(dynamic timestamp) {
|
||||||
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(int.parse(timestamp) * 1000);
|
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(int.parse(timestamp) * 1000);
|
||||||
return "${dateTime.year}/${dateTime.month.toString().padLeft(2, '0')}/${dateTime.day.toString().padLeft(2, '0')}";
|
return "${dateTime.year}/${dateTime.month.toString().padLeft(2, '0')}/${dateTime.day.toString().padLeft(2, '0')} "
|
||||||
|
" ${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> onTabChanged(TabChangedEvent event, Emitter<AccessState> emit) async {
|
Future<void> onTabChanged(TabChangedEvent event, Emitter<AccessState> emit) async {
|
||||||
try {
|
try {
|
||||||
emit(AccessLoaded());
|
emit(AccessLoaded());
|
||||||
@ -227,6 +249,7 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
add(FilterDataEvent(
|
add(FilterDataEvent(
|
||||||
selectedTabIndex: selectedIndex,
|
selectedTabIndex: selectedIndex,
|
||||||
passwordName: passwordName.text.toLowerCase(),
|
passwordName: passwordName.text.toLowerCase(),
|
||||||
|
emailAuthorizer: emailAuthorizer.text.toLowerCase(),
|
||||||
startTime: effectiveTimeTimeStamp,
|
startTime: effectiveTimeTimeStamp,
|
||||||
endTime: expirationTimeTimeStamp));
|
endTime: expirationTimeTimeStamp));
|
||||||
emit(TableLoaded(filteredData));
|
emit(TableLoaded(filteredData));
|
||||||
@ -234,4 +257,6 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
emit(FailedState(e.toString()));
|
emit(FailedState(e.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,12 +28,14 @@ class SelectTime extends AccessEvent {
|
|||||||
|
|
||||||
class FilterDataEvent extends AccessEvent {
|
class FilterDataEvent extends AccessEvent {
|
||||||
final String? passwordName;
|
final String? passwordName;
|
||||||
|
final String? emailAuthorizer;
|
||||||
final int? startTime;
|
final int? startTime;
|
||||||
final int? endTime;
|
final int? endTime;
|
||||||
final int selectedTabIndex; // Add this field
|
final int selectedTabIndex; // Add this field
|
||||||
|
|
||||||
const FilterDataEvent({
|
const FilterDataEvent({
|
||||||
this.passwordName,
|
this.passwordName,
|
||||||
|
this.emailAuthorizer,
|
||||||
this.startTime,
|
this.startTime,
|
||||||
this.endTime,
|
this.endTime,
|
||||||
required this.selectedTabIndex, // Initialize this field
|
required this.selectedTabIndex, // Initialize this field
|
||||||
|
@ -6,10 +6,13 @@ class PasswordModel {
|
|||||||
final dynamic effectiveTime;
|
final dynamic effectiveTime;
|
||||||
final dynamic passwordCreated;
|
final dynamic passwordCreated;
|
||||||
final dynamic createdTime;
|
final dynamic createdTime;
|
||||||
final dynamic passwordName; // New field
|
final dynamic passwordName;
|
||||||
final AccessStatus passwordStatus;
|
final AccessStatus passwordStatus;
|
||||||
final AccessType passwordType;
|
final AccessType passwordType;
|
||||||
final dynamic deviceUuid;
|
final dynamic deviceUuid;
|
||||||
|
final dynamic authorizerEmail;
|
||||||
|
final dynamic authorizerDate;
|
||||||
|
final dynamic deviceName;
|
||||||
|
|
||||||
PasswordModel({
|
PasswordModel({
|
||||||
this.passwordId,
|
this.passwordId,
|
||||||
@ -17,10 +20,13 @@ class PasswordModel {
|
|||||||
this.effectiveTime,
|
this.effectiveTime,
|
||||||
this.passwordCreated,
|
this.passwordCreated,
|
||||||
this.createdTime,
|
this.createdTime,
|
||||||
this.passwordName, // New field
|
this.passwordName,
|
||||||
required this.passwordStatus,
|
required this.passwordStatus,
|
||||||
required this.passwordType,
|
required this.passwordType,
|
||||||
this.deviceUuid,
|
this.deviceUuid,
|
||||||
|
this.authorizerEmail,
|
||||||
|
this.authorizerDate,
|
||||||
|
this.deviceName,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory PasswordModel.fromJson(Map<String, dynamic> json) {
|
factory PasswordModel.fromJson(Map<String, dynamic> json) {
|
||||||
@ -34,6 +40,9 @@ class PasswordModel {
|
|||||||
passwordStatus: AccessStatusExtension.fromString(json['passwordStatus']),
|
passwordStatus: AccessStatusExtension.fromString(json['passwordStatus']),
|
||||||
passwordType: AccessTypeExtension.fromString(json['passwordType']),
|
passwordType: AccessTypeExtension.fromString(json['passwordType']),
|
||||||
deviceUuid: json['deviceUuid'],
|
deviceUuid: json['deviceUuid'],
|
||||||
|
authorizerEmail: json['authorizerEmail'],
|
||||||
|
authorizerDate: json['authorizerDate'],
|
||||||
|
deviceName: json['deviceName'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,10 +53,13 @@ class PasswordModel {
|
|||||||
'effectiveTime': effectiveTime,
|
'effectiveTime': effectiveTime,
|
||||||
'passwordCreated': passwordCreated,
|
'passwordCreated': passwordCreated,
|
||||||
'createdTime': createdTime,
|
'createdTime': createdTime,
|
||||||
'passwodName': passwordName, // New field
|
'passwordName': passwordName, // New field
|
||||||
'passwordStatus': passwordStatus,
|
'passwordStatus': passwordStatus,
|
||||||
'passwordType': passwordType,
|
'passwordType': passwordType,
|
||||||
'deviceUuid': deviceUuid,
|
'deviceUuid': deviceUuid,
|
||||||
|
'authorizerEmail': authorizerEmail,
|
||||||
|
'authorizerDate': authorizerDate,
|
||||||
|
'deviceName': deviceName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,14 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
final isLargeScreen = isLargeScreenSize(context);
|
final isLargeScreen = isLargeScreenSize(context);
|
||||||
final isSmallScreen = isSmallScreenSize(context);
|
final isSmallScreen = isSmallScreenSize(context);
|
||||||
final isHalfMediumScreen = isHafMediumScreenSize(context);
|
final isHalfMediumScreen = isHafMediumScreenSize(context);
|
||||||
final padding = isLargeScreen ? const EdgeInsets.all(30) : const EdgeInsets.all(15);
|
final padding = isLargeScreen ? const EdgeInsets.all(30) : const EdgeInsets.all(15);
|
||||||
|
|
||||||
return WebScaffold(
|
return WebScaffold(
|
||||||
enableMenuSideba: false,
|
enableMenuSidebar: false,
|
||||||
appBarTitle: FittedBox(
|
appBarTitle: FittedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Access Management',
|
'Access Management',
|
||||||
@ -85,7 +86,7 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
_buildVisitorAdminPasswords(context, accessBloc),
|
_buildVisitorAdminPasswords(context, accessBloc),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: DynamicTable(
|
child: DynamicTable(
|
||||||
tableName: 'AccessManagement',
|
tableName: 'AccessManagement',
|
||||||
uuidIndex: 1,
|
uuidIndex: 1,
|
||||||
withSelectAll: true,
|
withSelectAll: true,
|
||||||
@ -96,7 +97,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
headers: const [
|
headers: const [
|
||||||
'Name',
|
'Name',
|
||||||
'Access Type',
|
'Access Type',
|
||||||
'Access Period',
|
'Access Start',
|
||||||
|
'Access End',
|
||||||
'Accessible Device',
|
'Accessible Device',
|
||||||
'Authorizer',
|
'Authorizer',
|
||||||
'Authorization Date & Time',
|
'Authorization Date & Time',
|
||||||
@ -106,10 +108,11 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
return [
|
return [
|
||||||
item.passwordName,
|
item.passwordName,
|
||||||
item.passwordType.value,
|
item.passwordType.value,
|
||||||
('${accessBloc.timestampToDate(item.effectiveTime)} - ${accessBloc.timestampToDate(item.invalidTime)}'),
|
accessBloc.timestampToDate(item.effectiveTime),
|
||||||
item.deviceUuid.toString(),
|
accessBloc.timestampToDate(item.invalidTime),
|
||||||
'',
|
item.deviceName.toString(),
|
||||||
'',
|
item.authorizerEmail.toString(),
|
||||||
|
accessBloc.timestampToDate(item.invalidTime),
|
||||||
item.passwordStatus.value,
|
item.passwordStatus.value,
|
||||||
];
|
];
|
||||||
}).toList(),
|
}).toList(),
|
||||||
@ -166,6 +169,8 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Row _buildNormalSearchWidgets(BuildContext context, AccessBloc accessBloc) {
|
Row _buildNormalSearchWidgets(BuildContext context, AccessBloc accessBloc) {
|
||||||
|
TimeOfDay _selectedTime = TimeOfDay.now();
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
@ -182,6 +187,17 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 15),
|
const SizedBox(width: 15),
|
||||||
|
SizedBox(
|
||||||
|
width: 250,
|
||||||
|
child: CustomWebTextField(
|
||||||
|
controller: accessBloc.emailAuthorizer,
|
||||||
|
height: 43,
|
||||||
|
isRequired: false,
|
||||||
|
textFieldName: 'Authorizer',
|
||||||
|
description: '',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 15),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: DateTimeWebWidget(
|
child: DateTimeWebWidget(
|
||||||
icon: Assets.calendarIcon,
|
icon: Assets.calendarIcon,
|
||||||
@ -189,7 +205,7 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
title: 'Access Time',
|
title: 'Access Time',
|
||||||
size: MediaQuery.of(context).size,
|
size: MediaQuery.of(context).size,
|
||||||
endTime: () {
|
endTime: () {
|
||||||
accessBloc.add(SelectTime(context: context, isStart: false));
|
accessBloc.add(SelectTime(context: context, isStart: false));
|
||||||
},
|
},
|
||||||
startTime: () {
|
startTime: () {
|
||||||
accessBloc.add(SelectTime(context: context, isStart: true));
|
accessBloc.add(SelectTime(context: context, isStart: true));
|
||||||
@ -202,6 +218,7 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
SearchResetButtons(
|
SearchResetButtons(
|
||||||
onSearch: () {
|
onSearch: () {
|
||||||
accessBloc.add(FilterDataEvent(
|
accessBloc.add(FilterDataEvent(
|
||||||
|
emailAuthorizer:accessBloc.emailAuthorizer.text.toLowerCase() ,
|
||||||
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
|
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
|
||||||
passwordName: accessBloc.passwordName.text.toLowerCase(),
|
passwordName: accessBloc.passwordName.text.toLowerCase(),
|
||||||
startTime: accessBloc.effectiveTimeTimeStamp,
|
startTime: accessBloc.effectiveTimeTimeStamp,
|
||||||
@ -247,10 +264,12 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
SearchResetButtons(
|
SearchResetButtons(
|
||||||
onSearch: () {
|
onSearch: () {
|
||||||
accessBloc.add(FilterDataEvent(
|
accessBloc.add(FilterDataEvent(
|
||||||
|
emailAuthorizer:accessBloc.emailAuthorizer.text.toLowerCase() ,
|
||||||
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
|
selectedTabIndex: BlocProvider.of<AccessBloc>(context).selectedIndex,
|
||||||
passwordName: accessBloc.passwordName.text.toLowerCase(),
|
passwordName: accessBloc.passwordName.text.toLowerCase(),
|
||||||
startTime: accessBloc.effectiveTimeTimeStamp,
|
startTime: accessBloc.effectiveTimeTimeStamp,
|
||||||
endTime: accessBloc.expirationTimeTimeStamp));
|
endTime: accessBloc.expirationTimeTimeStamp
|
||||||
|
));
|
||||||
},
|
},
|
||||||
onReset: () {
|
onReset: () {
|
||||||
accessBloc.add(ResetSearch());
|
accessBloc.add(ResetSearch());
|
||||||
@ -259,4 +278,6 @@ class AccessManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -209,23 +209,17 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
|||||||
decoration:
|
decoration:
|
||||||
textBoxDecoration()!.copyWith(
|
textBoxDecoration()!.copyWith(
|
||||||
hintText: 'Enter Code',
|
hintText: 'Enter Code',
|
||||||
hintStyle: Theme.of(context)
|
hintStyle: Theme.of(context).textTheme
|
||||||
.textTheme
|
.bodySmall!.copyWith(
|
||||||
.bodySmall!
|
color: ColorsManager.grayColor,
|
||||||
.copyWith(
|
fontWeight: FontWeight.w400),
|
||||||
color:
|
|
||||||
ColorsManager.grayColor,
|
|
||||||
fontWeight:
|
|
||||||
FontWeight.w400),
|
|
||||||
suffixIcon: SizedBox(
|
suffixIcon: SizedBox(
|
||||||
width: 100,
|
width: 100,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: state is TimerState &&
|
onTap: state is TimerState &&
|
||||||
!state
|
!state.isButtonEnabled &&
|
||||||
.isButtonEnabled &&
|
state.remainingTime != 1
|
||||||
state.remainingTime !=
|
|
||||||
1
|
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
if (forgetBloc.forgetEmailKey.currentState!.validate()||forgetBloc.forgetRegionKey.currentState!.validate()) {
|
if (forgetBloc.forgetEmailKey.currentState!.validate()||forgetBloc.forgetRegionKey.currentState!.validate()) {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class HourPickerDialog extends StatefulWidget {
|
class HourPickerDialog extends StatefulWidget {
|
||||||
final TimeOfDay initialTime;
|
final TimeOfDay initialTime;
|
||||||
|
|
||||||
const HourPickerDialog({super.key, required this.initialTime});
|
const HourPickerDialog({super.key, required this.initialTime});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -9,70 +12,50 @@ class HourPickerDialog extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _HourPickerDialogState extends State<HourPickerDialog> {
|
class _HourPickerDialogState extends State<HourPickerDialog> {
|
||||||
late int _selectedHour;
|
late String selectedHour;
|
||||||
bool _isPm = false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_selectedHour = widget.initialTime.hour > 12
|
// Initialize the selectedHour with the initial time passed to the dialog
|
||||||
? widget.initialTime.hour - 12
|
selectedHour = widget.initialTime.hour.toString().padLeft(2, '0') + ':00';
|
||||||
: widget.initialTime.hour;
|
|
||||||
_isPm = widget.initialTime.period == DayPeriod.pm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Select Hour'),
|
title: const Text('Select Hour'),
|
||||||
content: Row(
|
content: DropdownButton<String>(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
value: selectedHour, // Show the currently selected hour
|
||||||
children: [
|
items: List.generate(24, (index) {
|
||||||
DropdownButton<int>(
|
String hour = index.toString().padLeft(2, '0');
|
||||||
value: _selectedHour,
|
return DropdownMenuItem<String>(
|
||||||
items: List.generate(12, (index) {
|
value: '$hour:00',
|
||||||
int displayHour = index + 1;
|
child: Text('$hour:00'),
|
||||||
return DropdownMenuItem(
|
);
|
||||||
value: displayHour,
|
}),
|
||||||
child: Text(displayHour.toString()),
|
onChanged: (String? newValue) {
|
||||||
);
|
if (newValue != null) {
|
||||||
}),
|
setState(() {
|
||||||
onChanged: (value) {
|
selectedHour = newValue; // Update the selected hour without closing the dialog
|
||||||
setState(() {
|
});
|
||||||
_selectedHour = value!;
|
}
|
||||||
});
|
},
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(width: 16.0),
|
|
||||||
DropdownButton<bool>(
|
|
||||||
value: _isPm,
|
|
||||||
items: const [
|
|
||||||
DropdownMenuItem(
|
|
||||||
value: false,
|
|
||||||
child: Text('AM'),
|
|
||||||
),
|
|
||||||
DropdownMenuItem(
|
|
||||||
value: true,
|
|
||||||
child: Text('PM'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
onChanged: (value) {
|
|
||||||
setState(() {
|
|
||||||
_isPm = value!;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(null),
|
onPressed: () => Navigator.of(context).pop(null), // Close the dialog without selection
|
||||||
child: const Text('Cancel'),
|
child: const Text('Cancel'),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
int hour = _isPm ? _selectedHour + 12 : _selectedHour;
|
// Close the dialog and return the selected time
|
||||||
Navigator.of(context).pop(TimeOfDay(hour: hour, minute: 0));
|
Navigator.of(context).pop(
|
||||||
|
TimeOfDay(
|
||||||
|
hour: int.parse(selectedHour.split(':')[0]),
|
||||||
|
minute: 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: const Text('OK'),
|
child: const Text('OK'),
|
||||||
),
|
),
|
||||||
@ -86,6 +69,7 @@ Future<TimeOfDay?> showHourPicker({
|
|||||||
required TimeOfDay initialTime,
|
required TimeOfDay initialTime,
|
||||||
}) {
|
}) {
|
||||||
return showDialog<TimeOfDay>(
|
return showDialog<TimeOfDay>(
|
||||||
|
barrierDismissible: false,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => HourPickerDialog(initialTime: initialTime),
|
builder: (context) => HourPickerDialog(initialTime: initialTime),
|
||||||
);
|
);
|
||||||
|
@ -21,13 +21,11 @@ class DeviceManagementPage extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
rightBody: const NavigateHomeGridView(),
|
rightBody: const NavigateHomeGridView(),
|
||||||
enableMenuSideba: isLargeScreenSize(context),
|
|
||||||
scaffoldBody: BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
|
scaffoldBody: BlocBuilder<DeviceManagementBloc, DeviceManagementState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (state is DeviceManagementLoading) {
|
if (state is DeviceManagementLoading) {
|
||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator());
|
||||||
} else if (state is DeviceManagementLoaded ||
|
} else if (state is DeviceManagementLoaded || state is DeviceManagementFiltered) {
|
||||||
state is DeviceManagementFiltered) {
|
|
||||||
final devices = state is DeviceManagementLoaded
|
final devices = state is DeviceManagementLoaded
|
||||||
? state.devices
|
? state.devices
|
||||||
: (state as DeviceManagementFiltered).filteredDevices;
|
: (state as DeviceManagementFiltered).filteredDevices;
|
||||||
|
@ -18,7 +18,7 @@ class HomeMobilePage extends StatelessWidget {
|
|||||||
canPop: false,
|
canPop: false,
|
||||||
onPopInvoked: (didPop) => false,
|
onPopInvoked: (didPop) => false,
|
||||||
child: WebScaffold(
|
child: WebScaffold(
|
||||||
enableMenuSideba: false,
|
enableMenuSidebar: false,
|
||||||
appBarTitle: Row(
|
appBarTitle: Row(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
@ -41,8 +41,7 @@ class HomeMobilePage extends StatelessWidget {
|
|||||||
SizedBox(height: size.height * 0.05),
|
SizedBox(height: size.height * 0.05),
|
||||||
const Text(
|
const Text(
|
||||||
'ACCESS YOUR APPS',
|
'ACCESS YOUR APPS',
|
||||||
style:
|
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
|
||||||
TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -52,8 +51,7 @@ class HomeMobilePage extends StatelessWidget {
|
|||||||
width: size.width * 0.68,
|
width: size.width * 0.68,
|
||||||
child: GridView.builder(
|
child: GridView.builder(
|
||||||
itemCount: 8,
|
itemCount: 8,
|
||||||
gridDelegate:
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 2,
|
||||||
crossAxisSpacing: 20.0,
|
crossAxisSpacing: 20.0,
|
||||||
mainAxisSpacing: 20.0,
|
mainAxisSpacing: 20.0,
|
||||||
@ -65,8 +63,7 @@ class HomeMobilePage extends StatelessWidget {
|
|||||||
active: homeItems[index]['active'],
|
active: homeItems[index]['active'],
|
||||||
name: homeItems[index]['title'],
|
name: homeItems[index]['title'],
|
||||||
img: homeItems[index]['icon'],
|
img: homeItems[index]['icon'],
|
||||||
onTap: () =>
|
onTap: () => homeBloc.homeItems[index].onPress(context),
|
||||||
homeBloc.homeItems[index].onPress(context),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -20,7 +20,7 @@ class HomeWebPage extends StatelessWidget {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final homeBloc = BlocProvider.of<HomeBloc>(context);
|
final homeBloc = BlocProvider.of<HomeBloc>(context);
|
||||||
return WebScaffold(
|
return WebScaffold(
|
||||||
enableMenuSideba: false,
|
enableMenuSidebar: false,
|
||||||
appBarTitle: Row(
|
appBarTitle: Row(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
|
@ -32,9 +32,9 @@ class VisitorPasswordBloc extends Bloc<VisitorPasswordEvent, VisitorPasswordStat
|
|||||||
on<SelectTimeEvent>(selectTimeOfLinePassword);
|
on<SelectTimeEvent>(selectTimeOfLinePassword);
|
||||||
on<ChangeTimeEvent>(changeTime);
|
on<ChangeTimeEvent>(changeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextEditingController userNameController = TextEditingController();
|
final TextEditingController userNameController = TextEditingController();
|
||||||
final TextEditingController emailController = TextEditingController();
|
final TextEditingController emailController = TextEditingController();
|
||||||
|
|
||||||
final TextEditingController deviceNameController = TextEditingController();
|
final TextEditingController deviceNameController = TextEditingController();
|
||||||
final TextEditingController deviceIdController = TextEditingController();
|
final TextEditingController deviceIdController = TextEditingController();
|
||||||
final TextEditingController unitNameController = TextEditingController();
|
final TextEditingController unitNameController = TextEditingController();
|
||||||
@ -51,6 +51,7 @@ class VisitorPasswordBloc extends Bloc<VisitorPasswordEvent, VisitorPasswordStat
|
|||||||
String accessTypeSelected = 'Online Password';
|
String accessTypeSelected = 'Online Password';
|
||||||
String usageFrequencySelected = 'One-Time';
|
String usageFrequencySelected = 'One-Time';
|
||||||
String passwordController = '';
|
String passwordController = '';
|
||||||
|
String accessPeriodValidate = '';
|
||||||
|
|
||||||
bool repeat = false;
|
bool repeat = false;
|
||||||
|
|
||||||
@ -75,13 +76,12 @@ class VisitorPasswordBloc extends Bloc<VisitorPasswordEvent, VisitorPasswordStat
|
|||||||
|
|
||||||
Future<void> selectTimeVisitorPassword(
|
Future<void> selectTimeVisitorPassword(
|
||||||
SelectTimeVisitorPassword event,
|
SelectTimeVisitorPassword event,
|
||||||
Emitter<VisitorPasswordState> emit,
|
Emitter<VisitorPasswordState> emit,) async {
|
||||||
) async {
|
|
||||||
final DateTime? picked = await showDatePicker(
|
final DateTime? picked = await showDatePicker(
|
||||||
context: event.context,
|
context: event.context,
|
||||||
initialDate: DateTime.now(),
|
initialDate: DateTime.now(),
|
||||||
firstDate: DateTime(2015, 8),
|
firstDate: DateTime(2015, 8),
|
||||||
lastDate: DateTime(3101),
|
lastDate: DateTime.now().add(const Duration(days: 5095)),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (picked != null) {
|
if (picked != null) {
|
||||||
@ -352,13 +352,15 @@ class VisitorPasswordBloc extends Bloc<VisitorPasswordEvent, VisitorPasswordStat
|
|||||||
context: event.context,
|
context: event.context,
|
||||||
initialDate: DateTime.now(),
|
initialDate: DateTime.now(),
|
||||||
firstDate: DateTime.now(),
|
firstDate: DateTime.now(),
|
||||||
lastDate: DateTime(3101),
|
lastDate: DateTime.now().add(const Duration(days: 2095)),
|
||||||
);
|
);
|
||||||
if (picked != null) {
|
if (picked != null) {
|
||||||
final TimeOfDay? timePicked = await showHourPicker(
|
final TimeOfDay? timePicked = await showHourPicker(
|
||||||
context: event.context,
|
context: event.context,
|
||||||
initialTime: TimeOfDay.now(),
|
initialTime: TimeOfDay.now(),
|
||||||
);
|
);
|
||||||
|
print('timePicked=$timePicked');
|
||||||
|
|
||||||
if (timePicked != null) {
|
if (timePicked != null) {
|
||||||
final selectedDateTime = DateTime(
|
final selectedDateTime = DateTime(
|
||||||
picked.year,
|
picked.year,
|
||||||
@ -377,19 +379,18 @@ class VisitorPasswordBloc extends Bloc<VisitorPasswordEvent, VisitorPasswordStat
|
|||||||
1000; // Divide by 1000 to remove milliseconds
|
1000; // Divide by 1000 to remove milliseconds
|
||||||
if (event.isEffective) {
|
if (event.isEffective) {
|
||||||
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
|
if (expirationTimeTimeStamp != null && selectedTimestamp > expirationTimeTimeStamp!) {
|
||||||
CustomSnackBar.displaySnackBar('Effective Time cannot be later than Expiration Time.');
|
accessPeriodValidate = "Effective Time cannot be later than Expiration Time.";
|
||||||
} else {
|
} else {
|
||||||
effectiveTime =
|
accessPeriodValidate = '';
|
||||||
selectedDateTime.toString().split('.').first; // Remove seconds and milliseconds
|
effectiveTime = selectedDateTime.toString().split('.').first;
|
||||||
effectiveTimeTimeStamp = selectedTimestamp;
|
effectiveTimeTimeStamp = selectedTimestamp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
|
if (effectiveTimeTimeStamp != null && selectedTimestamp < effectiveTimeTimeStamp!) {
|
||||||
CustomSnackBar.displaySnackBar(
|
accessPeriodValidate = 'Expiration Time cannot be earlier than Effective Time.';
|
||||||
'Expiration Time cannot be earlier than Effective Time.');
|
|
||||||
} else {
|
} else {
|
||||||
expirationTime =
|
accessPeriodValidate = '';
|
||||||
selectedDateTime.toString().split('.').first; // Remove seconds and milliseconds
|
expirationTime = selectedDateTime.toString().split('.').first;
|
||||||
expirationTimeTimeStamp = selectedTimestamp;
|
expirationTimeTimeStamp = selectedTimestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -448,7 +449,6 @@ class VisitorPasswordBloc extends Bloc<VisitorPasswordEvent, VisitorPasswordStat
|
|||||||
<Widget>[
|
<Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
||||||
Navigator.of(context).pop(true);
|
Navigator.of(context).pop(true);
|
||||||
},
|
},
|
||||||
child: const Text('OK'),
|
child: const Text('OK'),
|
||||||
|
@ -404,6 +404,9 @@ class VisitorPasswordDialog extends StatelessWidget {
|
|||||||
? visitorBloc.expirationTime
|
? visitorBloc.expirationTime
|
||||||
: visitorBloc.endTimeAccess.toString(),
|
: visitorBloc.endTimeAccess.toString(),
|
||||||
icon: Assets.calendarIcon),
|
icon: Assets.calendarIcon),
|
||||||
|
const SizedBox(height: 10,),
|
||||||
|
Text(visitorBloc.accessPeriodValidate,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium!.copyWith(color: ColorsManager.red),),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
|
@ -12,6 +12,7 @@ class AccessMangApi {
|
|||||||
path: ApiEndpoints.visitorPassword,
|
path: ApiEndpoints.visitorPassword,
|
||||||
showServerMessage: true,
|
showServerMessage: true,
|
||||||
expectedResponseModel: (json) {
|
expectedResponseModel: (json) {
|
||||||
|
print(json);
|
||||||
List<dynamic> jsonData = json;
|
List<dynamic> jsonData = json;
|
||||||
List<PasswordModel> passwordList = jsonData.map((jsonItem) {
|
List<PasswordModel> passwordList = jsonData.map((jsonItem) {
|
||||||
return PasswordModel.fromJson(jsonItem);
|
return PasswordModel.fromJson(jsonItem);
|
||||||
|
@ -41,3 +41,4 @@ BoxDecoration containerDecoration = BoxDecoration(
|
|||||||
],
|
],
|
||||||
color: ColorsManager.boxColor,
|
color: ColorsManager.boxColor,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(10)));
|
borderRadius: const BorderRadius.all(Radius.circular(10)));
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import 'package:syncrow_web/web_layout/web_app_bar.dart';
|
|||||||
import 'menu_sidebar.dart';
|
import 'menu_sidebar.dart';
|
||||||
|
|
||||||
class WebScaffold extends StatelessWidget with HelperResponsiveLayout {
|
class WebScaffold extends StatelessWidget with HelperResponsiveLayout {
|
||||||
final bool enableMenuSideba;
|
final bool enableMenuSidebar;
|
||||||
final Widget? appBarTitle;
|
final Widget? appBarTitle;
|
||||||
final Widget? centerBody;
|
final Widget? centerBody;
|
||||||
final Widget? rightBody;
|
final Widget? rightBody;
|
||||||
@ -17,7 +17,7 @@ class WebScaffold extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
this.centerBody,
|
this.centerBody,
|
||||||
this.rightBody,
|
this.rightBody,
|
||||||
this.scaffoldBody,
|
this.scaffoldBody,
|
||||||
this.enableMenuSideba = true,
|
this.enableMenuSidebar = false,
|
||||||
});
|
});
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -49,7 +49,7 @@ class WebScaffold extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (enableMenuSideba && !isSmall) const MenuSidebar(),
|
if (enableMenuSidebar && !isSmall) const MenuSidebar(),
|
||||||
Expanded(flex: 5, child: scaffoldBody!)
|
Expanded(flex: 5, child: scaffoldBody!)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -50,7 +50,6 @@ dependencies:
|
|||||||
dropdown_search: ^5.0.6
|
dropdown_search: ^5.0.6
|
||||||
flutter_dotenv: ^5.1.0
|
flutter_dotenv: ^5.1.0
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
Reference in New Issue
Block a user