Vacation rule added cont.

merge-requests/1/merge
Sikander Saleem 2 years ago
parent 60ed124873
commit 4edb19c2bb

@ -22,11 +22,14 @@ class MyColors {
static const Color darkWhiteColor = Color(0xffE0E0E0);
static const Color redColor = Color(0xffD02127);
static const Color yellowColor = Color(0xffF4E31C);
static const Color yellowFavColor = Color(0xffEAC321);
static const Color backgroundBlackColor = Color(0xff202529);
static const Color black = Color(0xff000000);
static const Color white = Color(0xffffffff);
static const Color green = Color(0xffffffff);
static const Color borderColor = Color(0xffE8E8E8);
static const Color borderE3Color = Color(0xffE3E3E3);
static const Color borderCEColor = Color(0xffCECECE);
//static const Color grey67Color = Color(0xff676767);
static const Color whiteColor = Color(0xFFEEEEEE);
static const Color greenColor = Color(0xff1FA269);

@ -41,7 +41,7 @@ extension WidgetExtensions on Widget {
child: this,
);
Widget objectContainerView({String title = ""}) {
Widget objectContainerView({String title = "", String note = ""}) {
return Container(
padding: const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14),
decoration: BoxDecoration(
@ -62,6 +62,7 @@ extension WidgetExtensions on Widget {
if (title.isNotEmpty) title.toText16(),
if (title.isNotEmpty) 12.height,
this,
if (note.isNotEmpty) note.toText11(),
],
),
);

@ -294,7 +294,7 @@ class GenericResponseModel {
String? registerUserNameList;
List<ReplacementList>? replacementList;
List<RespondAttributesList>? respondAttributesList;
String? respondRolesList;
List<String>? respondRolesList;
String? resubmitAbsenceTransactionList;
String? resubmitEITTransactionList;
String? resubmitHrTransactionList;
@ -1163,7 +1163,12 @@ class GenericResponseModel {
respondAttributesList!.add(new RespondAttributesList.fromJson(v));
});
}
respondRolesList = json['RespondRolesList'];
if (json['RespondRolesList'] != null) {
respondRolesList = <String>[];
json['RespondRolesList'].forEach((v) {
respondRolesList!.add(v);
});
}
resubmitAbsenceTransactionList = json['ResubmitAbsenceTransactionList'];
resubmitEITTransactionList = json['ResubmitEITTransactionList'];
resubmitHrTransactionList = json['ResubmitHrTransactionList'];

@ -1,7 +1,11 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/api/vacation_rule_api_client.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/vacation_rule/get_item_type_notifications_list_model.dart';
@ -9,8 +13,13 @@ import 'package:mohem_flutter_app/models/vacation_rule/get_notification_reassign
import 'package:mohem_flutter_app/models/vacation_rule/respond_attributes_list_model.dart';
import 'package:mohem_flutter_app/models/vacation_rule/vr_item_types_list_model.dart';
import 'package:mohem_flutter_app/models/vacation_rule/wf_look_up_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheets/search_employee_bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
class AddVacationRuleScreen extends StatefulWidget {
AddVacationRuleScreen({Key? key}) : super(key: key);
@ -23,14 +32,24 @@ class AddVacationRuleScreen extends StatefulWidget {
class _AddVacationRuleScreenState extends State<AddVacationRuleScreen> {
List<VrItemTypesList>? vrItemTypesList;
VrItemTypesList? selectedItemType;
List<GetItemTypeNotificationsList>? itemTypeNotificationsList;
GetItemTypeNotificationsList? selectedItemTypeNotification;
List<GetNotificationReassignModeList>? notificationReassignModeList;
GetNotificationReassignModeList? notificationReassignMode;
List<RespondAttributesList>? respondAttributesList;
List<WFLookUpList>? wfLookupList;
ReplacementList? selectedReplacementEmployee;
int currentStage = 0;
DateTime startTime = DateTime.now();
DateTime? endTime;
@override
void initState() {
super.initState();
@ -53,7 +72,8 @@ class _AddVacationRuleScreenState extends State<AddVacationRuleScreen> {
void getItemTypeNotificationsList() async {
try {
Utils.showLoading(context);
//itemTypeNotificationsList = await VacationRuleApiClient().getItemTypeNotifications();
itemTypeNotificationsList = await VacationRuleApiClient().getItemTypeNotifications(selectedItemType!.iTEMTYPE!);
itemTypeNotificationsList!.insert(0, GetItemTypeNotificationsList(nOTIFICATIONDISPLAYNAME: "All", nOTIFICATIONNAME: "*", fYIFLAG: "N"));
Utils.hideLoading(context);
currentStage = 2;
setState(() {});
@ -67,13 +87,31 @@ class _AddVacationRuleScreenState extends State<AddVacationRuleScreen> {
try {
Utils.showLoading(context);
List results = await Future.wait([
// VacationRuleApiClient().getNotificationReassignMode(),
// VacationRuleApiClient().getRespondAttributes("", ""),
VacationRuleApiClient().getNotificationReassignMode(),
VacationRuleApiClient().getRespondAttributes(selectedItemType!.iTEMTYPE!, selectedItemTypeNotification!.nOTIFICATIONNAME!),
// VacationRuleApiClient().getWfLookup(P_LOOKUP_TYPE),
]);
notificationReassignModeList = results[0];
if (selectedItemType!.iTEMTYPE != "*") {
notificationReassignModeList!.add(
GetNotificationReassignModeList(
rADIOBUTTONLABEL: "Deliver notifications to me regardless of any general rules",
rADIOBUTTONACTION: "deliver_notification",
rADIOBUTTONSEQ: 1,
),
);
}
if (selectedItemTypeNotification!.fYIFLAG == "Y") {
notificationReassignModeList!.add(
GetNotificationReassignModeList(
rADIOBUTTONLABEL: "Close",
rADIOBUTTONACTION: "close",
rADIOBUTTONSEQ: 1,
),
);
}
respondAttributesList = results[1];
wfLookupList = results[2];
// wfLookupList = results[2];
Utils.hideLoading(context);
currentStage = 3;
setState(() {});
@ -94,7 +132,7 @@ class _AddVacationRuleScreenState extends State<AddVacationRuleScreen> {
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.vacationRule.tr(),
title: LocaleKeys.vacationRule.tr(), // todo @Sikander change title to 'Vacation Type'
),
body: vrItemTypesList == null
? const SizedBox()
@ -105,20 +143,199 @@ class _AddVacationRuleScreenState extends State<AddVacationRuleScreen> {
ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [],
children: [
if (vrItemTypesList!.isNotEmpty)
PopupMenuButton(
child: DynamicTextFieldWidget(
LocaleKeys.itemType.tr(),
selectedItemType == null ? "Select Type" : selectedItemType!.iTEMTYPEDISPLAYNAME!,
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < vrItemTypesList!.length; i++) PopupMenuItem<int>(value: i, child: Text(vrItemTypesList![i].iTEMTYPEDISPLAYNAME!)),
],
onSelected: (int popupIndex) {
if (selectedItemType == vrItemTypesList![popupIndex]) {
return;
}
selectedItemType = vrItemTypesList![popupIndex];
setState(() {});
if (selectedItemType!.iTEMTYPE == "*") {
selectedItemTypeNotification = GetItemTypeNotificationsList(nOTIFICATIONDISPLAYNAME: "All", nOTIFICATIONNAME: "*", fYIFLAG: "N");
itemTypeNotificationsList = null;
notificationReassignMode = null;
callCombineApis();
} else {
selectedItemTypeNotification = null;
notificationReassignMode = null;
getItemTypeNotificationsList();
}
}).objectContainerView(title: "Apply for Vacation Rule\nStep 1", note: "*If All is selected, you will skip to step 3"),
if ((itemTypeNotificationsList ?? []).isNotEmpty) ...[
12.height,
PopupMenuButton(
child: DynamicTextFieldWidget(
"Notification",
selectedItemTypeNotification == null ? "Select Notification" : selectedItemTypeNotification!.nOTIFICATIONDISPLAYNAME!,
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < itemTypeNotificationsList!.length; i++) PopupMenuItem<int>(value: i, child: Text(itemTypeNotificationsList![i].nOTIFICATIONDISPLAYNAME!)),
],
onSelected: (int popupIndex) {
if (selectedItemTypeNotification == itemTypeNotificationsList![popupIndex]) {
return;
}
selectedItemTypeNotification = itemTypeNotificationsList![popupIndex];
notificationReassignMode = null;
setState(() {});
callCombineApis();
}).objectContainerView(title: "Step 2")
],
if (selectedItemType != null && selectedItemTypeNotification != null && currentStage == 3) ...[
12.height,
Column(
children: [
ItemDetailView(LocaleKeys.itemType.tr(), selectedItemType!.iTEMTYPEDISPLAYNAME!),
ItemDetailView("Notification", selectedItemTypeNotification!.nOTIFICATIONDISPLAYNAME!),
12.height,
DynamicTextFieldWidget(
"Start Date",
formattedDate(startTime),
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
var start = await _selectDateTime(context, startTime);
if (start != startTime) {
startTime = start;
setState(() {});
}
},
),
12.height,
DynamicTextFieldWidget(
"End Date",
formattedDate(endTime),
suffixIconData: Icons.calendar_today,
isEnable: false,
onTap: () async {
var end = await _selectDateTime(context, endTime ?? startTime);
if (end != endTime) {
endTime = end;
setState(() {});
}
},
),
12.height,
DynamicTextFieldWidget(
"Message",
"Write a message",
lines: 2,
onChange: (message) {},
// isEnable: false,
// isPopup: true,
).paddingOnly(bottom: 12),
PopupMenuButton(
child: DynamicTextFieldWidget(
"Notification Reassign",
notificationReassignMode == null ? "Select Notification" : notificationReassignMode!.rADIOBUTTONLABEL ?? "",
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < notificationReassignModeList!.length; i++) PopupMenuItem<int>(value: i, child: Text(notificationReassignModeList![i].rADIOBUTTONLABEL!)),
],
onSelected: (int popupIndex) {
if (notificationReassignMode == notificationReassignModeList![popupIndex]) {
return;
}
notificationReassignMode = notificationReassignModeList![popupIndex];
setState(() {});
}),
DynamicTextFieldWidget(
"Select Employee",
selectedReplacementEmployee == null ? "Search employee for replacement" : selectedReplacementEmployee!.employeeDisplayName ?? "",
isEnable: false,
onTap: () {
showMyBottomSheet(
context,
child: SearchEmployeeBottomSheet(
title: "Search for Employee",
apiMode: "DELEGATE",
onSelectEmployee: (_selectedEmployee) {
// Navigator.pop(context);
selectedReplacementEmployee = _selectedEmployee;
setState(() {});
},
),
);
},
).paddingOnly(bottom: 12),
],
).objectContainerView(title: "Step 3")
]
],
).expanded,
DefaultButton(
currentStage == 3 ? LocaleKeys.apply.tr() : LocaleKeys.next.tr(),
() {
if (currentStage == 1) {
getItemTypeNotificationsList();
} else if (currentStage == 2) {
callCombineApis();
}
},
LocaleKeys.apply.tr(),
currentStage != 3
? null
: () {
if (currentStage == 1) {
getItemTypeNotificationsList();
} else if (currentStage == 2) {
callCombineApis();
}
},
).insideContainer,
],
)),
);
}
Future<DateTime> _selectDateTime(BuildContext context, DateTime _time) async {
DateTime time = _time;
if (Platform.isIOS) {
await showCupertinoModalPopup(
context: context,
builder: (cxt) => Container(
height: 250,
color: Colors.white,
child: CupertinoDatePicker(
backgroundColor: Colors.white,
mode: CupertinoDatePickerMode.dateAndTime,
onDateTimeChanged: (value) {
if (value != _time) {
time = value;
}
},
initialDateTime: _time,
),
),
);
} else {
final DateTime? picked = await showDatePicker(context: context, initialDate: _time, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
final TimeOfDay? timePicked = await showTimePicker(
context: context,
initialTime: TimeOfDay.fromDateTime(picked!),
);
if (picked != _time || timePicked != TimeOfDay.fromDateTime(picked)) {
time = picked;
time = time.add(
Duration(
hours: timePicked!.hour,
minutes: timePicked.minute,
),
);
}
}
return time;
}
String formattedDate(DateTime? _time) {
if (_time == null) return "Select date and time";
return DateFormat("MM/dd/yyyy hh:mm:ss a").format(_time);
}
}

@ -109,14 +109,14 @@ class _DelegateSheetState extends State<DelegateSheet> {
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(21),
padding: const EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.title.toText24(),
24.height,
widget.title.toText24(isBold: true),
21.height,
"Search".toText16(),
20.height,
11.height,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@ -148,7 +148,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
),
),
Container(
height: 24,
height: 36,
width: 1,
color: Color(0xffE5E5E5),
),
@ -156,17 +156,9 @@ class _DelegateSheetState extends State<DelegateSheet> {
padding: EdgeInsets.all(8),
child: Row(
children: [
Text(
selectedType,
style: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
selectedType.toText12(),
4.width,
Icon(
const Icon(
Icons.keyboard_arrow_down,
color: Colors.black,
size: 16,
@ -269,7 +261,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
@ -286,7 +278,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
@ -371,11 +363,11 @@ class _DelegateSheetState extends State<DelegateSheet> {
width: 30,
isImageBase64: true,
),
16.width,
Expanded(
child: (actionHistory.nAME ?? "").toText12(),
),
9.width,
(actionHistory.nAME ?? "").toText12().expanded,
IconButton(
padding: EdgeInsets.zero,
constraints: const BoxConstraints(),
onPressed: () {
actionHistory.isFavorite = true;
fetchChangeFav(

@ -37,12 +37,12 @@ class SelectedItemSheet extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.toText24(),
24.height,
title.toText24(isBold: true),
21.height,
if (actionHistoryList != null) showItem(actionHistoryList!.nAME, actionHistoryList!.isFavorite),
if (favoriteReplacements != null) showItem(favoriteReplacements!.employeeDisplayName, true),
if (replacementList != null) showItem(replacementList!.employeeDisplayName, replacementList!.isFavorite),
12.height,
14.height,
InputWidget(
"Enter a note",
"This is simple note",
@ -61,7 +61,7 @@ class SelectedItemSheet extends StatelessWidget {
Container(
width: double.infinity,
height: 1,
color: MyColors.borderColor,
color: MyColors.borderE3Color,
),
Row(
children: [

@ -8,11 +8,11 @@ void showMyBottomSheet(BuildContext context, {required Widget child}) {
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return Container(
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(24),
topLeft: Radius.circular(24),
topRight: Radius.circular(25),
topLeft: Radius.circular(25),
),
),
clipBehavior: Clip.antiAlias,
@ -20,12 +20,12 @@ void showMyBottomSheet(BuildContext context, {required Widget child}) {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
8.height,
13.height,
Container(
height: 6,
width: 60,
decoration: BoxDecoration(
color: Colors.grey[200],
decoration: const BoxDecoration(
color: Color(0xff9A9A9A),
borderRadius: BorderRadius.all(
Radius.circular(20),
),

@ -0,0 +1,224 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mohem_flutter_app/api/worklist/worklist_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart';
class SearchEmployeeBottomSheet extends StatefulWidget {
int? notificationID;
String title, apiMode;
List<GetActionHistoryList>? actionHistoryList;
Function(ReplacementList) onSelectEmployee;
SearchEmployeeBottomSheet({required this.title, required this.apiMode, this.notificationID, this.actionHistoryList, required this.onSelectEmployee});
@override
State<SearchEmployeeBottomSheet> createState() => _SearchEmployeeBottomSheetState();
}
class _SearchEmployeeBottomSheetState extends State<SearchEmployeeBottomSheet> {
TextEditingController username = TextEditingController();
String searchText = "";
List<String>? optionsList = [
LocaleKeys.fullName.tr(),
LocaleKeys.username.tr(),
LocaleKeys.endDate.tr(),
];
List<GetFavoriteReplacements>? favUsersList;
List<ReplacementList>? replacementList;
List<ReplacementList>? favouriteUserList;
List<ReplacementList>? nonFavouriteUserList;
int _selectedSearchIndex = 0;
void fetchUserByInput({bool isNeedLoading = true}) async {
try {
Utils.showLoading(context);
replacementList = await WorkListApiClient().searchUserByInput(
userName: _selectedSearchIndex == 0 ? searchText : "",
userId: _selectedSearchIndex == 1 ? searchText : "",
email: _selectedSearchIndex == 2 ? searchText : "",
);
favouriteUserList = replacementList?.where((element) => element.isFavorite ?? false).toList();
nonFavouriteUserList = replacementList?.where((element) => !(element.isFavorite ?? false)).toList();
Utils.hideLoading(context);
setState(() {});
} catch (e) {
Utils.hideLoading(context);
Utils.handleException(e, context, null);
}
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
return null;
}
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: MediaQuery.of(context).size.height - 100,
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.title.toText24(isBold: true),
21.height,
"Search".toText16(),
11.height,
Row(
children: [
radioOption("Name", 0, _selectedSearchIndex),
radioOption("User Name", 1, _selectedSearchIndex),
radioOption("Email", 2, _selectedSearchIndex),
],
),
14.height,
Row(
children: [
DynamicTextFieldWidget(
"Search",
"Search By Username",
inputAction: TextInputAction.done,
suffixIconData: Icons.search,
onChange: (text) {
searchText = text;
setState(() {});
},
).expanded,
IconButton(
constraints: const BoxConstraints(),
onPressed: () async {
await SystemChannels.textInput.invokeMethod('TextInput.hide');
fetchUserByInput();
},
icon: Icon(Icons.search))
],
),
if (replacementList != null)
replacementList!.isEmpty
? Utils.getNoDataWidget(context).expanded
: ListView(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 21, bottom: 8),
children: [
if (favouriteUserList?.isNotEmpty ?? false) ...[
"Favorites".toText16(),
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, index) => employeeItemView(favouriteUserList![index]),
separatorBuilder: (cxt, index) => Container(
height: 1,
color: MyColors.borderE3Color,
),
itemCount: favouriteUserList?.length ?? 0),
12.height,
],
if (nonFavouriteUserList?.isNotEmpty ?? false) ...[
"Related".toText16(),
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, index) => employeeItemView(nonFavouriteUserList![index]),
separatorBuilder: (cxt, index) => Container(
height: 1,
color: MyColors.borderE3Color,
),
itemCount: nonFavouriteUserList?.length ?? 0),
]
],
).expanded
],
).paddingOnly(left: 21, right: 21, bottom: 0, top: 21).expanded,
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
DefaultButton(
LocaleKeys.cancel.tr(),
() {
Navigator.pop(context);
},
textColor: MyColors.grey3AColor,
colors: const [
Color(0xffE6E6E6),
Color(0xffE6E6E6),
],
).insideContainer
],
),
);
}
Widget employeeItemView(ReplacementList replacement) {
return InkWell(
onTap: () {
Navigator.pop(context);
widget.onSelectEmployee(replacement);
},
child: SizedBox(
height: 50,
child: Row(
children: [
CircularAvatar(
url: replacement.employeeImage ?? "",
height: 30,
width: 30,
isImageBase64: true,
),
16.width,
Expanded(
child: (replacement.employeeDisplayName ?? "").toText12(),
),
Icon(Icons.star, size: 16, color: replacement.isFavorite! ? MyColors.yellowFavColor : MyColors.borderCEColor),
],
),
),
);
}
Widget radioOption(String title, int value, int groupValue) {
return Row(
children: [
Container(
width: 24,
height: 24,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(color: MyColors.borderColor, width: 1),
borderRadius: const BorderRadius.all(Radius.circular(100)),
),
padding: const EdgeInsets.all(4),
child: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: value == groupValue ? MyColors.grey3AColor : Colors.transparent,
borderRadius: BorderRadius.all(const Radius.circular(100)),
),
),
),
9.width,
title.toText12(color: MyColors.grey57Color)
],
).onPress(() {
_selectedSearchIndex = value;
setState(() {});
}).expanded;
}
}

@ -8,6 +8,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
final VoidCallback? onTap;
final IconData? suffixIconData;
final bool isEnable;
final TextInputAction? inputAction;
final bool isReadOnly;
final bool isPopup;
final int? lines;
@ -24,6 +25,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
this.isReadOnly = false,
this.isPopup = false,
this.lines = 1,
this.inputAction,
this.onChange,
this.isInputTypeNum = false,
this.isBackgroundEnable = false});
@ -62,6 +64,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero, readOnly: isReadOnly,
textInputAction: inputAction,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
//controller: controller,
maxLines: lines,
@ -99,7 +102,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
),
),
if (isPopup) const Icon(Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor),
if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor,size: 20),
if (onTap != null) Icon(suffixIconData ?? Icons.keyboard_arrow_down_outlined, color: MyColors.darkIconColor),
],
),
),

Loading…
Cancel
Save