dashboard changes

merge-requests/318/head
Sultan Khan 4 years ago
parent 958a341c3b
commit 9ed5a294ab

@ -62,6 +62,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
bool isExpanded = false;
String isInpatient = "";
var clinicName = [];
var clinicId = 1;
void didChangeDependencies() async {
super.didChangeDependencies();
if (_isInit) {
@ -140,90 +141,139 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column(
children: <Widget>[
ProfileWelcomeWidget(
InkWell(
onTap: () async {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider.doctorClinicsList);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
Container(
width: MediaQuery.of(context).size.width * .6,
// height: 100,
child: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.white,
isExpanded: true,
value: clinicId,
iconSize: 25,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return projectsProvider.doctorClinicsList
.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
SizedBox(
height: 4,
),
InkWell(
onTap: () async {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider
.doctorClinicsList);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: AppText(
authProvider.selectedClinicName !=
null
? authProvider
.selectedClinicName
: authProvider.doctorProfile
.clinicDescription,
fontSize:
SizeConfig.textMultiplier *
1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
InkWell(
child: Container(
margin: EdgeInsets.only(
left: 5,
top: projectsProvider
.isArabic
? 0
: 5,
right: 10,
bottom: projectsProvider
.isArabic
? 15
: 7),
child: Icon(
DoctorApp.sync_icon,
color: Colors.white,
size: SizeConfig
.textMultiplier *
1.8,
)),
),
],
),
]),
AppText(
item.clinicName,
fontSize: SizeConfig.textMultiplier * 2.1,
color: Colors.white,
),
],
);
}).toList();
},
onChanged: (newValue) {
clinicId = newValue;
changeClinic(newValue, context);
},
items: projectsProvider.doctorClinicsList.map((item) {
return DropdownMenuItem(
child: Text(
item.clinicName,
textAlign: TextAlign.end,
),
]),
value: item.clinicID,
);
}).toList(),
)),
),
),
// InkWell(
// onTap: () async {
// showCupertinoPicker(
// decKey: '',
// context: context,
// actionList: projectsProvider.doctorClinicsList);
// },
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// SizedBox(
// height: 4,
// ),
// InkWell(
// onTap: () async {
// // showCupertinoPicker(
// // decKey: '',
// // context: context,
// // actionList: projectsProvider
// // .doctorClinicsList);
// },
// child:
// Container(
// alignment: projectsProvider.isArabic
// ? Alignment.topRight
// : Alignment.topLeft,
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Container(
// child: AppText(
// authProvider.selectedClinicName !=
// null
// ? authProvider
// .selectedClinicName
// : authProvider.doctorProfile
// .clinicDescription,
// fontSize:
// SizeConfig.textMultiplier *
// 1.7,
// color: Colors.white,
// textAlign: TextAlign.center,
// ),
// alignment: projectsProvider.isArabic
// ? Alignment.topRight
// : Alignment.topLeft,
// ),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// InkWell(
// child: Container(
// margin: EdgeInsets.only(
// left: 5,
// top: projectsProvider
// .isArabic
// ? 0
// : 5,
// right: 10,
// bottom:
// projectsProvider
// .isArabic
// ? 15
// : 7),
// child: Icon(
// Icons.arrow_drop_down,
// color: Colors.white,
// size: SizeConfig
// .textMultiplier *
// 3,
// )),
// ),
// ],
//),
// ])),
// ),
// ],
// ),
//]),
// ),
// ),
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.45,
@ -1522,7 +1572,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
changeClinic(clinicId, BuildContext context) async {
Navigator.pop(context);
// Navigator.pop(context);
changeIsLoading(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);

@ -7,9 +7,8 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget;
final double height;
final double height;
ProfileWelcomeWidget(this.clinicWidget, {this.height = 140});
@ -43,7 +42,7 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).dr +
TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
@ -62,16 +61,12 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
CircleAvatar(
// radius: (52)
child: ClipRRect(
borderRadius:BorderRadius.circular(10),
borderRadius: BorderRadius.circular(10),
child: Image.network(
authProvider
.doctorProfile.doctorImageURL,
authProvider.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 70,
height: 60,
@ -79,7 +74,6 @@ final double height;
),
backgroundColor: Colors.transparent,
)
],
),
),

Loading…
Cancel
Save