working on dashboard

merge-requests/648/head
mosazaid 5 years ago
parent 2023ce9b55
commit 72ee88d567

@ -27,7 +27,10 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Swiper( return Container(
// height: MediaQuery.of(context).size.height * 0.35,
height: 230,
child: Swiper(
onIndexChanged: (index) { onIndexChanged: (index) {
if (mounted) { if (mounted) {
setState(() { setState(() {
@ -76,6 +79,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
viewportFraction: 0.9, viewportFraction: 0.9,
// scale: 0.9, // scale: 0.9,
// control: new SwiperControl(), // control: new SwiperControl(),
),
); );
} }
@ -83,21 +87,21 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
if (index == 1) if (index == 1)
return RoundedContainer( return RoundedContainer(
raduis: 16, raduis: 16,
margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(dashboardItemList[1]))); child: GetOutPatientStack(dashboardItemList[1])));
if (index == 0) if (index == 0)
return RoundedContainer( return RoundedContainer(
raduis: 16, raduis: 16,
margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(dashboardItemList[0]))); child: GetOutPatientStack(dashboardItemList[0])));
if (index == 2) if (index == 2)
return RoundedContainer( return RoundedContainer(
raduis: 16, raduis: 16,
margin: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded( Expanded(
@ -112,9 +116,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Padding(
flex: 1,
child: Padding(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
@ -136,14 +138,15 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
], ],
))), )),
Expanded( Expanded(
flex: 2, flex: 1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
RowCounts( Expanded(
child: RowCounts(
dashboardItemList[2] dashboardItemList[2]
.summaryoptions[0] .summaryoptions[0]
.kPIParameter, .kPIParameter,
@ -151,7 +154,9 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
.summaryoptions[0] .summaryoptions[0]
.value, .value,
Colors.black), Colors.black),
RowCounts( ),
Expanded(
child: RowCounts(
dashboardItemList[2] dashboardItemList[2]
.summaryoptions[1] .summaryoptions[1]
.kPIParameter, .kPIParameter,
@ -159,7 +164,9 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
.summaryoptions[1] .summaryoptions[1]
.value, .value,
Colors.grey), Colors.grey),
RowCounts( ),
Expanded(
child: RowCounts(
dashboardItemList[2] dashboardItemList[2]
.summaryoptions[2] .summaryoptions[2]
.kPIParameter, .kPIParameter,
@ -167,6 +174,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
.summaryoptions[2] .summaryoptions[2]
.value, .value,
Colors.red), Colors.red),
),
], ],
), ),
) )
@ -187,7 +195,7 @@ class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
widget.model widget.model
.getPatientCount(dashboardItemList[2]) .getPatientCount(dashboardItemList[2])
.toString(), .toString(),
fontSize: 30, fontSize: 28,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
], ],

@ -202,9 +202,7 @@ class _HomeScreenState extends State<HomeScreen> {
])), ])),
content: Column( content: Column(
children: [ children: [
Container( model.dashboardItemsList.length > 0
height: MediaQuery.of(context).size.height * 0.35,
child: model.dashboardItemsList.length > 0
? DashboardSwipeWidget( ? DashboardSwipeWidget(
model.dashboardItemsList, model.dashboardItemsList,
model, model,
@ -214,7 +212,7 @@ class _HomeScreenState extends State<HomeScreen> {
}); });
}, },
) )
: SizedBox()), : SizedBox(),
model.dashboardItemsList.length > 0 model.dashboardItemsList.length > 0
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,

@ -19,9 +19,13 @@ class GetOutPatientStack extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
AppText( Container(
height: 30,
child: AppText(
value.kPIName, value.kPIName,
medium: true, medium: true,
fontSize: 14,
),
), ),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list)
], ],

@ -24,7 +24,7 @@ class RowCounts extends StatelessWidget {
name, name,
color: Colors.black, color: Colors.black,
textAlign: TextAlign.start, // from TextAlign.center textAlign: TextAlign.start, // from TextAlign.center
fontSize: 12, fontSize: 11,
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
), ),
@ -32,7 +32,7 @@ class RowCounts extends StatelessWidget {
' (' + count.toString() + ')', ' (' + count.toString() + ')',
color: Colors.black, color: Colors.black,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 13, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
], ],

Loading…
Cancel
Save