Merge branch 'Dec_fixes' into 'development'

Dec fixes

See merge request Cloud_Solution/doctor_app_flutter!918
merge-requests/919/merge
Elham Ali 4 years ago
commit f256527302

@ -1,4 +1,5 @@
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; 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/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
@ -96,19 +97,20 @@ class DashboardReferralPatient extends StatelessWidget {
RowCounts( RowCounts(
dashboardItemList[2].summaryoptions[0].kPIParameter, dashboardItemList[2].summaryoptions[0].kPIParameter,
dashboardItemList[2].summaryoptions[0].value, dashboardItemList[2].summaryoptions[0].value,
Colors.black, AppGlobal.appTextColor,
height: height, height: height,
), ),
RowCounts( RowCounts(
dashboardItemList[2].summaryoptions[1].kPIParameter, dashboardItemList[2].summaryoptions[1].kPIParameter,
dashboardItemList[2].summaryoptions[1].value, dashboardItemList[2].summaryoptions[1].value,
Colors.grey, Color(0xFFC8D0DC),
height: height, height: height,
), ),
RowCounts( RowCounts(
dashboardItemList[2].summaryoptions[2].kPIParameter, dashboardItemList[2].summaryoptions[2].kPIParameter,
dashboardItemList[2].summaryoptions[2].value, dashboardItemList[2].summaryoptions[2].value,
Colors.red, Color(0xFFEC6666),
height: height, height: height,
), ),
], ],
@ -127,12 +129,13 @@ class DashboardReferralPatient extends StatelessWidget {
children: [ children: [
AppText( AppText(
model.getPatientCount(dashboardItemList[2]).toString(), model.getPatientCount(dashboardItemList[2]).toString(),
fontSize: SizeConfig.textMultiplier * 3.0, fontSize: SizeConfig.textMultiplier * 3.2,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
], ],
), ),
top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35),
left: 0, left: 0,
right: 0) right: 0)
]), ]),
@ -146,11 +149,11 @@ class DashboardReferralPatient extends StatelessWidget {
static List<charts.Series<GaugeSegment, String>> _createReferralData(List<DashboardModel> dashboardItemList) { static List<charts.Series<GaugeSegment, String>> _createReferralData(List<DashboardModel> dashboardItemList) {
final data = [ final data = [
new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[0].value), charts.MaterialPalette.black), getValue(dashboardItemList[1].summaryoptions[0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)),
new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[1].value), charts.MaterialPalette.gray.shadeDefault), getValue(dashboardItemList[1].summaryoptions[1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),),
new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), getValue(dashboardItemList[1].summaryoptions[2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),),
]; ];
return [ return [
@ -158,6 +161,8 @@ class DashboardReferralPatient extends StatelessWidget {
id: 'Segments', id: 'Segments',
domainFn: (GaugeSegment segment, _) => segment.segment, domainFn: (GaugeSegment segment, _) => segment.segment,
measureFn: (GaugeSegment segment, _) => segment.size, measureFn: (GaugeSegment segment, _) => segment.size,
strokeWidthPxFn: (GaugeSegment segment, _)=>200,
data: data, data: data,
colorFn: (GaugeSegment segment, _) => segment.color, colorFn: (GaugeSegment segment, _) => segment.color,
) )

@ -1,21 +1,91 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
// class MethodTypeCard extends StatelessWidget {
// const MethodTypeCard({
// Key key,
// this.assetPath,
// this.onTap,
// this.label, this.height = 20, this.isSvg = true,
// }) : super(key: key);
// final String assetPath;
// final Function onTap;
// final String label;
// final double height;
// final bool isSvg;
//
// @override
// Widget build(BuildContext context) {
// return InkWell(
// onTap: onTap,
// child: Container(
// margin: EdgeInsets.all(10),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(
// Radius.circular(10),
// ),
// border: Border.all(
// color: HexColor('#707070'),
// width: 0.1),
// ),
// height: 170,
// child: Padding(
// padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Row(
// children: [
// isSvg?SvgPicture.asset(assetPath, height: 60,
// width: 60,):Image.asset(
// assetPath,
// height: 60,
// width: 60,
// ),
// ],
// ),
// SizedBox(
// height:height ,
// ),
// AppText(
// label,
// fontSize: 14,
// color: Color(0xFF2E303A),
// fontWeight: FontWeight.bold,
// )
// ],
// ),
// )),
// );
// }
// }
//
//
//
class MethodTypeCard extends StatelessWidget { class MethodTypeCard extends StatelessWidget {
const MethodTypeCard({ const MethodTypeCard({
Key key, Key key,
this.assetPath, this.assetPath,
this.onTap, this.onTap,
this.label, this.height = 20, this.label,
this.height = 20, this.isSvg = true,
}) : super(key: key); }) : super(key: key);
final String assetPath; final String assetPath;
final Function onTap; final GestureTapCallback onTap;
final String label; final String label;
final double height; final double height;
final bool isSvg;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20);
return InkWell( return InkWell(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
@ -25,38 +95,37 @@ class MethodTypeCard extends StatelessWidget {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10), Radius.circular(10),
), ),
border: Border.all( border: Border.all(color: HexColor('#707070'), width: 0.1),
color: HexColor('#707070'),
width: 0.1),
), ),
height: 170, height: cardHeight,
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(20, 15, 20, 15), padding: const EdgeInsets.all(12.0),
child: Column( child: Center(
mainAxisAlignment: MainAxisAlignment.center, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: <Widget>[
children: [ isSvg?SvgPicture.asset(assetPath, width: SizeConfig.widthMultiplier* (14),
Image.asset( height: cardHeight * 0.20): Image.asset(
assetPath, assetPath,
height: 60, width: SizeConfig.widthMultiplier* (12),
width: 60, height: cardHeight * 0.35,
), // height: ,
], ),
), SizedBox(
SizedBox( height: height,
height:height , ),
), AppText(
AppText( label,
label, fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7),
fontSize: 14, color: Color(0xFF2B353E),
color: Color(0xFF2E303A), fontWeight: FontWeight.w700,
fontWeight: FontWeight.bold, )
) ],
], ),
), ),
)), )),
); );
} }
} }

@ -37,7 +37,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
switch (widget.authMethodType) { switch (widget.authMethodType) {
case AuthMethodTypes.WhatsApp: case AuthMethodTypes.WhatsApp:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/verify-whtsapp.png', assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg',
onTap: () => onTap: () =>
{widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)},
label: TranslationBase label: TranslationBase
@ -47,7 +47,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
break; break;
case AuthMethodTypes.SMS: case AuthMethodTypes.SMS:
return MethodTypeCard( return MethodTypeCard(
assetPath: "assets/images/verify-sms.png", assetPath: "assets/images/svgs/verification/verify-sms.svg",
onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)},
label:TranslationBase label:TranslationBase
.of(context) .of(context)
@ -56,7 +56,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
break; break;
case AuthMethodTypes.Fingerprint: case AuthMethodTypes.Fingerprint:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/verification_fingerprint_icon.png', assetPath: 'assets/images/svgs/verification/verify-finger.svg',
onTap: () async { onTap: () async {
if (await widget.authenticationViewModel if (await widget.authenticationViewModel
.checkIfBiometricAvailable(BiometricType.fingerprint)) { .checkIfBiometricAvailable(BiometricType.fingerprint)) {
@ -71,7 +71,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
break; break;
case AuthMethodTypes.FaceID: case AuthMethodTypes.FaceID:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/verification_faceid_icon.png', assetPath: 'assets/images/svgs/verification/verify-face.svg',
onTap: () async { onTap: () async {
if (await widget.authenticationViewModel if (await widget.authenticationViewModel
.checkIfBiometricAvailable(BiometricType.face)) { .checkIfBiometricAvailable(BiometricType.face)) {
@ -88,6 +88,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/login/more_icon.png', assetPath: 'assets/images/login/more_icon.png',
onTap: widget.onShowMore, onTap: widget.onShowMore,
isSvg: false,
label: TranslationBase.of(context).moreVerification, label: TranslationBase.of(context).moreVerification,
height: 0, height: 0,
); );

@ -17,7 +17,7 @@ class GetActivityCard extends StatelessWidget {
margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), margin: EdgeInsets.all(SizeConfig.widthMultiplier *1),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border.all(width: 1, color: Color(0xFFEFEFEF)), border: Border.all(width: 1.5, color: Color(0xFFEFEFEF)),
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child: Padding( child: Padding(

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/screens/home/label.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -88,7 +89,7 @@ class GetOutPatientStack extends StatelessWidget {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topLeft, 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 colors: <Color>[Color(0x8FF5F6FA), Colors.red[100]], // red to yellow
tileMode: TileMode.mirror, // repeats the gradient over the canvas tileMode: TileMode.mirror, // repeats the gradient over the canvas
), ),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
@ -105,7 +106,7 @@ class GetOutPatientStack extends StatelessWidget {
height: max != 0 ? ((barHeight) * value.value) / max : 0, height: max != 0 ? ((barHeight) * value.value) / max : 0,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
color: Color(0x63D02127), color: Color(0xFFD02127).withOpacity(0.39),
), ),
), ),
), ),
@ -149,42 +150,3 @@ class GetOutPatientStack extends StatelessWidget {
} }
// 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/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,20 +25,23 @@ class RowCounts extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Expanded( AppText(
child: AppText( name,
name, color: AppGlobal.appTextColor,
color: Colors.black, fontWeight: FontWeight.w400,
textAlign: TextAlign.start, // from TextAlign.center textAlign: TextAlign.start, // from TextAlign.center
fontSize: 11, fontSize: 14,
textOverflow: TextOverflow.ellipsis, letterSpacing: -0.84,
),
textOverflow: TextOverflow.ellipsis,
), ),
SizedBox(width: 4,),
AppText( AppText(
' (' + count.toString() + ')', count.toString(),
color: Colors.black, color: AppGlobal.appTextColor,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 14,
letterSpacing: -0.84,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
], ],

@ -1,4 +1,6 @@
import 'package:badges/badges.dart'; import 'package:badges/badges.dart';
import 'package:doctor_app_flutter/config/config.dart';
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/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -16,16 +18,14 @@ class BottomNavigationItem extends StatelessWidget {
final String name; final String name;
final DashboardViewModel dashboardViewModel; final DashboardViewModel dashboardViewModel;
BottomNavigationItem( BottomNavigationItem(
{this.icon, {this.icon,
this.activeIcon, this.activeIcon,
this.changeIndex, this.changeIndex,
this.index, this.index,
this.currentIndex, this.currentIndex,
this.name, this.dashboardViewModel}); this.name,
this.dashboardViewModel});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -41,51 +41,62 @@ class BottomNavigationItem extends StatelessWidget {
child: Stack( child: Stack(
alignment: AlignmentDirectional.center, alignment: AlignmentDirectional.center,
children: [ children: [
if (currentIndex == index)
Positioned(
top: 0,
child: Container(
color: AppGlobal.appRedColor,
width: 100,
height: 3,
)),
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
SizedBox(height: 15,), SizedBox(
height: 15,
),
Container( Container(
child: Icon(currentIndex == index ? activeIcon : icon, child: Icon(currentIndex == index ? activeIcon : icon,
color: currentIndex == index color: AppGlobal.appTextColor, size: 22.0),
? Color(0xFF333C45) ),
: Theme.of(context).dividerColor, SizedBox(
size: 22.0), height: 8,
), ),
SizedBox(height: 5,),
Expanded( Expanded(
child: Text( child: Text(name ?? "",
name, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: currentIndex == index fontSize:
? Theme.of(context).primaryColor SizeConfig.getTextMultiplierBasedOnWidth() *
: Theme.of(context).dividerColor, 2,
), color: AppGlobal.appTextColor,
), fontWeight: FontWeight.w600) //#989898,
),
), ),
], ],
), ),
if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) if (currentIndex == 3 &&
Positioned( dashboardViewModel.notRepliedCount != 0)
right: 18.0, Positioned(
bottom: 40.0, right: 18.0,
child: Badge( bottom: 40.0,
toAnimate: false, child: Badge(
position: BadgePosition.topEnd(), toAnimate: false,
shape: BadgeShape.circle, position: BadgePosition.topEnd(),
badgeColor: Colors.red[800], shape: BadgeShape.circle,
borderRadius: BorderRadius.circular(8), badgeColor: Colors.red[800],
badgeContent: Container( borderRadius: BorderRadius.circular(8),
// padding: EdgeInsets.all(2.0), badgeContent: Container(
child: Text(dashboardViewModel.notRepliedCount.toString(), // padding: EdgeInsets.all(2.0),
style: TextStyle( child: Text(
color: Colors.white, fontSize: 12.0)), dashboardViewModel.notRepliedCount.toString(),
style:
TextStyle(color: Colors.white, fontSize: 12.0)),
),
), ),
), ),
),
], ],
), ),
), ),

@ -516,7 +516,7 @@ packages:
source: hosted source: hosted
version: "0.3.4" version: "0.3.4"
flutter_svg: flutter_svg:
dependency: transitive dependency: "direct main"
description: description:
name: flutter_svg name: flutter_svg
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"

@ -60,7 +60,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2 cupertino_icons: ^0.1.2
# SVG # SVG
#flutter_svg: ^0.17.4 flutter_svg: ^0.18.1
percent_indicator: ^2.1.1 percent_indicator: ^2.1.1
#Dependency Injection #Dependency Injection
@ -130,6 +130,7 @@ flutter:
- assets/images/ - assets/images/
- assets/images/dashboard/ - assets/images/dashboard/
- assets/images/login/ - assets/images/login/
- assets/images/svgs/verification/
- assets/images/patient/ - assets/images/patient/
- assets/images/patient/vital_signs/ - assets/images/patient/vital_signs/

Loading…
Cancel
Save