diff --git a/lib/routes.dart b/lib/routes.dart index dcef9fbe..f2f5f6bb 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,5 @@ +import './screens/patients/profile/vital_sign/body_measurements_screen.dart'; + import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; @@ -46,8 +48,7 @@ const String LAB_ORDERS = 'patients/lab_orders'; const String PRESCRIPTIONS = 'patients/prescription'; const String RADIOLOGY = 'patients/radiology'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; - - +const String BODY_MEASUREMENTS = 'patients/body-measurements'; var routes = { HOME: (_) => DashboardScreen(), @@ -63,15 +64,17 @@ var routes = { SETTINGS: (_) => SettingsScreen(), CHANGE_PASSWORD: (_) => ChangePasswordScreen(), VERIFY_ACCOUNT: (_) => VerifyAccountScreen(), - VERIFICATION_METHODS:(_)=> VerificationMethodsScreen(), - PATIENTS_PROFILE:(_)=> PatientProfileScreen(), - PHARMACIES_LIST: (_) => PharmaciesListScreen(itemID: null,), + VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), + PATIENTS_PROFILE: (_) => PatientProfileScreen(), + PHARMACIES_LIST: (_) => PharmaciesListScreen( + itemID: null, + ), VITAL_SIGN: (_) => VitalSignScreen(), MESSAGES: (_) => MessagesScreen(), SERVICES: (_) => ServicesScreen(), - LAB_ORDERS:(_)=>LabOrdersScreen(), - PRESCRIPTIONS:(_)=>PrescriptionScreen(), - RADIOLOGY:(_)=>RadiologyScreen(), - VITAL_SIGN_DETAILS:(_)=>VitalSignDetailsScreen(), - + LAB_ORDERS: (_) => LabOrdersScreen(), + PRESCRIPTIONS: (_) => PrescriptionScreen(), + RADIOLOGY: (_) => RadiologyScreen(), + VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), + BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen() }; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index c203dae9..d8c45a57 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -72,7 +72,7 @@ class _LoginsreenState extends State { return Text('Error: ${snapshot.error}'); } else { return Container( - margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 30), + margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart new file mode 100644 index 00000000..bf89edac --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart @@ -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 vitalList; + @override + Widget build(BuildContext context) { + _seriesData = List>(); + _seriesPieData = List>(); + _seriesLineData = List>(); + _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: [ + 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> _seriesData; + List> _seriesPieData; + List> _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); +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index bf4aad6b..a7155e01 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/routes.dart'; import 'package:flutter/material.dart'; import '../../../../config/size_config.dart'; @@ -10,7 +11,7 @@ class VitalSignDetailsScreen extends StatelessWidget { // VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key); VitalSignResModel vitalSing; String url = "assets/images/"; - final double contWidth = SizeConfig.realScreenWidth * 0.70; + final double contWidth = SizeConfig.realScreenWidth * 0.70; @override Widget build(BuildContext context) { @@ -19,7 +20,7 @@ class VitalSignDetailsScreen extends StatelessWidget { return AppScaffold( appBarTitle: "vital Sing ", body: RoundedContainer( - height: SizeConfig.realScreenHeight *0.7, + height: SizeConfig.realScreenHeight * 0.7, child: CustomScrollView( primary: false, slivers: [ @@ -31,18 +32,22 @@ class VitalSignDetailsScreen extends StatelessWidget { mainAxisSpacing: 0, crossAxisCount: 3, children: [ + InkWell( + onTap: (){ + Navigator.of(context).pushNamed(BODY_MEASUREMENTS); + }, + child: CircleAvatarWidget( + des: 'Body Measurements', + url: url + 'heartbeat.png', + ), + ), CircleAvatarWidget( - des: 'Body Measurements', - url: url + 'heartbeat.png', - - ), CircleAvatarWidget( des: 'Temperature', url: url + 'heartbeat.png', ), CircleAvatarWidget( des: 'Pulse', url: url + 'heartbeat.png', - ), CircleAvatarWidget( des: 'Respiration', @@ -52,10 +57,11 @@ class VitalSignDetailsScreen extends StatelessWidget { des: 'Blood Pressure', url: url + 'heartbeat.png', ), - CircleAvatarWidget( + CircleAvatarWidget( des: 'Oxygenation', url: url + 'heartbeat.png', - ), CircleAvatarWidget( + ), + CircleAvatarWidget( des: 'Pain Scale', url: url + 'heartbeat.png', ), diff --git a/pubspec.yaml b/pubspec.yaml index 00c18525..62c813b2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,6 +35,7 @@ dependencies: connectivity: ^0.4.8+2 maps_launcher: ^1.2.0 url_launcher: ^5.4.5 + charts_flutter: ^0.9.0