|
|
|
@ -52,6 +52,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
|
|
|
|
|
|
final GlobalKey clinicDropdownKey = GlobalKey();
|
|
|
|
|
final GlobalKey projectDropdownKey = GlobalKey();
|
|
|
|
|
TextEditingController ageController = new TextEditingController();
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
String radioValue = null;
|
|
|
|
@ -65,124 +66,158 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
if (radioValue == null) radioValue = TranslationBase.of(context).female;
|
|
|
|
|
if (projectViewModel.isLogin) {
|
|
|
|
|
if (radioValue == null) {
|
|
|
|
|
if (projectViewModel.user.gender == 1) {
|
|
|
|
|
radioValue = TranslationBase.of(context).male;
|
|
|
|
|
} else {
|
|
|
|
|
radioValue = TranslationBase.of(context).female;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (radioValue == null) {
|
|
|
|
|
radioValue = TranslationBase.of(context).female;
|
|
|
|
|
}
|
|
|
|
|
if (ageController.text.isEmpty) {
|
|
|
|
|
ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : "";
|
|
|
|
|
ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
left: 20,
|
|
|
|
|
right: 20,
|
|
|
|
|
top: 20,
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).doctorFilter,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
mHeight(30),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 20, right: 20),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).gender,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
if (projectViewModel.isLogin)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
left: 20,
|
|
|
|
|
right: 20,
|
|
|
|
|
top: 20,
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).doctorFilter,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 6, right: 6),
|
|
|
|
|
child: Row(
|
|
|
|
|
mHeight(30),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: TranslationBase.of(context).female,
|
|
|
|
|
groupValue: radioValue,
|
|
|
|
|
onChanged: (v) {
|
|
|
|
|
setState(() {
|
|
|
|
|
radioValue = v;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 20, right: 20),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).gender,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).female,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 6, right: 6),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: TranslationBase.of(context).female,
|
|
|
|
|
groupValue: radioValue,
|
|
|
|
|
onChanged: (v) {
|
|
|
|
|
setState(() {
|
|
|
|
|
radioValue = v;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).female,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: TranslationBase.of(context).male,
|
|
|
|
|
groupValue: radioValue,
|
|
|
|
|
onChanged: (v) {
|
|
|
|
|
setState(() {
|
|
|
|
|
radioValue = v;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).male,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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: 2),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"Age",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: TranslationBase.of(context).male,
|
|
|
|
|
groupValue: radioValue,
|
|
|
|
|
onChanged: (v) {
|
|
|
|
|
setState(() {
|
|
|
|
|
radioValue = v;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
TextField(
|
|
|
|
|
controller: ageController,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
letterSpacing: -0.59,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).male,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"Age",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
projectViewModel.isLogin ? projectViewModel.user.age.toString() : "",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
letterSpacing: -0.59,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
// Text(
|
|
|
|
|
// projectViewModel.isLogin ? projectViewModel.user.age.toString() : "",
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 15,
|
|
|
|
|
// letterSpacing: -0.59,
|
|
|
|
|
// color: Colors.black,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
|
|
|
|
|
child: Row(
|
|
|
|
|