dark mode fixes

design_3.0_dark_mode
WaseemAbbasi22 3 months ago
parent 0f7a8e0955
commit 8d9aacb870

@ -94,8 +94,8 @@ class FooterActionButton {
context: context,
child: AppFilledButton(
label: context.translation.activities,
buttonColor: AppColor.neutral50,
textColor: context.isDark ? AppColor.neutral30 : Colors.white,
buttonColor: context.isDark? AppColor.primary10:AppColor.neutral50,
textColor: context.isDark ? AppColor.black10 : Colors.white,
onPressed: () async {
Navigator.push(context, MaterialPageRoute(builder: (context) => const ActivitiesListView()));
},
@ -209,9 +209,8 @@ class FooterActionButton {
children: [
AppFilledButton(
label: context.translation.activities,
// maxWidth: true,
textColor: context.isDark ? AppColor.neutral30 : Colors.white,
buttonColor: AppColor.neutral50,
textColor: context.isDark ? AppColor.black10 : Colors.white,
buttonColor: context.isDark? AppColor.primary10:AppColor.neutral50,
onPressed: () async {
// ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
Navigator.push(context, MaterialPageRoute(builder: (context) => const ActivitiesListView()));

@ -30,7 +30,7 @@ class AssetDetailCard extends StatelessWidget {
textColor: AppColor.white10,
backgroundColor: AppColor.getEquipmentStatusColor(context, requestDetailProvider.engineerUpdateWorkOrderHelperModel!.equipmentStatus!.id ?? 0),
),
if(requestDetailProvider.engineerUpdateWorkOrderHelperModel?.cmFrameId!=null)...[
if (requestDetailProvider.engineerUpdateWorkOrderHelperModel?.cmFrameId != null) ...[
6.width,
StatusLabel(
label: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.cmFrameId?.name,
@ -52,7 +52,7 @@ class AssetDetailCard extends StatelessWidget {
),
//hide if status is closed or complete .
if (!requestDetailProvider.isReadOnlyRequest)
"edit_icon".toSvgAsset(height: 21, width: 21).onPress(() async {
"edit_icon".toSvgAsset(height: 21, width: 21, color: context.isDark ? AppColor.primary10 : null).onPress(() async {
requestDetailProvider.refreshTimer = false;
await Navigator.push(context, MaterialPageRoute(builder: (context) => VerifyAssetDetails(isEdit: true)));
requestDetailProvider.refreshTimer = true;
@ -98,7 +98,9 @@ class AssetDetailCard extends StatelessWidget {
),
]
],
).toShadowContainer(context,);
).toShadowContainer(
context,
);
});
}
}

@ -497,6 +497,7 @@ class _ServiceRequestDetailViewState extends State<ServiceRequestDetailView> {
).expanded,
if (!provider.isReadOnlyRequest)
"edit_icon".toSvgAsset(height: 21, width: 21,
color: context.isDark?AppColor.primary10:null
).onPress(() async {
provider.refreshTimer = false;
await Navigator.push(context, MaterialPageRoute(builder: (context) => CostDetailFormScreen(isEdit: true)));

@ -75,7 +75,7 @@ class _AssetRetiredState extends State<AssetRetired> with TickerProviderStateMix
SingleItemDropDownMenu<Lookup, RetirementTypeProvider>(
context: context,
title: context.translation.retirementType,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
showAsBottomSheet: true,
height: 56.toScreenHeight,
showShadow: false,

@ -131,7 +131,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
ADatePicker(
label: context.translation.returnToService,
hideShadow: true,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
// initialDate: DateTime.tryParse(requestDetailProvider.engineerUpdateWorkOrderHelperModel?.returnToService ?? ""),
from: requestDetailProvider.currentWorkOrder?.data?.requestedDate,
date: DateTime.tryParse(requestDetailProvider.engineerUpdateWorkOrderHelperModel?.returnToService ?? ""),
@ -167,7 +167,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
SingleItemDropDownMenu<Lookup, WoFrameProvider>(
context: context,
title: "WO Frame",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
height: 56.toScreenHeight,
showShadow: false,
initialValue: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.cmFrameId,
@ -181,7 +181,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
SingleItemDropDownMenu<Lookup, ReasonProvider>(
context: context,
title: context.translation.failureReason,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
height: 56.toScreenHeight,
showShadow: false,
initialValue: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.failureReason,
@ -195,7 +195,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
SingleItemDropDownMenu<FaultDescription, NullableLoadingProvider>(
context: context,
title: context.translation.faultDescription,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
staticData: _faults,
showShadow: false,
initialValue: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.faultDescription,
@ -219,7 +219,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
SingleItemDropDownMenu<Lookup, LoanAvailabilityProvider>(
context: context,
title: context.translation.loanAvailability,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
height: 56.toScreenHeight,
showShadow: false,
initialValue: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.loanAvailability,
@ -250,7 +250,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
ADatePicker(
label: "EDD",
hideShadow: true,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
// initialDate: DateTime.tryParse(requestDetailProvider.engineerUpdateWorkOrderHelperModel?.edd ?? ""),
from: requestDetailProvider.currentWorkOrder?.data?.requestedDate,
date: DateTime.tryParse(requestDetailProvider.engineerUpdateWorkOrderHelperModel?.edd ?? ""),
@ -284,10 +284,10 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
12.height,
AppTextFormField(
labelText: context.translation.callResponse,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
initialValue: requestDetailProvider.engineerUpdateWorkOrderHelperModel?.callResponse,
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
showShadow: false,
onChange: (value) {
requestDetailProvider.engineerUpdateWorkOrderHelperModel?.callResponse = value;
@ -376,7 +376,7 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
context.translation.assetStatus.bodyText(context).custom(color: AppColor.black20),
context.translation.assetStatus.bodyText(context).custom(color: AppColor.textColor(context)),
8.height,
Wrap(
runSpacing: 8,

@ -86,11 +86,11 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
// ),
// 8.height,
AppTextFormField(
labelText: "Labor Cost",
backgroundColor: AppColor.neutral100,
initialValue: requestDetailProvider.workOrderCostModel?.labourCost?.toString(),
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
labelText: "Labor Cost",
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
@ -101,10 +101,10 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
8.height,
AppTextFormField(
labelText: "Travel Cost",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
initialValue: requestDetailProvider.workOrderCostModel?.travelCost?.toString(),
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
@ -115,10 +115,10 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
8.height,
AppTextFormField(
labelText: "Quot Amount",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
initialValue: requestDetailProvider.workOrderCostModel?.qAmount?.toString(),
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
@ -129,10 +129,10 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
8.height,
AppTextFormField(
labelText: "PR No",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
initialValue: requestDetailProvider.workOrderCostModel?.prNo,
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
@ -143,10 +143,10 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
8.height,
AppTextFormField(
labelText: "PO No",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
initialValue: requestDetailProvider.workOrderCostModel?.poNo,
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
@ -157,10 +157,10 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
8.height,
AppTextFormField(
labelText: "MR No",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
initialValue: requestDetailProvider.workOrderCostModel?.mrNo,
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: TextInputType.text,
showShadow: false,
onChange: (value) {
@ -171,10 +171,10 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
8.height,
AppTextFormField(
labelText: "Exchange Cost",
backgroundColor: AppColor.neutral100,
initialValue: requestDetailProvider.workOrderCostModel?.exchangeCost!=null?requestDetailProvider.workOrderCostModel?.exchangeCost.toString():'',
backgroundColor: AppColor.fieldBgColor(context),
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
initialValue: requestDetailProvider.workOrderCostModel?.exchangeCost != null ? requestDetailProvider.workOrderCostModel?.exchangeCost.toString() : '',
textAlign: TextAlign.center,
labelStyle: AppTextStyles.textFieldLabelStyle,
textInputType: const TextInputType.numberWithOptions(decimal: true),
showShadow: false,
onChange: (value) {
@ -187,7 +187,7 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
).expanded,
Container(
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
color: AppColor.white10,
color: AppColor.background(context),
child: AppFilledButton(
label: "Update Cost Details",
buttonColor: AppColor.primary10,
@ -264,7 +264,7 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
],
)
],
).toShimmer(isShow: snapshot.loading,context: context),
).toShimmer(isShow: snapshot.loading, context: context),
],
);
});

@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:test_sa/controllers/providers/api/gas_refill_comments.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
@ -28,10 +30,10 @@ class _RoomInspectionCardState extends State<RoomInspectionCard> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.inspectionModel!.tabName!.bodyText(context).custom(color: AppColor.neutral50, fontWeight: FontWeight.w600),
widget.inspectionModel!.tabName!.bodyText(context).custom(color:AppColor.textColor(context), fontWeight: FontWeight.w600),
8.height,
Container(
color: Colors.white10,
color: context.isDark?null: Colors.white10,
child: Column(
children: widget.inspectionModel!.planRecurrentMedicalTaskRoomTabAttributes?.asMap().entries.map<Widget>((entry) {
final model = entry.value;
@ -66,7 +68,7 @@ class _RoomInspectionCardState extends State<RoomInspectionCard> {
model.attribute?.name ?? '',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: AppTextStyles.bodyText2.copyWith(color: AppColor.white936),
style: AppTextStyles.bodyText2.copyWith(color: context.isDark?Colors.white:AppColor.white936),
),
(status ? 'Pass' : 'Fail').bodyText2(context).custom(color: AppColor.neutral120, fontWeight: FontWeight.w500),
],
@ -83,7 +85,7 @@ class _RoomInspectionCardState extends State<RoomInspectionCard> {
height: 30.toScreenHeight,
padding: EdgeInsetsDirectional.all(4.toScreenHeight),
decoration: BoxDecoration(
color: AppColor.white80,
color: AppColor.fieldBgColor(context),
borderRadius: BorderRadius.circular(5),
),
child: Row(
@ -94,14 +96,14 @@ class _RoomInspectionCardState extends State<RoomInspectionCard> {
isActive: status,
activeColor: AppColor.green20,
inactiveColor: Colors.transparent,
textColor: status ? AppColor.green50 : AppColor.black20,
textColor: status ? AppColor.green50 : context.isDark?Colors.white: AppColor.black20,
),
buildToggleOption(
label: "FAIL",
isActive: !status,
activeColor: AppColor.red20,
inactiveColor: Colors.transparent,
textColor: status ? AppColor.black20 : AppColor.red30,
textColor: status ? context.isDark?Colors.white: AppColor.black20 : AppColor.red30,
),
],
),
@ -188,14 +190,14 @@ class _RoomInspectionCardState extends State<RoomInspectionCard> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
model.attribute!.name!.bodyText2(context).custom(color: AppColor.white936, fontWeight: FontWeight.w500),
model.attribute!.name!.bodyText2(context).custom(color: context.isDark?Colors.white:AppColor.white936, fontWeight: FontWeight.w500),
TextFormField(
keyboardType: TextInputType.number,
initialValue: model.attributeValue ?? '',
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(horizontal: 5.toScreenWidth),
filled: true,
fillColor: AppColor.neutral100,
fillColor: AppColor.fieldBgColor(context),
constraints: BoxConstraints(
maxWidth: 99.toScreenWidth,
maxHeight: 30.toScreenHeight,

@ -67,7 +67,7 @@ class _RoomTabsWidgetState extends State<RoomTabsWidget> {
color: selectedIndex == index ? (context.isDark ? AppColor.neutral60 : AppColor.neutral110) : Colors.transparent,
borderRadius: BorderRadius.circular(7),
),
child: label.bodyText(context).custom(color: AppColor.white936),
child: label.bodyText(context).custom(color:context.isDark?Colors.white: AppColor.white936),
),
);
}).toList(),

@ -35,7 +35,7 @@ class RecurrentTaskInfoWidget extends StatelessWidget {
backgroundColor: AppColor.getRequestStatusColorByName(context, model?.status?.name),
),
8.height,
model!.title!.bodyText(context).custom(color: AppColor.black10),
model!.title!.bodyText(context).custom(color: AppColor.textColor(context)),
2.height,
'${context.translation.taskNo}: ${model!.taskNo!}'.bodyText2(context).custom(color: AppColor.neutral120),
'${context.translation.site}: ${model!.site!.siteName!}'.bodyText2(context).custom(color: AppColor.neutral120),
@ -79,7 +79,7 @@ class RecurrentTaskInfoWidget extends StatelessWidget {
width: double.infinity,
enabled: snapshot.recurrentWoData?.status?.value != 1,
decoration: BoxDecoration(
color: AppColor.neutral100,
color: AppColor.fieldBgColor(context),
borderRadius: BorderRadius.circular(10),
),
pickerTimer: model?.recurrentWoTimePicker,
@ -103,7 +103,7 @@ class RecurrentTaskInfoWidget extends StatelessWidget {
8.width,
Text(
ServiceRequestUtils.formatTimerDuration(totalWorkingHours.round()),
style: AppTextStyles.bodyText.copyWith(color: AppColor.neutral50, fontWeight: FontWeight.w600),
style: AppTextStyles.bodyText.copyWith(color: AppColor.textColor(context), fontWeight: FontWeight.w600),
),
],
),
@ -117,9 +117,10 @@ class RecurrentTaskInfoWidget extends StatelessWidget {
return AppTextFormField(
initialValue: model?.comment,
labelText: context.translation.comment,
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle,
hintStyle: TextStyle(color: context.isDark?AppColor.white10:AppColor.black10),
labelStyle: TextStyle(color: context.isDark?AppColor.white10:AppColor.black10),
alignLabelWithHint: true,
textInputType: TextInputType.multiline,
onChange: (value) {
@ -145,8 +146,8 @@ Widget buildingInfoWidget({required String label, required String? value, requir
3.height,
Text(
value ?? '',
style: AppTextStyles.bodyText2.copyWith(color: AppColor.black10),
style: AppTextStyles.bodyText2.copyWith(color: AppColor.textColor(context)),
)
],
).toShadowContainer(context, backgroundColor: AppColor.neutral100, borderRadius: 10, paddingObject: EdgeInsets.all(12.toScreenHeight), showShadow: false);
).toShadowContainer(context, backgroundColor: AppColor.background(context), borderRadius: 10, paddingObject: EdgeInsets.all(12.toScreenHeight), showShadow: false);
}

@ -86,14 +86,15 @@ class _RecurrentWorkOrderViewState extends State<RecurrentWorkOrderView> {
children: [
AppFilledButton(
label: context.translation.save,
buttonColor: AppColor.white60,
textColor: AppColor.black10,
buttonColor: context.isDark?AppColor.neutral20: AppColor.white60,
textColor: context.isDark?Colors.white: AppColor.black10,
onPressed: () => _updateTask(context: context, status: 0),
).expanded,
12.width,
AppFilledButton(
label: context.translation.complete,
buttonColor: AppColor.primary10,
// textColor: context.isDark?Colors.white: AppColor.black10,
onPressed: () => _updateTask(context: context, status: 1),
).expanded,
],

@ -273,7 +273,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
// ? (!(_model?.senderMachineStatusName?.toLowerCase()?.contains("close") ?? false) && !(_model?.senderMachineStatusName?.toLowerCase()?.contains("complete") ?? false))
// : (!(_model?.receiverMachineStatusName?.toLowerCase()?.contains("close") ?? false) && !(_model?.receiverMachineStatusName?.toLowerCase()?.contains("complete") ?? false)))
//
"edit".toSvgAsset(height: 48, width: 48).onPress(() async {
"edit".toSvgAsset(height: 48, width: 48).onPress(() async {
bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: isSender)))) as bool;
if (isReload ?? false) {
setState(() {});

@ -252,7 +252,8 @@ class _UpdateDeviceTransferState extends State<UpdateDeviceTransfer> {
AppTextFormField(
initialValue: widget.isSender ? _formModel.senderComment ?? "" : _formModel.receiverComment ?? "",
labelText: context.translation.technicalComment,
labelStyle: AppTextStyles.tinyFont.copyWith(color: AppColor.neutral20),
hintStyle: AppTextStyles.tinyFont.copyWith(color: context.isDark?AppColor.white10:AppColor.black10),
labelStyle: AppTextStyles.tinyFont.copyWith(color: context.isDark?AppColor.white10:AppColor.black10),
textInputType: TextInputType.multiline,
backgroundColor: AppColor.fieldBgColor(context),
showShadow: false,

@ -175,7 +175,7 @@ class _ProfilePageState extends State<ProfilePage> {
16.height,
AppFilledButton(
label: "Update Information",
buttonColor: AppColor.neutral50,
buttonColor: context.isDark? AppColor.primary10:AppColor.neutral50,
onPressed: () {
showModalBottomSheet(
context: context,

@ -56,7 +56,7 @@ class _UpdateUserContactInfoBottomSheetState extends State<UpdateUserContactInfo
16.height,
AppTextFormField(
labelText: "Email",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
initialValue: widget.uEmail,
textAlign: TextAlign.center,
hintText: "email@example.com",
@ -72,7 +72,7 @@ class _UpdateUserContactInfoBottomSheetState extends State<UpdateUserContactInfo
12.height,
AppTextFormField(
labelText: "Phone Number",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
initialValue: widget.uPhoneNo,
textAlign: TextAlign.center,
hintText: "05xxxxxxxx",
@ -88,7 +88,7 @@ class _UpdateUserContactInfoBottomSheetState extends State<UpdateUserContactInfo
12.height,
AppTextFormField(
labelText: "Extension No",
backgroundColor: AppColor.neutral100,
backgroundColor: AppColor.fieldBgColor(context),
initialValue: widget.uExtensionNo,
textAlign: TextAlign.center,
hintText: "1234",
@ -104,7 +104,7 @@ class _UpdateUserContactInfoBottomSheetState extends State<UpdateUserContactInfo
12.height,
AppFilledButton(
label: "Update",
buttonColor: AppColor.neutral50,
buttonColor: context.isDark? AppColor.primary10:AppColor.neutral50,
onPressed: () async {
FocusManager.instance.primaryFocus!.unfocus();
if (email.isEmpty || !Validator.isEmail(email)) {

@ -47,6 +47,7 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height * .7,
color: Theme.of(context).scaffoldBackgroundColor,
padding: const EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -94,8 +95,9 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
decoration: InputDecoration(
hintText: 'Search by name',
labelText: 'Search',
labelStyle: TextStyle(color: AppColor.textColor(context)),
filled: true,
focusColor: AppColor.fieldBgColor(context),
fillColor: AppColor.fieldBgColor(context),
hintStyle: const TextStyle(fontSize: 14),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: AppColor.blueStatus(context), width: 2.0),
@ -114,22 +116,33 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
child: ListView.builder(
itemCount: filteredList?.length,
padding: const EdgeInsets.only(top: 8),
itemBuilder: (cxt, index) => RadioListTile<T>(
// Specify type for RadioListTile
value: filteredList![index],
dense: true,
contentPadding: EdgeInsets.zero,
groupValue: _selectedValue,
activeColor: Colors.black87,
onChanged: (value) {
_selectedValue = value;
searchFocusNode.unfocus();
setState(() {});
},
title: Text(
widget.builderString(filteredList![index]).cleanupWhitespace.capitalizeFirstOfEach ?? "",
style: Theme.of(context).textTheme.bodyLarge,
itemBuilder: (cxt, index) => Theme(
data: Theme.of(context).copyWith(
radioTheme: RadioThemeData(
fillColor: MaterialStateColor.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return AppColor.textColor(context); // Active color
}
return Colors.grey; // Inactive color
}),
),
),
child: RadioListTile<T>(
// Specify type for RadioListTile
value: filteredList![index],
dense: true,
contentPadding: EdgeInsets.zero,
groupValue: _selectedValue,
activeColor: AppColor.textColor(context),
onChanged: (value) {
_selectedValue = value;
searchFocusNode.unfocus();
setState(() {});
},
title: Text(
widget.builderString(filteredList![index]).cleanupWhitespace.capitalizeFirstOfEach ?? "",
style: Theme.of(context).textTheme.bodyLarge,
),
),
),
),

@ -83,12 +83,15 @@ class _SelectionBottomSheetState<T> extends State<SelectionFullScreenDialog<T>>
SearchBar(
focusNode: searchFocusNode,
elevation: WidgetStateProperty.all<double>(0),
leading: const Icon(Icons.search, color: AppColor.neutral50),
backgroundColor: WidgetStateProperty.all<Color>(
AppColor.fieldBgColor(context), // Your custom background color
),
leading: Icon(Icons.search, color: AppColor.iconColor(context)),
textStyle: WidgetStateProperty.all<TextStyle>(
const TextStyle(color: AppColor.neutral50, fontSize: 16.0),
TextStyle(color: AppColor.textColor(context), fontSize: 16.0),
),
hintStyle: WidgetStateProperty.all<TextStyle>(
const TextStyle(color: AppColor.neutral20, fontSize: 14.0),
TextStyle(color: AppColor.textColor(context), fontSize: 14.0),
),
hintText: 'Search by name',
onChanged: (queryString) {
@ -123,22 +126,34 @@ class _SelectionBottomSheetState<T> extends State<SelectionFullScreenDialog<T>>
child: ListView.builder(
itemCount: filteredList?.length,
padding: EdgeInsets.zero,
itemBuilder: (cxt, index) => RadioListTile<T>(
// Specify type for RadioListTile
value: filteredList![index],
dense: true,
contentPadding: const EdgeInsets.only(left: 16, right: 16),
groupValue: _selectedValue,
activeColor: Colors.black87,
hoverColor: Colors.transparent,
onChanged: (value) {
_selectedValue = value;
searchFocusNode.unfocus();
setState(() {});
},
title: Text(
widget.builderString(filteredList![index]).cleanupWhitespace.capitalizeFirstOfEach ?? "",
style: Theme.of(context).textTheme.bodyLarge,
itemBuilder: (cxt, index) =>Theme(
data: Theme.of(context).copyWith(
radioTheme: RadioThemeData(
fillColor: MaterialStateColor.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return AppColor.iconColor(context); // Active color
}
return Colors.grey; // Inactive color
}),
),
),
child: RadioListTile<T>(
// Specify type for RadioListTile
value: filteredList![index],
dense: true,
contentPadding: const EdgeInsets.only(left: 16, right: 16),
groupValue: _selectedValue,
activeColor: AppColor.iconColor(context),
hoverColor: Colors.transparent,
onChanged: (value) {
_selectedValue = value;
searchFocusNode.unfocus();
setState(() {});
},
title: Text(
widget.builderString(filteredList![index]).cleanupWhitespace.capitalizeFirstOfEach ?? "",
style: Theme.of(context).textTheme.bodyLarge,
),
),
),
),

Loading…
Cancel
Save