dashboard and patient app
parent
bde30d93ec
commit
ac612f0eda
@ -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,
|
||||||
children: <Widget>[
|
child: Stack(
|
||||||
Align(
|
children: <Widget>[
|
||||||
alignment: FractionalOffset.topLeft,
|
Align(
|
||||||
child: Container(margin: EdgeInsets.all(10), child: Icon(widget.icon,),)
|
alignment: FractionalOffset.topLeft,
|
||||||
),
|
child: Container(
|
||||||
Align(
|
margin: EdgeInsets.all(10),
|
||||||
alignment: FractionalOffset.bottomRight,
|
child: Icon(
|
||||||
child: Container(margin: EdgeInsets.all(10), child: Column(
|
widget.icon,
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
color: widget.iconColor,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
),
|
||||||
children: <Widget>[
|
)),
|
||||||
AppText(widget.value,),
|
Align(
|
||||||
Text(widget.label),
|
alignment: FractionalOffset.bottomRight,
|
||||||
|
child: Container(
|
||||||
],))
|
margin: EdgeInsets.all(10),
|
||||||
),
|
child: Column(
|
||||||
],
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
) ,backgroundColor: widget.backgroundColor,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
showBorder: widget.showBorder, borderColor: widget.borderColor,);
|
children: <Widget>[
|
||||||
|
AppText(
|
||||||
|
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,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +1,56 @@
|
|||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DashboardItemTextsState extends State<DashboardItemTexts> {
|
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(
|
||||||
Align(
|
widget.label,
|
||||||
alignment: FractionalOffset.bottomRight,
|
fontSize: 12,
|
||||||
child: Container(margin: EdgeInsets.all(10), child: AppText(widget.value, fontWeight: FontWeight.bold),)
|
),
|
||||||
),
|
)),
|
||||||
|
Align(
|
||||||
],) ,backgroundColor: widget.backgroundColor, showBorder: widget.showBorder, borderColor: widget.borderColor, margin: 4,);
|
alignment: FractionalOffset.bottomRight,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
|
child: AppText(
|
||||||
|
widget.value,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
backgroundColor: widget.backgroundColor,
|
||||||
|
showBorder: widget.showBorder,
|
||||||
|
borderColor: widget.borderColor,
|
||||||
|
margin: 4,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue