Merge branch 'Dec_fixes' into 'development'

Dec fixes

See merge request Cloud_Solution/doctor_app_flutter!916
merge-requests/917/merge
Elham Ali 3 years ago
commit 3c8d1fdf39

@ -455,6 +455,7 @@ const TIMER_MIN = 10;
class AppGlobal {
static var CONTEX;
static Color appPrimaryColor = Color(0xFFB9382C);
static Color appRedColor = Color(0xFFD02127);
static Color appGreenColor = Color(0xFF359846);
static Color appTextColor = Color(0xFF2B353E);
}

@ -40,7 +40,6 @@ class ClinicByProjectIdRequest {
this.languageID = 2,
this.stamp = "2020-06-03T11:18:19.979Z",
this.iPAdress = "11.11.11.11",
this.versionID = 5.5,
this.channel = 9,
this.tokenID,
this.sessionID = "JBXRsDl37L",
@ -53,7 +52,6 @@ class ClinicByProjectIdRequest {
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
@ -68,7 +66,6 @@ class ClinicByProjectIdRequest {
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;

@ -0,0 +1,170 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart';
import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'label.dart';
class DashboardReferralPatient extends StatelessWidget {
final List<DashboardModel> dashboardItemList;
final double height;
final DashboardViewModel model;
const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20)
),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 0,
blurRadius: 9,
offset: Offset(0, 0), // changes position of shadow
),
],
),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded(
flex: 1,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: SizeConfig.getHeightMultiplier(height: height) *
(SizeConfig.isHeightVeryShort?
3
: SizeConfig.isHeightShort?
2
: 2)),
Label(
firstLine: TranslationBase.of(context).patients,
secondLine: TranslationBase.of(context).referral,
color: Color(0xFF2B353E),
secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) *
(SizeConfig.isHeightVeryShort?
5
: SizeConfig.isHeightShort?
7
: 12),
),
SizedBox(
height: SizeConfig.getHeightMultiplier(height: height) *
(SizeConfig.isHeightVeryShort?
5
: SizeConfig.isHeightShort?
10
: 5))
],
),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RowCounts(
dashboardItemList[2].summaryoptions[0].kPIParameter,
dashboardItemList[2].summaryoptions[0].value,
Colors.black,
height: height,
),
RowCounts(
dashboardItemList[2].summaryoptions[1].kPIParameter,
dashboardItemList[2].summaryoptions[1].value,
Colors.grey,
height: height,
),
RowCounts(
dashboardItemList[2].summaryoptions[2].kPIParameter,
dashboardItemList[2].summaryoptions[2].value,
Colors.red,
height: height,
),
],
),
)
],
)),
),
Expanded(
flex: 3,
child: Stack(children: [
Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))),
Positioned(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
model.getPatientCount(dashboardItemList[2]).toString(),
fontSize: SizeConfig.textMultiplier * 3.0,
fontWeight: FontWeight.bold,
)
],
),
top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40),
left: 0,
right: 0)
]),
),
],
)),
]),
);
}
static List<charts.Series<GaugeSegment, String>> _createReferralData(List<DashboardModel> dashboardItemList) {
final data = [
new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[0].value), charts.MaterialPalette.black),
new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[1].value), charts.MaterialPalette.gray.shadeDefault),
new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault),
];
return [
new charts.Series<GaugeSegment, String>(
id: 'Segments',
domainFn: (GaugeSegment segment, _) => segment.segment,
measureFn: (GaugeSegment segment, _) => segment.size,
data: data,
colorFn: (GaugeSegment segment, _) => segment.color,
)
];
}
static int getValue(value) {
return value == 0 ? 1 : value;
}
}

@ -1,9 +1,12 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'label.dart';
class DashboardSliderItemWidget extends StatelessWidget {
final DashboardModel item;
@ -11,27 +14,37 @@ class DashboardSliderItemWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
item.kPIName,
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold,
Container(
margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1),
child: Label(
firstLine: Helpers.getLabelFromKPI(item.kPIName),
secondLine: Helpers.getNameFromKPI(item.kPIName),
),
),
],
),
new Container(
height: 110,
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 16
: SizeConfig.isHeightShort
? 14
: SizeConfig.isHeightLarge
? 15
: 13),
child: ListView(
scrollDirection: Axis.horizontal,
children:
List.generate(item.summaryoptions.length, (int index) {
return GetActivityButton(item.summaryoptions[index]);
children: List.generate(item.summaryoptions.length, (int index) {
return GetActivityCard(item.summaryoptions[index]);
})))
],
);
}
}

@ -12,6 +12,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'dashboard_referral_patient.dart';
class DashboardSwipeWidget extends StatefulWidget {
final List<DashboardModel> dashboardItemList;
final DashboardViewModel model;
@ -28,8 +30,11 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
@override
Widget build(BuildContext context) {
double height = SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31);
return Container(
height: MediaQuery.of(context).size.height * 0.35,
height: height,
// height: 230,
child: Swiper(
onIndexChanged: (index) {
@ -41,7 +46,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
}
},
itemBuilder: (BuildContext context, int index) {
return getSwipeWidget(widget.dashboardItemList, index);
return getSwipeWidget(widget.dashboardItemList, index, height);
},
itemCount: 3,
// itemHeight: 300,
@ -84,146 +89,14 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
);
}
Widget getSwipeWidget(List<DashboardModel> dashboardItemList, int index) {
Widget getSwipeWidget(List<DashboardModel> dashboardItemList, int index,double height ) {
if (index == 1)
return RoundedContainer(
raduis: 16,
showBorder: false,
borderColor: Colors.white,
shadowWidth: 0.1,
shadowSpreadRadius: 2,
shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(dashboardItemList[1])));
return GetOutPatientStack(dashboardItemList[1]);
if (index == 0)
return RoundedContainer(
raduis: 16,
showBorder: false,
borderColor: Colors.white,
shadowWidth: 0.1,
shadowSpreadRadius: 2,
shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(dashboardItemList[0])));
return GetOutPatientStack(dashboardItemList[0]);
if (index == 2)
return RoundedContainer(
raduis: 16,
showBorder: false,
borderColor: Colors.white,
shadowWidth: 0.1,
shadowSpreadRadius: 2,
shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
flex: 1,
child: Row(
children: [
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.patients,
fontSize: 12,
fontWeight: FontWeight.bold,
fontHeight: 0.5,
),
AppText(
TranslationBase.of(context)
.referral,
fontSize: 22,
fontWeight: FontWeight.bold,
),
],
)),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: RowCounts(
dashboardItemList[2]
.summaryoptions[0]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[0]
.value,
Colors.black),
),
Expanded(
child: RowCounts(
dashboardItemList[2]
.summaryoptions[1]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[1]
.value,
Colors.grey),
),
Expanded(
child: RowCounts(
dashboardItemList[2]
.summaryoptions[2]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[2]
.value,
Colors.red),
),
],
),
)
],
)),
),
Expanded(
flex: 3,
child: Stack(children: [
Container(
child: GaugeChart(
_createReferralData(widget.dashboardItemList))),
Positioned(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
widget.model
.getPatientCount(dashboardItemList[2])
.toString(),
fontSize: SizeConfig.textMultiplier * 3.0,
fontWeight: FontWeight.bold,
)
],
),
top: MediaQuery.of(context).size.height * 0.13,
left: 0,
right: 0)
]),
),
],
)),
]));
return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,);
return Container();
}

@ -4,36 +4,34 @@ import 'package:hexcolor/hexcolor.dart';
class HomePageCard extends StatelessWidget {
const HomePageCard(
{this.hasBorder = false,
this.imageName,
@required this.child,
this.onTap,
Key key,
this.color,
this.opacity = 0.4,
this.margin})
this.imageName,
this.child,
this.onTap,
Key key,
this.color,
this.opacity = 0.4,
this.margin, this.width})
: super(key: key);
final bool hasBorder;
final String imageName;
final Widget child;
final Function onTap;
final GestureTapCallback onTap;
final Color color;
final double opacity;
final double width;
final EdgeInsets margin;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
width: 120,
height: MediaQuery.of(context).orientation == Orientation.portrait
? 100
: 200,
width: width,
margin: this.margin,
decoration: BoxDecoration(
color: !hasBorder
? color != null
? color
: HexColor('#050705').withOpacity(opacity)
? color
: HexColor('#050705').withOpacity(opacity)
: Colors.white,
borderRadius: BorderRadius.circular(17.0),
border: hasBorder
@ -41,11 +39,10 @@ class HomePageCard extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null
? DecorationImage(
image: AssetImage('assets/images/dashboard/$imageName'),
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn),
)
image: AssetImage('assets/images/dashboard/$imageName'),
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn),
)
: null,
),
child: child,

@ -10,25 +10,28 @@ class HomePatientCard extends StatelessWidget {
final Color backgroundIconColor;
final String text;
final Color textColor;
final Function onTap;
final VoidCallback onTap;
final double iconSize;
HomePatientCard({
@required this.backgroundColor,
@required this.backgroundIconColor,
this.cardIcon,
this.backgroundColor,
this.backgroundIconColor,
this.cardIcon,
this.cardIconImage,
@required this.text,
@required this.textColor,
@required this.onTap,
this.iconSize = 30,
this.text,
this.textColor,
this.onTap,
this.iconSize = 30,
});
@override
Widget build(BuildContext context) {
double width = SizeConfig.heightMultiplier*
(SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13);
return HomePageCard(
color: backgroundColor,
margin: EdgeInsets.all(4),
width: width,
margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121),
child: Container(
padding: EdgeInsets.all(8),
child: Column(
@ -43,21 +46,21 @@ class HomePatientCard extends StatelessWidget {
color: Colors.transparent,
child: cardIcon != null
? Icon(
cardIcon,
size: iconSize * 2,
color: backgroundIconColor,
)
cardIcon,
size: iconSize * 2,
color: backgroundIconColor,
)
: IconButton(
icon: Image.asset(
'assets/images/patient_register.png',
width: iconSize * 2,
height: iconSize * 2,
fit: BoxFit.fill,
),
iconSize: iconSize * 2,
color: backgroundIconColor,
onPressed: () => null,
),
icon: Image.asset(
'assets/images/patient_register.png',
width: iconSize * 2,
height: iconSize * 2,
fit: BoxFit.fill,
),
iconSize: iconSize * 2,
color: backgroundIconColor,
onPressed: () => null,
),
),
Container(
child: Column(
@ -66,15 +69,16 @@ class HomePatientCard extends StatelessWidget {
children: [
cardIcon != null
? Icon(
cardIcon,
size: iconSize,
color: textColor,
)
cardIcon,
size:
SizeConfig.getWidthMultiplier(width: width) * 30,
color: textColor,
)
: Image.asset(
cardIconImage,
height: iconSize,
width: iconSize,
),
cardIconImage,
height: iconSize,
width: iconSize,
),
SizedBox(
height: 4,
),
@ -90,7 +94,9 @@ class HomePatientCard extends StatelessWidget {
text,
color: textColor,
textAlign: TextAlign.start,
fontSize: SizeConfig.textMultiplier * 1.6,
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth(width: width) *
(SizeConfig.isHeightVeryShort ? 11 : 10),
),
),
),

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
@ -33,6 +34,7 @@ import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../routes.dart';
import '../../widgets/shared/app_texts_widget.dart';
import 'label.dart';
class HomeScreen extends StatefulWidget {
HomeScreen({Key key, this.title}) : super(key: key);
@ -102,7 +104,8 @@ class _HomeScreenState extends State<HomeScreen> {
DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
iconEnabledColor: AppGlobal.appTextColor,
icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true,
value: clinicId == null
? projectsProvider
@ -127,13 +130,13 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
Container(
padding:
EdgeInsets.all(2),
EdgeInsets.all(0),
margin:
EdgeInsets.all(2),
decoration:
new BoxDecoration(
color:
Colors.red[800],
AppGlobal.appRedColor,
borderRadius:
BorderRadius
.circular(
@ -152,11 +155,13 @@ class _HomeScreenState extends State<HomeScreen> {
.toString(),
color:
Colors.white,
letterSpacing: -0.72,
fontWeight: FontWeight.w600,
fontSize:
projectsProvider
.isArabic
? 10
: 11,
: 12,
textAlign:
TextAlign
.center,
@ -165,8 +170,9 @@ class _HomeScreenState extends State<HomeScreen> {
],
),
AppText(item.clinicName,
fontSize: 12,
color: Colors.black,
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight:
FontWeight.bold,
textAlign: TextAlign.end),
@ -194,6 +200,11 @@ class _HomeScreenState extends State<HomeScreen> {
return DropdownMenuItem(
child: AppText(
item.clinicName,
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal.appTextColor,
fontWeight:
FontWeight.bold,
textAlign: TextAlign.left,
),
value: item.clinicID,
@ -274,27 +285,12 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox(
height: 10,
),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patients,
fontSize: 12,
fontWeight: FontWeight.bold,
fontHeight: .5,
),
AppText(
TranslationBase.of(context).services,
fontSize: 22,
fontWeight: FontWeight.bold,
),
],
)),
SizedBox(
height: 10,
Label(
firstLine: TranslationBase.of(context).patients,
secondLine: TranslationBase.of(context).services,
),
Container(
height: 120,
child: ListView(
@ -324,9 +320,9 @@ class _HomeScreenState extends State<HomeScreen> {
colorIndex = 0;
List<Color> backgroundColors = List(3);
backgroundColors[0] = Color(0xffD02127);
backgroundColors[0] = AppGlobal.appRedColor;
backgroundColors[1] = Colors.grey[300];
backgroundColors[2] = Color(0xff2B353E);
backgroundColors[2] = Color(0xFF2B353E);
List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38;

@ -0,0 +1,43 @@
// ignore: must_be_immutable
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class Label extends StatelessWidget {
Label({
Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize,
}) : super(key: key);
final String firstLine;
final String secondLine;
Color color;
final double secondLineFontSize;
final double firstLineFontSize;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
firstLine,
fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) ,
// fontWeight: FontWeight.bold,
color: color,
fontHeight: .5,
letterSpacing: -0.72,
fontWeight: FontWeight.w600,
),
AppText(
secondLine,
color: color,
fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40),
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
),
],
);
}
}

@ -245,9 +245,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
},
),
),
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty
@ -269,7 +267,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
.patientStatusType ==
43))
return Padding(
padding: EdgeInsets.all(8.0),
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,

@ -76,7 +76,7 @@ class _PriorityBarState extends State<PriorityBar> {
),
),
if(_isActive)
Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,)
Container(width: 120,height: 4,color: AppGlobal.appRedColor,)
],
),
),

@ -313,4 +313,20 @@ class Helpers {
? 8
: 6);
}
static getLabelFromKPI(String kpi) {
if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1)
return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")"));
else
return '';
}
static getNameFromKPI(String kpi) {
if (kpi.indexOf("(") > -1)
return kpi.substring(0, kpi.indexOf("("));
else
return kpi;
}
}

@ -1,42 +1,50 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class GetActivityButton extends StatelessWidget {
class GetActivityCard extends StatelessWidget {
final value;
GetActivityButton(this.value);
GetActivityCard(this.value);
@override
Widget build(BuildContext context) {
double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13);
return Container(
width: MediaQuery.of(context).size.height * 0.125,
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5),
width: width,
padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2),
margin: EdgeInsets.all(SizeConfig.widthMultiplier *1),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(width: 1, color: Color(0xFFEFEFEF)),
borderRadius: BorderRadius.circular(15),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
value.value.toString(),
fontSize: 27,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
),
AppText(
value.kPIParameter,
textOverflow: TextOverflow.clip,
fontSize: 10,
color: Color(0xFF2B353E),
textAlign: TextAlign.start,
fontWeight: FontWeight.w700,
),
],
padding: const EdgeInsets.fromLTRB(8,8, 8, 4),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
value.value.toString(),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25,
fontWeight: FontWeight.bold,
color: AppGlobal.appTextColor,
letterSpacing: -0.93,
),
AppText(
value.kPIParameter,
textOverflow: TextOverflow.clip,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9),
color: AppGlobal.appTextColor,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
letterSpacing: -0.33,
),
],
),
),
),
);

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -9,42 +11,87 @@ class GetOutPatientStack extends StatelessWidget {
@override
Widget build(BuildContext context) {
double barHeight =
SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17);
value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
value.summaryoptions
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
var list = new List<Widget>();
value.summaryoptions.forEach((result) =>
{list.add(getStack(result, value.summaryoptions.first.value,context))});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
height: 30,
child: AppText(
value.kPIName,
medium: true,
fontSize: 14,
),
{list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))});
return Container(
margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(20)
),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list)
],
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 0,
blurRadius: 9,
offset: Offset(0, 0), // changes position of shadow
),
],
),
child: Padding(
padding: const EdgeInsets.all(5.0),
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
child: Label(
firstLine: Helpers.getLabelFromKPI(value.kPIName),
secondLine: Helpers.getNameFromKPI(value.kPIName),
color: Color(0xFF2B353E),
firstLineFontSize:
SizeConfig.getHeightMultiplier(height: barHeight) *
(SizeConfig.isHeightVeryShort
? 10
: SizeConfig.isHeightShort
? 10
: 8.5),
secondLineFontSize:
SizeConfig.getHeightMultiplier(height: barHeight) *
(SizeConfig.isHeightVeryShort
? 15
: SizeConfig.isHeightShort
? 15
: 14.5),
),
),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list)
],
)
),
);
}
getStack(Summaryoptions value, max,context) {
getStack(Summaryoptions value, max, context, barHeight) {
return Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 2),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment(
0.0, 1.0), // 10% of the width, so there are ten blinds.
end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds.
colors: <Color>[Color(0x8FF5F6FA), Colors.red[50]], // red to yellow
tileMode: TileMode.mirror, // repeats the gradient over the canvas
),
borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(4),
// color: Colors.red[50],
),
child: Stack(children: [
@ -55,15 +102,15 @@ class GetOutPatientStack extends StatelessWidget {
child: Container(
child: SizedBox(),
padding: EdgeInsets.all(10),
height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0,
height: max != 0 ? ((barHeight) * value.value) / max : 0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(4),
color: Color(0x63D02127),
),
),
),
Container(
height: (MediaQuery.of(context).size.height * 0.24 ),
height: barHeight,
margin: EdgeInsets.only(left: 5, top: 5),
padding: EdgeInsets.all(10),
child: RotatedBox(
@ -71,29 +118,73 @@ class GetOutPatientStack extends StatelessWidget {
child: Center(
child: Align(
child: FittedBox(
child: Row(
children: [
AppText(
value.kPIParameter,
fontSize: 10,
textAlign: TextAlign.center,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
AppText(
' (' + value.value.toString() + ') ',
fontSize: 12,
textAlign: TextAlign.center,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
child: Row(
children: [
AppText(
value.kPIParameter,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
textAlign: TextAlign.center,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
letterSpacing: -0.3,
),
AppText(
' (' + value.value.toString() + ') ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
textAlign: TextAlign.center,
color: Color(0xFF2B353E),
letterSpacing: -0.3,
fontWeight: FontWeight.bold,
),
],
),
],
),
)),
)),
),
))
]),
),
);
}
}
// ignore: must_be_immutable
class Label extends StatelessWidget {
Label({
Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize,
}) : super(key: key);
final String firstLine;
final String secondLine;
Color color;
final double secondLineFontSize;
final double firstLineFontSize;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
firstLine,
fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) ,
// fontWeight: FontWeight.bold,
color: color,
fontHeight: .5,
letterSpacing: -0.72,
fontWeight: FontWeight.w600,
),
AppText(
secondLine,
color: color,
fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40),
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
),
],
);
}
}

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -5,11 +6,15 @@ class RowCounts extends StatelessWidget {
final name;
final int count;
final Color c;
RowCounts(this.name, this.count, this.c);
final double height;
RowCounts(this.name, this.count, this.c, {this.height});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 5, bottom: 5),
padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../util/extenstions.dart';
@ -46,17 +45,20 @@ class PatientCard extends StatelessWidget {
String nationalityName = patientInfo.nationalityName != null
? patientInfo.nationalityName.trim()
: patientInfo.nationality != null
? patientInfo.nationality.trim()
: patientInfo.nationalityId !=
null
? patientInfo.nationalityId
: "";
? patientInfo.nationality.trim()
: patientInfo.nationalityId != null
? patientInfo.nationalityId
: "";
return Container(
width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6),
padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0),
decoration:Helpers.getCardBoxDecoration(),
padding: EdgeInsets.only(
left: projectViewModel.isArabic ? 5 : 0,
right: projectViewModel.isArabic ? 0 : 5,
bottom: 0,
top: 0),
decoration: Helpers.getCardBoxDecoration(),
child: CardWithBgWidget(
padding: 0,
marginLeft: (!isMyPatient && isInpatient) ? 0 : 10,
@ -96,8 +98,11 @@ class PatientCard extends StatelessWidget {
patientInfo.patientStatusType == 43
? Row(
children: [
PatientStatus(label:TranslationBase.of(context)
.arrivedP,color:AppGlobal.appGreenColor,),
PatientStatus(
label: TranslationBase.of(context)
.arrivedP,
color: AppGlobal.appGreenColor,
),
SizedBox(
width: 8,
),
@ -111,18 +116,25 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 8,
),
PatientStatus(label:patientInfo.status == 2
? 'Confirmed'
: 'Booked',color: patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,),
PatientStatus(
label: patientInfo.status == 2
? 'Confirmed'
: 'Booked',
color: patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,
),
],
)
: patientInfo.patientStatusType == 42
? Row(
children: [
PatientStatus(label:TranslationBase.of(context)
.notArrived,color:Colors.red[800],),
PatientStatus(
label:
TranslationBase.of(context)
.notArrived,
color: Colors.red[800],
),
SizedBox(
width: 8,
),
@ -136,10 +148,14 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 8,
),
PatientStatus(label:patientInfo.status == 2 ? 'Confirmed'
: 'Booked',color:patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,)
PatientStatus(
label: patientInfo.status == 2
? 'Confirmed'
: 'Booked',
color: patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,
)
],
)
: !isFromSearch &&
@ -148,8 +164,12 @@ class PatientCard extends StatelessWidget {
null
? Row(
children: [
PatientStatus(label:TranslationBase.of(context)
.notArrived,color:Colors.red[800],),
PatientStatus(
label: TranslationBase.of(
context)
.notArrived,
color: Colors.red[800],
),
SizedBox(
width: 8,
),
@ -163,13 +183,17 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 8,
),
PatientStatus(label:patientInfo.status == 2
? 'Booked'
: 'Confirmed',color:
patientInfo.status == 2
? Colors.grey
: AppGlobal.appGreenColor,)
PatientStatus(
label:
patientInfo.status == 2
? 'Booked'
: 'Confirmed',
color:
patientInfo.status == 2
? Colors.grey
: AppGlobal
.appGreenColor,
)
],
)
: SizedBox(),
@ -182,29 +206,55 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w400,
)
: patientInfo.arrivedOn != null
? AppText(
AppDateUtils.getDayMonthYearDate(
AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn,
)) +
" " +
? Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn,
),
isMonthShort: true,
),
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
AppText(
"${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
],
)
: (patientInfo.appointmentDate !=
null &&
patientInfo
.appointmentDate.isNotEmpty)
? AppText(
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
patientInfo.appointmentDate,
))} ${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
? Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
"${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
patientInfo
.appointmentDate,
), isMonthShort: true)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
AppText(
" ${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
],
)
: SizedBox()
],
@ -216,7 +266,9 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 12,
),
PatientStatus(label:'My Patient',),
PatientStatus(
label: 'My Patient',
),
],
),
Padding(
@ -229,8 +281,7 @@ class PatientCard extends StatelessWidget {
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
isFromLiveCare
@ -259,7 +310,6 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1,
color: Colors.pink,
size: 18,
),
if (isFromLiveCare)
ShowTimer(
@ -311,99 +361,105 @@ class PatientCard extends StatelessWidget {
)
],
)),
SizedBox(height: 10,),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12.0,top: 5),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patientInfo.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
Padding(
padding: EdgeInsets.only(left: 12.0, top: 5),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patientInfo.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(height: 10,),
CustomRow(
label:
TranslationBase.of(context).fileNumber,
value: patientInfo.patientId.toString(),
),
CustomRow(
label:
TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
CustomRow(
label: patientInfo.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(height: 10,),
CustomRow(
label: TranslationBase.of(context)
.fileNumber,
value: patientInfo.patientId.toString(),
),
CustomRow(
label: TranslationBase.of(context).age +
" : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
CustomRow(
label:
patientInfo.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
value: patientInfo.admissionDate ==
null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.numOfDays +
" : ",
value: patientInfo.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.numOfDays +
" : ",
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.clinicName +
" : ",
value: "${patientInfo.clinicDescription}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label:
TranslationBase.of(context).roomNo +
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.clinicName +
" : ",
value: "${patientInfo.roomId}",
),
if (isFromLiveCare)
Column(
children: [
value:
"${patientInfo.clinicDescription}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.clinic +
.roomNo +
" : ",
value: patientInfo.clinicName,
value: "${patientInfo.roomId}",
),
],
),
]),
),
Icon(
Icons.arrow_forward,
size: 24,
),
],
))
]),
if (isFromLiveCare)
Column(
children: [
CustomRow(
label: TranslationBase.of(context)
.clinic +
" : ",
value: patientInfo.clinicName,
),
],
),
]),
),
Icon(
Icons.arrow_forward,
size: 24,
),
],
))
]),
isFromLiveCare
? Row(
mainAxisAlignment: MainAxisAlignment.end,
@ -459,16 +515,19 @@ class PatientCard extends StatelessWidget {
}
class PatientStatus extends StatelessWidget {
PatientStatus({
Key key, this.label, this.color,
PatientStatus({
Key key,
this.label,
this.color,
}) : super(key: key);
final String label;final Color color;
final String label;
final Color color;
@override
Widget build(BuildContext context) {
return AppText(
label,
color: color??AppGlobal.appGreenColor,
color: color ?? AppGlobal.appGreenColor,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 10,

@ -37,6 +37,7 @@ class CustomRow extends StatelessWidget {
fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
isCopyable: isCopyable,
),
],

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save