bottom nav and dashboard_referral_patient

merge-requests/918/head
Elham Rababh 3 years ago
parent ecffe99f19
commit 47357fe84e

@ -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,19 @@ 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,
), ),
], ],
@ -132,7 +133,7 @@ class DashboardReferralPatient extends StatelessWidget {
) )
], ],
), ),
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 +147,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 +159,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,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,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,34 +41,44 @@ 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 &&
dashboardViewModel.notRepliedCount != 0)
Positioned( Positioned(
right: 18.0, right: 18.0,
bottom: 40.0, bottom: 40.0,
@ -80,9 +90,10 @@ class BottomNavigationItem extends StatelessWidget {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
// padding: EdgeInsets.all(2.0), // padding: EdgeInsets.all(2.0),
child: Text(dashboardViewModel.notRepliedCount.toString(), child: Text(
style: TextStyle( dashboardViewModel.notRepliedCount.toString(),
color: Colors.white, fontSize: 12.0)), style:
TextStyle(color: Colors.white, fontSize: 12.0)),
), ),
), ),
), ),

Loading…
Cancel
Save