mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
fixes add user view and table and user status
This commit is contained in:
@ -237,10 +237,11 @@ class _AddNewUserDialogState extends State<AddNewUserDialog> {
|
||||
onTap: () {
|
||||
setState(() {
|
||||
currentStep = step;
|
||||
bloc.add(CheckStepStatus(isEditUser: false));
|
||||
bloc.add(const CheckStepStatus(isEditUser: false));
|
||||
if (step3 == 3) {
|
||||
bloc.add(const CheckRoleStepStatus());
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
|
@ -47,7 +47,9 @@ class BasicsView extends StatelessWidget {
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.18,
|
||||
height: MediaQuery.of(context).size.width * 0.08,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -76,12 +78,12 @@ class BasicsView extends StatelessWidget {
|
||||
child: TextFormField(
|
||||
style:
|
||||
const TextStyle(color: ColorsManager.blackColor),
|
||||
onChanged: (value) {
|
||||
Future.delayed(const Duration(milliseconds: 200),
|
||||
() {
|
||||
_blocRole.add(ValidateBasicsStep());
|
||||
});
|
||||
},
|
||||
// onChanged: (value) {
|
||||
// Future.delayed(const Duration(milliseconds: 200),
|
||||
// () {
|
||||
// _blocRole.add(const ValidateBasicsStep());
|
||||
// });
|
||||
// },
|
||||
controller: _blocRole.firstNameController,
|
||||
decoration: inputTextFormDeco(
|
||||
hintText: "Enter first name",
|
||||
@ -103,7 +105,9 @@ class BasicsView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.18,
|
||||
height: MediaQuery.of(context).size.width * 0.08,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@ -128,12 +132,12 @@ class BasicsView extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextFormField(
|
||||
onChanged: (value) {
|
||||
Future.delayed(const Duration(milliseconds: 200),
|
||||
() {
|
||||
_blocRole.add(ValidateBasicsStep());
|
||||
});
|
||||
},
|
||||
// onChanged: (value) {
|
||||
// Future.delayed(const Duration(milliseconds: 200),
|
||||
// () {
|
||||
// _blocRole.add(ValidateBasicsStep());
|
||||
// });
|
||||
// },
|
||||
controller: _blocRole.lastNameController,
|
||||
style: const TextStyle(color: Colors.black),
|
||||
decoration:
|
||||
@ -186,13 +190,13 @@ class BasicsView extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextFormField(
|
||||
enabled: userId != '' ? false : true,
|
||||
onChanged: (value) {
|
||||
Future.delayed(const Duration(milliseconds: 200), () {
|
||||
_blocRole.add(CheckStepStatus(
|
||||
isEditUser: userId != '' ? false : true));
|
||||
_blocRole.add(ValidateBasicsStep());
|
||||
});
|
||||
},
|
||||
// onChanged: (value) {
|
||||
// Future.delayed(const Duration(milliseconds: 200), () {
|
||||
// _blocRole.add(CheckStepStatus(
|
||||
// isEditUser: userId != '' ? false : true));
|
||||
// _blocRole.add(ValidateBasicsStep());
|
||||
// });
|
||||
// },
|
||||
controller: _blocRole.emailController,
|
||||
style: const TextStyle(color: ColorsManager.blackColor),
|
||||
decoration: inputTextFormDeco(hintText: "name@example.com")
|
||||
|
@ -128,7 +128,7 @@ class _PermissionManagementState extends State<PermissionManagement> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
option.title,
|
||||
' ${option.title[0].toUpperCase()}${option.title.substring(1)}',
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
@ -184,7 +184,7 @@ class _PermissionManagementState extends State<PermissionManagement> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
subOption.title,
|
||||
' ${subOption.title[0].toUpperCase()}${subOption.title.substring(1)}',
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
@ -246,7 +246,7 @@ class _PermissionManagementState extends State<PermissionManagement> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
child.title,
|
||||
' ${child.title[0].toUpperCase()}${child.title.substring(1)}',
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12,
|
||||
|
@ -5,8 +5,8 @@ import 'package:syncrow_web/utils/style.dart';
|
||||
|
||||
Future<void> showPopUpFilterMenu({
|
||||
required BuildContext context,
|
||||
required Function(String value)? onSortAtoZ, // Accept a parameter
|
||||
required Function(String value)? onSortZtoA, // Accept a parameter
|
||||
required Function(String value)? onSortAtoZ,
|
||||
required Function(String value)? onSortZtoA,
|
||||
Function()? cancelButton,
|
||||
required Map<String, bool> checkboxStates,
|
||||
required RelativeRect position,
|
||||
|
@ -93,7 +93,7 @@ class UserTableBloc extends Bloc<UserTableEvent, UserTableState> {
|
||||
try {
|
||||
emit(UsersLoadingState());
|
||||
bool res = await UserPermissionApi().changeUserStatusById(
|
||||
event.userId, event.newStatus == "disabled" ? true : false);
|
||||
event.userId, event.newStatus == "disabled" ? false : true);
|
||||
if (res == true) {
|
||||
add(const GetUsers());
|
||||
// users = users.map((user) {
|
||||
|
@ -46,7 +46,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen>
|
||||
0.12; // 20% of screen width for the second column
|
||||
} else if (index == 9) {
|
||||
return newScreenWidth *
|
||||
0.2; // 25% of screen width for the tenth column
|
||||
0.1; // 25% of screen width for the tenth column
|
||||
}
|
||||
return newScreenWidth *
|
||||
0.09; // Default to 10% of screen width for other columns
|
||||
@ -57,14 +57,14 @@ class _DynamicTableScreenState extends State<DynamicTableScreen>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
if (columnWidths.every((width) => width == 120.0)) {
|
||||
if (columnWidths.every((width) => width == screenWidth * 7)) {
|
||||
columnWidths = List<double>.generate(widget.titles.length, (index) {
|
||||
if (index == 1) {
|
||||
return screenWidth * 0.11;
|
||||
} else if (index == 9) {
|
||||
return screenWidth * 0.2;
|
||||
return screenWidth * 0.1;
|
||||
}
|
||||
return screenWidth * 0.11;
|
||||
return screenWidth * 0.09;
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
|
Reference in New Issue
Block a user