dashboard and patient app

merge-requests/91/head
Salman Afzal 6 years ago
parent bde30d93ec
commit ac612f0eda

@ -32,7 +32,6 @@ class DashboardScreen extends StatefulWidget {
} }
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider projectsProvider; HospitalProvider projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -41,6 +40,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
appBarTitle: TranslationBase.of(context).dashboardScreenToolbarTitle, appBarTitle: TranslationBase.of(context).dashboardScreenToolbarTitle,
current: 0, current: 0,
body: Container( body: Container(
child: new SingleChildScrollView(
child: SizedBox(
height: MediaQuery.of(context).size.height,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -63,7 +65,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
flex: 2, flex: 2,
child: RoundedContainer( child: RoundedContainer(
child: CircularPercentIndicator( child: CircularPercentIndicator(
radius: 90.0, radius: 115.0,
animation: true, animation: true,
animationDuration: 1200, animationDuration: 1200,
lineWidth: 7.0, lineWidth: 7.0,
@ -76,7 +78,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontSize: SizeConfig.textMultiplier * 4), fontSize: SizeConfig.textMultiplier * 4),
AppText("Out-Patients", AppText("Out-Patients",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.5, fontSize: SizeConfig.textMultiplier * 1.2,
color: Colors.grey[800]), color: Colors.grey[800]),
], ],
), ),
@ -88,12 +90,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: Padding(
padding: EdgeInsets.all(8),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment:
CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DashboardItemTexts( child: DashboardItemTexts(
@ -111,7 +117,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment:
CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DashboardItemTexts( child: DashboardItemTexts(
@ -127,7 +134,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
)), )),
], ],
), ),
) ))
], ],
), ),
), ),
@ -142,7 +149,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"08", "08",
"Lab Result", "Lab Result",
backgroundColor: Colors.red, backgroundColor: Colors.black45,
// valueFontColor: Colors.white,
// titleFontColor: Colors.white,
// iconColor: Colors.white,
), ),
), ),
Expanded( Expanded(
@ -151,7 +161,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"10", "10",
"Radiology", "Radiology",
backgroundColor: Colors.red, backgroundColor: Colors.black45,
// valueFontColor: Colors.white,
// titleFontColor: Colors.white,
// iconColor: Colors.white,
)), )),
Expanded( Expanded(
flex: 2, flex: 2,
@ -159,7 +172,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"05", "05",
"Referral", "Referral",
backgroundColor: Colors.red, backgroundColor: Colors.black45,
// valueFontColor: Colors.white,
// titleFontColor: Colors.white,
// iconColor: Colors.white,
)), )),
], ],
), ),
@ -176,6 +192,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
"23", "23",
"In-Patient", "In-Patient",
showBorder: true, showBorder: true,
backgroundColor: Colors.red[900],
), ),
), ),
Expanded( Expanded(
@ -185,6 +202,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
"23", "23",
"Operations", "Operations",
showBorder: true, showBorder: true,
backgroundColor: Colors.red[900],
)), )),
], ],
), ),
@ -212,8 +230,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"", "",
"Search Patient", "Search Patient",
showBorder: false, showBorder: true,
backgroundColor: Colors.green[200], backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed(PATIENT_SEARCH); Navigator.of(context).pushNamed(PATIENT_SEARCH);
@ -238,8 +260,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"", "",
"Doctor Reply", "Doctor Reply",
showBorder: false, showBorder: true,
backgroundColor: Colors.deepPurple[300], backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
), ),
), ),
@ -247,7 +273,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
Expanded( Expanded(
flex: 3, flex: 2,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
@ -258,8 +284,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"", "",
"Search Medicine", "Search Medicine",
showBorder: false, showBorder: true,
backgroundColor: Colors.teal, backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -277,7 +307,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -292,17 +322,27 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"", "",
"My Referral Patient", "My Referral Patient",
showBorder: false, showBorder: true,
backgroundColor: Colors.brown[400], backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
), ),
), ),
],
//================== ),
),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -317,18 +357,29 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorApp.home_icon, DoctorApp.home_icon,
"", "",
"My Referred Patient", "My Referred Patient",
showBorder: false, showBorder: true,
backgroundColor: Colors.orange, backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
), ),
), ),
//================== Expanded(flex: 1, child: Container())
], ],
), )),
),
], ],
), ),
//)
// ,
//constraints: new BoxConstraints(),
), ),
); )));
// Container(
// );
} }
} }

@ -61,33 +61,31 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
//print("============== _selectedType============"+ _selectedType); //print("============== _selectedType============"+ _selectedType);
try { try {
//==================== //====================
//_selectedType=='3'? //_selectedType=='3'?
//===================== //=====================
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile); new DoctorProfileModel.fromJson(profile);
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
_formKey.currentState.save(); _formKey.currentState.save();
sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
print('************_selectedType*************'); print('************_selectedType*************');
print('_selectedType${_selectedType}'); print('_selectedType${_selectedType}');
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
_patientSearchFormValues.TokenID = token; _patientSearchFormValues.TokenID = token;
_patientSearchFormValues.ProjectID = doctorProfile.projectID ;//15 _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15
_patientSearchFormValues.DoctorID = doctorProfile.doctorID; _patientSearchFormValues.DoctorID = doctorProfile.doctorID;
_patientSearchFormValues.ClinicID = doctorProfile.clinicID; _patientSearchFormValues.ClinicID = doctorProfile.clinicID;
//===================== //=====================
// _patientSearchFormValues. // _patientSearchFormValues.
//===================== //=====================
print("=============doctorProfile.clinicID="+doctorProfile.clinicID.toString()); print("=============doctorProfile.clinicID=" +
doctorProfile.clinicID.toString());
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
@ -101,7 +99,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
} }
} }
handelCatchErrorCase(err) { handelCatchErrorCase(err) {
@ -154,6 +151,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedType, value: _selectedType,
@ -178,7 +176,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
onChanged: (String newValue) => { onChanged: (String newValue) => {
setState(() { setState(() {
_selectedType = newValue; _selectedType = newValue;
selectedPatientType = int.parse(_selectedType); selectedPatientType =
int.parse(_selectedType);
}) })
}, },
items: PATIENT_TYPE.map((item) { items: PATIENT_TYPE.map((item) {
@ -190,7 +189,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
value: item['val'], value: item['val'],
); );
}).toList(), }).toList(),
), )),
), ),
], ],
), ),
@ -249,7 +248,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
_patientSearchFormValues.setLastName = "0"; _patientSearchFormValues.setLastName = "0";
} }
}, },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
SizedBox( SizedBox(
height: 10, height: 10,
@ -332,6 +330,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedLocation, value: _selectedLocation,
@ -367,7 +366,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
value: item['val'], value: item['val'],
); );
}).toList(), }).toList(),
), )),
), ),
], ],
), ),

@ -1,48 +1,79 @@
import 'dart:ffi';
import '../shared/rounded_container_widget.dart'; import '../shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
class DashboardItemIconText extends StatefulWidget { class DashboardItemIconText extends StatefulWidget {
final IconData icon;
final IconData icon; final String value;
final String value; final String label;
final String label; final Color backgroundColor;
final Color backgroundColor; final bool showBorder;
final bool showBorder; final Color borderColor;
final Color borderColor; final double titleFontSize;
final Color titleFontColor;
final Color valueFontColor;
final double valueFontSize;
final Color iconColor;
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 05-04-2020 // DATE : 05-04-2020
// DESCRIPTION : Custom widget for dashboard items has texts and icons widgets // DESCRIPTION : Custom widget for dashboard items has texts and icons widgets
DashboardItemIconText(this.icon, this.value, this.label, {this.backgroundColor = Colors.white, this.showBorder = false, this.borderColor = Colors.white}); DashboardItemIconText(this.icon, this.value, this.label,
{this.backgroundColor = Colors.white,
this.showBorder = false,
this.titleFontSize = 12,
this.valueFontSize = 26,
this.valueFontColor = Colors.white,
this.titleFontColor = Colors.white,
this.iconColor = Colors.white,
this.borderColor = Colors.white});
@override @override
_DashboardItemTextsState createState() => _DashboardItemTextsState(); _DashboardItemTextsState createState() => _DashboardItemTextsState();
} }
class _DashboardItemTextsState extends State<DashboardItemIconText> { class _DashboardItemTextsState extends State<DashboardItemIconText> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new RoundedContainer( return new RoundedContainer(
child:Stack( margin: 10,
child: Stack(
children: <Widget>[ children: <Widget>[
Align( Align(
alignment: FractionalOffset.topLeft, alignment: FractionalOffset.topLeft,
child: Container(margin: EdgeInsets.all(10), child: Icon(widget.icon,),) child: Container(
margin: EdgeInsets.all(10),
child: Icon(
widget.icon,
color: widget.iconColor,
), ),
)),
Align( Align(
alignment: FractionalOffset.bottomRight, alignment: FractionalOffset.bottomRight,
child: Container(margin: EdgeInsets.all(10), child: Column( child: Container(
margin: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
AppText(widget.value,), AppText(
Text(widget.label), widget.value,
color: widget.valueFontColor,
],)) fontSize: widget.valueFontSize,
), ),
AppText(
widget.label,
color: widget.titleFontColor,
fontSize: widget.titleFontSize,
),
],
))),
], ],
) ,backgroundColor: widget.backgroundColor, ),
showBorder: widget.showBorder, borderColor: widget.borderColor,); backgroundColor: widget.backgroundColor,
showBorder: widget.showBorder,
borderColor: widget.borderColor,
);
} }
} }

@ -1,21 +1,22 @@
import '../shared/rounded_container_widget.dart'; import '../shared/rounded_container_widget.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DashboardItemTexts extends StatefulWidget { class DashboardItemTexts extends StatefulWidget {
final String label;
final String label; final String value;
final String value; final Color backgroundColor;
final Color backgroundColor; final bool showBorder;
final bool showBorder; final Color borderColor;
final Color borderColor;
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 05-04-2020 // DATE : 05-04-2020
// DESCRIPTION : Custom widget for dashboard items has texts widgets // DESCRIPTION : Custom widget for dashboard items has texts widgets
DashboardItemTexts(this.label, this.value, {this.backgroundColor = Colors.white, this.showBorder = false, this.borderColor = Colors.white}); DashboardItemTexts(this.label, this.value,
{this.backgroundColor = Colors.white,
this.showBorder = false,
this.borderColor = Colors.white});
@override @override
_DashboardItemTextsState createState() => _DashboardItemTextsState(); _DashboardItemTextsState createState() => _DashboardItemTextsState();
} }
@ -24,18 +25,32 @@ class _DashboardItemTextsState extends State<DashboardItemTexts> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new RoundedContainer( return new RoundedContainer(
child:Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Align( Align(
alignment: FractionalOffset.topLeft, alignment: FractionalOffset.topLeft,
child:Container(margin: EdgeInsets.all(5), child: AppText(widget.label),) child: Container(
margin: EdgeInsets.all(5),
child: AppText(
widget.label,
fontSize: 12,
), ),
)),
Align( Align(
alignment: FractionalOffset.bottomRight, alignment: FractionalOffset.bottomRight,
child: Container(margin: EdgeInsets.all(10), child: AppText(widget.value, fontWeight: FontWeight.bold),) child: Container(
margin: EdgeInsets.all(10),
child: AppText(
widget.value,
fontWeight: FontWeight.bold,
), ),
)),
],) ,backgroundColor: widget.backgroundColor, showBorder: widget.showBorder, borderColor: widget.borderColor, margin: 4,); ],
),
backgroundColor: widget.backgroundColor,
showBorder: widget.showBorder,
borderColor: widget.borderColor,
margin: 4,
);
} }
} }

@ -36,8 +36,7 @@ class RoundedContainer extends StatefulWidget {
this.topRight = 0, this.topRight = 0,
this.bottomRight = 0, this.bottomRight = 0,
this.bottomLeft = 0, this.bottomLeft = 0,
this.borderWidth =1 this.borderWidth = 1});
});
@override @override
_RoundedContainerState createState() => _RoundedContainerState(); _RoundedContainerState createState() => _RoundedContainerState();
@ -53,7 +52,8 @@ class _RoundedContainerState extends State<RoundedContainer> {
decoration: widget.showBorder == true decoration: widget.showBorder == true
? BoxDecoration( ? BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
border: Border.all(color: widget.borderColor, width: widget.borderWidth), border: Border.all(
color: widget.borderColor, width: widget.borderWidth),
borderRadius: widget.customCornerRaduis borderRadius: widget.customCornerRaduis
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft),
@ -61,7 +61,14 @@ class _RoundedContainerState extends State<RoundedContainer> {
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis),
) boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
spreadRadius: 10,
blurRadius: 5,
offset: Offset(0, 5), // changes position of shadow
),
])
: null, : null,
child: Card( child: Card(
margin: EdgeInsets.all(0), margin: EdgeInsets.all(0),

Loading…
Cancel
Save