Merge branch 'sultan' into 'development'

Sultan

See merge request Cloud_Solution/doctor_app_flutter!295
merge-requests/296/merge
Mohammad Aljammal 5 years ago
commit 63878281b3

@ -639,68 +639,153 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.coveringDoctors.length > 0 model2.coveringDoctors.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownSearch(
DropdownButtonHideUnderline( mode: Mode.BOTTOM_SHEET,
child: DropdownButton(
focusColor: Colors.grey, dropdownSearchDecoration:
isExpanded: true, InputDecoration(
value: doctorID == null contentPadding:
? model2 EdgeInsets.all(
.coveringDoctors[0] 0),
['doctorID'] border: InputBorder
.toString() .none),
: doctorID, //maxHeight: 300,
iconSize: 40, items: model2
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2
.coveringDoctors .coveringDoctors
.map((item) { .map((item) {
return Row( return projectsProvider
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic .isArabic
? item[ ? item['doctorNameN']
'doctorNameN'] : item['doctorName'];
: item[ }).toList(),
'doctorName'], // label: "Doctor List",
fontSize: SizeConfig onChanged: (item) {
.textMultiplier * model2.coveringDoctors
2.1, .forEach((newVal) => {
), if (newVal['doctorName'] ==
], item ||
); newVal['doctorName'] ==
}).toList(); item)
}, {
onChanged: (newValue) => { doctorID =
setState(() { newVal[
doctorID = newValue; 'DoctorID']
}) }
});
}, },
items: model2 selectedItem:
.coveringDoctors getSelectedDoctor(
.map((item) { model2),
return DropdownMenuItem< showSearchBox: true,
String>( searchBoxDecoration:
value: item['doctorID'] InputDecoration(
.toString(), border:
OutlineInputBorder(),
contentPadding:
EdgeInsets.fromLTRB(
12, 12, 8, 0),
labelText:
"Search Doctor",
),
popupTitle: Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context)
.primaryColorDark,
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(
20),
topRight:
Radius.circular(
20),
),
),
child: Center(
child: Text( child: Text(
projectsProvider '',
.isArabic style: TextStyle(
? item[ fontSize: 24,
'doctorNameN'] fontWeight:
: item[ FontWeight.bold,
'doctorName'], color: Colors.white,
textAlign:
TextAlign.start,
), ),
); ),
}).toList(), ),
)), ),
popupShape:
RoundedRectangleBorder(
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(24),
topRight:
Radius.circular(24),
),
),
),
// DropdownButtonHideUnderline(
// child: DropdownButton(
// focusColor: Colors.grey,
// isExpanded: true,
// value: doctorID == null
// ? model2
// .coveringDoctors[0]
// ['doctorID']
// .toString()
// : doctorID,
// iconSize: 40,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext context) {
// return model2
// .coveringDoctors
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize.max,
// children: <Widget>[
// AppText(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// fontSize: SizeConfig
// .textMultiplier *
// 2.1,
// ),
// ],
// );
// }).toList();
// },
// onChanged: (newValue) => {
// setState(() {
// doctorID = newValue;
// })
// },
// items: model2
// .coveringDoctors
// .map((item) {
// return DropdownMenuItem<
// String>(
// value: item['doctorID']
// .toString(),
// child: Text(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// textAlign:
// TextAlign.start,
// ),
// );
// }).toList(),
// )),
) )
: SizedBox(), : SizedBox(),
], ],
@ -775,6 +860,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
toDate = _toDateController2.text; toDate = _toDateController2.text;
fromDate = _toDateController.text; fromDate = _toDateController.text;
this.reason = widget.updateData.reasonId.toString(); this.reason = widget.updateData.reasonId.toString();
doctorID = widget.updateData.coveringDoctorId;
} }
}); });
} }
@ -910,4 +996,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} }
}); });
} }
getSelectedDoctor(model2) {
var doctorName;
if (doctorID == null)
return projectsProvider.isArabic
? model2.coveringDoctors[0]['doctorNameN']
: model2.coveringDoctors[0]['doctorName'];
else {
model2.coveringDoctors.forEach((newVal) => {
if (newVal['doctorID'].toString() == doctorID)
{doctorName = newVal['doctorName']}
});
return doctorName;
}
}
} }

Loading…
Cancel
Save