|
|
|
|
@ -89,71 +89,77 @@ class _SearchByHospitalState extends State<SearchByHospital> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(8),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
|
margin: EdgeInsets.only(left: 20, right: 20),
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).selectHospital,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
openDropdown(projectDropdownKey);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
|
margin: EdgeInsets.only(left: 20, right: 20),
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).selectHospital,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 18,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton<HospitalsModel>(
|
|
|
|
|
hint: Text(
|
|
|
|
|
TranslationBase.of(context).selectHospital),
|
|
|
|
|
value: selectedHospital,
|
|
|
|
|
iconSize: 0,
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
items: projectsList.map((HospitalsModel item) {
|
|
|
|
|
return DropdownMenuItem<HospitalsModel>(
|
|
|
|
|
value: item,
|
|
|
|
|
child: AutoSizeText(
|
|
|
|
|
item.name!,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minFontSize: 10,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.6,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.39,
|
|
|
|
|
height: 0.8,
|
|
|
|
|
Container(
|
|
|
|
|
height: 18,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton<HospitalsModel>(
|
|
|
|
|
key: projectDropdownKey,
|
|
|
|
|
hint: Text(
|
|
|
|
|
TranslationBase.of(context).selectHospital),
|
|
|
|
|
value: selectedHospital,
|
|
|
|
|
iconSize: 0,
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
color: Colors.black),
|
|
|
|
|
items: projectsList.map((HospitalsModel item) {
|
|
|
|
|
return DropdownMenuItem<HospitalsModel>(
|
|
|
|
|
value: item,
|
|
|
|
|
child: AutoSizeText(
|
|
|
|
|
item.name!,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minFontSize: 10,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig.textMultiplier! * 1.6,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.39,
|
|
|
|
|
height: 0.8,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// Text('${item.name!}'),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
onChanged: (HospitalsModel? newValue) {
|
|
|
|
|
getClinicWrtHospital(newValue);
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedHospital = newValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// Text('${item.name!}'),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
onChanged: (HospitalsModel? newValue) {
|
|
|
|
|
getClinicWrtHospital(newValue);
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedHospital = newValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(Icons.keyboard_arrow_down),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
Icon(Icons.keyboard_arrow_down),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
if (clinicIds?.isNotEmpty == true) ...[
|
|
|
|
|
mHeight(8),
|
|
|
|
|
InkWell(
|
|
|
|
|
@ -228,8 +234,23 @@ class _SearchByHospitalState extends State<SearchByHospital> {
|
|
|
|
|
|
|
|
|
|
void openDropdown(GlobalKey key) {
|
|
|
|
|
GestureDetector? detector;
|
|
|
|
|
detector = searchForGestureDetector(key.currentContext!);
|
|
|
|
|
|
|
|
|
|
void searchForGestureDetector(BuildContext element) {
|
|
|
|
|
element.visitChildElements((element) {
|
|
|
|
|
if (element.widget != null && element.widget is GestureDetector) {
|
|
|
|
|
detector = element.widget as GestureDetector?;
|
|
|
|
|
//return false;
|
|
|
|
|
} else {
|
|
|
|
|
searchForGestureDetector(element);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//return true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchForGestureDetector(key.currentContext!);
|
|
|
|
|
assert(detector != null);
|
|
|
|
|
|
|
|
|
|
detector!.onTap!();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|