WD: searchable dropdown added in intervention dialog

update_3.16.0_CR5439_Pharmacy_Intervention
taha.alam 1 year ago
parent b25398b97b
commit ad4c1b226c

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/nursing_station.dart'; import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/nursing_station.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -277,39 +278,75 @@ class _PharmacyInterventionDialogState
widget.station?.entityList?.isEmpty == true ? Expanded( widget.station?.entityList?.isEmpty == true ? Expanded(
child: EmptyDropDown()) child: EmptyDropDown())
: Expanded( : Expanded(
child: DropdownButtonHideUnderline( child: DropdownSearch<NursingStationEntity>(
child: DropdownButton( itemAsString:(item){
dropdownColor: Colors.white, return item.description??'';
iconEnabledColor: Colors.black, } ,
icon: Icon(Icons.keyboard_arrow_down), items: widget.station?.entityList ?? [],
isExpanded: true, popupProps: PopupProps.menu(
value: nursingStation == null showSearchBox: true,
searchDelay: Duration(microseconds: 100),
searchFieldProps: TextFieldProps(
decoration: InputDecoration(
border: UnderlineInputBorder(),
hintText: TranslationBase.of(context).search
)
)
),
dropdownButtonProps: DropdownButtonProps(color: AppGlobal.appRedColor,),
dropdownDecoratorProps: DropDownDecoratorProps(
textAlignVertical: TextAlignVertical.center,
dropdownSearchDecoration: InputDecoration(
border: InputBorder.none
),
baseStyle: TextStyle(
fontSize: 14
)
),
selectedItem: nursingStation == null
? widget.station?.entityList?.first ? widget.station?.entityList?.first
: nursingStation, : nursingStation,
iconSize: 25,
elevation: 16,
onChanged: (newValue) async { onChanged: (newValue) async {
if (newValue != null) if (newValue != null)
setState(() { setState(() {
nursingStation = newValue ; nursingStation = newValue ;
}); });
}, },
items: )
widget.station?.entityList?.map((item) { // DropdownButtonHideUnderline(
return DropdownMenuItem( // child: DropdownButton(
child: AppText( // dropdownColor: Colors.white,
item.description ?? '', // iconEnabledColor: Colors.black,
fontSize: 14, // icon: Icon(Icons.keyboard_arrow_down),
letterSpacing: -0.96, // isExpanded: true,
color: AppGlobal.appTextColor, // value: nursingStation == null
fontWeight: FontWeight.normal, // ? widget.station?.entityList?.first
textAlign: TextAlign.left, // : nursingStation,
), // iconSize: 25,
value: item, // elevation: 16,
); // onChanged: (newValue) async {
}).toList(), // if (newValue != null)
), // setState(() {
), // nursingStation = newValue ;
// });
// },
// items:
// widget.station?.entityList?.map((item) {
// return DropdownMenuItem(
// child: AppText(
// item.description ?? '',
// fontSize: 14,
// letterSpacing: -0.96,
// color: AppGlobal.appTextColor,
// fontWeight: FontWeight.normal,
// textAlign: TextAlign.left,
// ),
// value: item,
// );
// }).toList(),
// ),
// ),
) )
]); ]);
} }
Loading…
Cancel
Save