assistant employee selection sheet ui improvement.

design_3.0_TM_Module_snagsFix
Sikander Saleem 2 months ago
parent 7efeeed619
commit 5e9e8dc870

@ -3,6 +3,7 @@ import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
@ -45,11 +46,9 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return Container(
child: Container(
height: MediaQuery.of(context).size.height * .7, height: MediaQuery.of(context).size.height * .7,
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
padding: const EdgeInsets.all(21),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -84,8 +83,7 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
: null), : null),
), ),
], ],
), ).paddingOnly(top: 16, start: 16, end: 16, bottom: 0),
16.height,
TextField( TextField(
onChanged: (queryString) { onChanged: (queryString) {
query = queryString; query = queryString;
@ -110,13 +108,12 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
), ),
contentPadding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), contentPadding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
), ),
), ).paddingOnly(top: 16, start: 16, end: 16, bottom: 16),
8.height,
Expanded( Expanded(
// Wrap ListView with Expanded // Wrap ListView with Expanded
child: ListView.builder( child: ListView.builder(
itemCount: filteredList?.length, itemCount: filteredList?.length,
padding: const EdgeInsets.only(top: 8), padding: EdgeInsets.zero,
itemBuilder: (cxt, index) => Theme( itemBuilder: (cxt, index) => Theme(
data: Theme.of(context).copyWith( data: Theme.of(context).copyWith(
radioTheme: RadioThemeData( radioTheme: RadioThemeData(
@ -132,9 +129,9 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
// Specify type for RadioListTile // Specify type for RadioListTile
value: filteredList![index], value: filteredList![index],
dense: true, dense: true,
contentPadding: EdgeInsets.zero,
groupValue: _selectedValue, groupValue: _selectedValue,
activeColor: AppColor.textColor(context), activeColor: AppColor.textColor(context),
contentPadding: const EdgeInsets.only(left: 16, right: 16),
onChanged: (value) { onChanged: (value) {
_selectedValue = value; _selectedValue = value;
searchFocusNode.unfocus(); searchFocusNode.unfocus();
@ -150,17 +147,18 @@ class _SelectionBottomSheetState<T> extends State<SelectionBottomSheet<T>> {
), ),
8.height, 8.height,
if (_selectedValue != null) if (_selectedValue != null)
AppFilledButton( FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(
label: context.translation.select, label: context.translation.select,
maxWidth: true, maxWidth: true,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
widget.onSelect(_selectedValue); widget.onSelect(_selectedValue);
}, },
), )),
], ],
), ),
),
); );
} }
} }

@ -124,7 +124,8 @@ class _SingleAssistantEmployeeMenuState extends State<AssistantEmployeeMenu> {
value: value, value: value,
child: Text( child: Text(
value.user?.name ?? "NULL", // Use null-aware operator for user.name value.user?.name ?? "NULL", // Use null-aware operator for user.name
style: AppTextStyles.bodyText.copyWith(color: AppColor.black20), // style: AppTextStyles.bodyText.copyWith(color: AppColor.black20),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.white10 : AppColor.black10),
), ),
); );
}, },

Loading…
Cancel
Save