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