Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into add_medication_details
Conflicts: lib/util/translations_delegate_base.dartmerge-requests/323/head
commit
8615671095
@ -0,0 +1,108 @@
|
|||||||
|
class ItemByMedicineModel {
|
||||||
|
List<Frequencies> frequencies;
|
||||||
|
List<Routes> routes;
|
||||||
|
List<Strengths> strengths;
|
||||||
|
|
||||||
|
ItemByMedicineModel({this.frequencies, this.routes, this.strengths});
|
||||||
|
|
||||||
|
ItemByMedicineModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['frequencies'] != null) {
|
||||||
|
frequencies = new List<Frequencies>();
|
||||||
|
json['frequencies'].forEach((v) {
|
||||||
|
frequencies.add(new Frequencies.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (json['routes'] != null) {
|
||||||
|
routes = new List<Routes>();
|
||||||
|
json['routes'].forEach((v) {
|
||||||
|
routes.add(new Routes.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (json['strengths'] != null) {
|
||||||
|
strengths = new List<Strengths>();
|
||||||
|
json['strengths'].forEach((v) {
|
||||||
|
strengths.add(new Strengths.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.frequencies != null) {
|
||||||
|
data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.routes != null) {
|
||||||
|
data['routes'] = this.routes.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.strengths != null) {
|
||||||
|
data['strengths'] = this.strengths.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Frequencies {
|
||||||
|
String description;
|
||||||
|
bool isDefault;
|
||||||
|
int parameterCode;
|
||||||
|
|
||||||
|
Frequencies({this.description, this.isDefault, this.parameterCode});
|
||||||
|
|
||||||
|
Frequencies.fromJson(Map<String, dynamic> json) {
|
||||||
|
description = json['description'];
|
||||||
|
isDefault = json['isDefault'];
|
||||||
|
parameterCode = json['parameterCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['isDefault'] = this.isDefault;
|
||||||
|
data['parameterCode'] = this.parameterCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Strengths {
|
||||||
|
String description;
|
||||||
|
bool isDefault;
|
||||||
|
int parameterCode;
|
||||||
|
|
||||||
|
Strengths({this.description, this.isDefault, this.parameterCode});
|
||||||
|
|
||||||
|
Strengths.fromJson(Map<String, dynamic> json) {
|
||||||
|
description = json['description'];
|
||||||
|
isDefault = json['isDefault'];
|
||||||
|
parameterCode = json['parameterCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['isDefault'] = this.isDefault;
|
||||||
|
data['parameterCode'] = this.parameterCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Routes {
|
||||||
|
String description;
|
||||||
|
bool isDefault;
|
||||||
|
int parameterCode;
|
||||||
|
|
||||||
|
Routes({this.description, this.isDefault, this.parameterCode});
|
||||||
|
|
||||||
|
Routes.fromJson(Map<String, dynamic> json) {
|
||||||
|
description = json['description'];
|
||||||
|
isDefault = json['isDefault'];
|
||||||
|
parameterCode = json['parameterCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['isDefault'] = this.isDefault;
|
||||||
|
data['parameterCode'] = this.parameterCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
class ItemByMedicineRequestModel {
|
||||||
|
String vidaAuthTokenID;
|
||||||
|
int medicineCode;
|
||||||
|
|
||||||
|
ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode});
|
||||||
|
|
||||||
|
ItemByMedicineRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
|
medicineCode = json['MedicineCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
|
data['MedicineCode'] = this.medicineCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,54 @@
|
|||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
class GaugeChart extends StatelessWidget {
|
||||||
|
final List<charts.Series> seriesList;
|
||||||
|
final bool animate;
|
||||||
|
|
||||||
|
GaugeChart(this.seriesList, {this.animate});
|
||||||
|
|
||||||
|
/// Creates a [PieChart] with sample data and no transition.
|
||||||
|
factory GaugeChart.withSampleData() {
|
||||||
|
return new GaugeChart(
|
||||||
|
_createSampleData(),
|
||||||
|
// Disable animations for image tests.
|
||||||
|
animate: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return new charts.PieChart(seriesList,
|
||||||
|
animate: animate,
|
||||||
|
defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10));
|
||||||
|
//);
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<charts.Series<GaugeSegment, String>> _createSampleData() {
|
||||||
|
final data = [
|
||||||
|
new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault),
|
||||||
|
new GaugeSegment(
|
||||||
|
'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault),
|
||||||
|
new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault),
|
||||||
|
new GaugeSegment(
|
||||||
|
'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault),
|
||||||
|
];
|
||||||
|
|
||||||
|
return [
|
||||||
|
new charts.Series<GaugeSegment, String>(
|
||||||
|
id: 'Segments',
|
||||||
|
domainFn: (GaugeSegment segment, _) => segment.segment,
|
||||||
|
measureFn: (GaugeSegment segment, _) => segment.size,
|
||||||
|
data: data,
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sample data type.
|
||||||
|
class GaugeSegment {
|
||||||
|
final String segment;
|
||||||
|
final int size;
|
||||||
|
final charts.Color color;
|
||||||
|
GaugeSegment(this.segment, this.size, this.color);
|
||||||
|
}
|
Loading…
Reference in New Issue