Merge branch 'elham' into 'master'
Elham See merge request Cloud_Solution/doctor_app_flutter!54merge-requests/55/merge
commit
a5c74b3f9e
@ -0,0 +1,143 @@
|
|||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class BodyMeasurementsScreen extends StatelessWidget {
|
||||||
|
BodyMeasurementsScreen();
|
||||||
|
List<VitalSignResModel> vitalList;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
_seriesData = List<charts.Series<Pollution, String>>();
|
||||||
|
_seriesPieData = List<charts.Series<Task, String>>();
|
||||||
|
_seriesLineData = List<charts.Series<Sales, int>>();
|
||||||
|
_generateData();
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: 'Body Measurements',
|
||||||
|
body: RoundedContainer(
|
||||||
|
height: SizeConfig.realScreenHeight*0.4,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'Body Mass Index',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.0, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: charts.BarChart(
|
||||||
|
_seriesData,
|
||||||
|
animate: true,
|
||||||
|
barGroupingType: charts.BarGroupingType.grouped,
|
||||||
|
// behaviors: [new charts.SeriesLegend()],
|
||||||
|
// primaryMeasureAxis: ,
|
||||||
|
animationDuration: Duration(seconds: 5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<charts.Series<Pollution, String>> _seriesData;
|
||||||
|
List<charts.Series<Task, String>> _seriesPieData;
|
||||||
|
List<charts.Series<Sales, int>> _seriesLineData;
|
||||||
|
|
||||||
|
_generateData() {
|
||||||
|
var data1 = [
|
||||||
|
new Pollution(1980, 'USA', 40),
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
_seriesData.add(
|
||||||
|
charts.Series(
|
||||||
|
domainFn: (Pollution pollution, _) => '',
|
||||||
|
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||||
|
id: '2017',
|
||||||
|
data: data1,
|
||||||
|
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||||
|
fillColorFn: (Pollution pollution, _) =>
|
||||||
|
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_seriesData.add(
|
||||||
|
charts.Series(
|
||||||
|
domainFn: (Pollution pollution, _) => '',
|
||||||
|
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||||
|
id: '2017',
|
||||||
|
data: data1,
|
||||||
|
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||||
|
fillColorFn: (Pollution pollution, _) =>
|
||||||
|
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_seriesData.add(
|
||||||
|
charts.Series(
|
||||||
|
domainFn: (Pollution pollution, _) => '',
|
||||||
|
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||||
|
id: '2017',
|
||||||
|
data: data1,
|
||||||
|
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||||
|
fillColorFn: (Pollution pollution, _) =>
|
||||||
|
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_seriesData.add(
|
||||||
|
charts.Series(
|
||||||
|
domainFn: (Pollution pollution, _) => '',
|
||||||
|
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||||
|
id: '2017',
|
||||||
|
data: data1,
|
||||||
|
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||||
|
fillColorFn: (Pollution pollution, _) =>
|
||||||
|
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_seriesData.add(
|
||||||
|
charts.Series(
|
||||||
|
domainFn: (Pollution pollution, _) => '',
|
||||||
|
measureFn: (Pollution pollution, _) => pollution.quantity,
|
||||||
|
id: '2017',
|
||||||
|
data: data1,
|
||||||
|
fillPatternFn: (_, __) => charts.FillPatternType.solid,
|
||||||
|
fillColorFn: (Pollution pollution, _) =>
|
||||||
|
charts.ColorUtil.fromDartColor(Color(0xff990099)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Pollution {
|
||||||
|
String place;
|
||||||
|
int year;
|
||||||
|
int quantity;
|
||||||
|
|
||||||
|
Pollution(this.year, this.place, this.quantity);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Task {
|
||||||
|
String task;
|
||||||
|
double taskvalue;
|
||||||
|
Color colorval;
|
||||||
|
|
||||||
|
Task(this.task, this.taskvalue, this.colorval);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Sales {
|
||||||
|
int yearval;
|
||||||
|
int salesval;
|
||||||
|
|
||||||
|
Sales(this.yearval, this.salesval);
|
||||||
|
}
|
Loading…
Reference in New Issue