Merge branch 'development_new_design_2.0' into Fatima-New-Design
# Conflicts: # lib/pages/pharmacies/product-brands.dart # lib/pages/pharmacies/screens/lakum-main-page.dartmerge-requests/482/head
commit
28678633e7
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@ -0,0 +1,17 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class PharmacyPagesViewModel with ChangeNotifier {
|
||||
int currentTab = 0;
|
||||
PageController pageController;
|
||||
|
||||
PharmacyPagesViewModel() {
|
||||
pageController = PageController(keepPage: true);
|
||||
}
|
||||
changeCurrentTab(int tab) {
|
||||
if (pageController.hasClients) {
|
||||
currentTab = tab;
|
||||
pageController.jumpToPage(tab);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,37 @@
|
||||
class healthData {
|
||||
int MedCategoryID;
|
||||
int MedSubCategoryID;
|
||||
String Value;
|
||||
String Notes;
|
||||
String MachineDate;
|
||||
double Value;
|
||||
int TransactionsListID;
|
||||
}
|
||||
String Notes;
|
||||
|
||||
healthData({
|
||||
this.MedCategoryID,
|
||||
this.MedSubCategoryID,
|
||||
this.MachineDate,
|
||||
this.Value,
|
||||
this.TransactionsListID,
|
||||
this.Notes,
|
||||
});
|
||||
|
||||
healthData.fromJson(Map<String, dynamic> json) {
|
||||
MedCategoryID = json['MedCategoryID'];
|
||||
MedSubCategoryID = json['MedSubCategoryID'];
|
||||
MachineDate = json['MachineDate'];
|
||||
Value = json['Value'];
|
||||
TransactionsListID = json['TransactionsListID'];
|
||||
Notes = json['Notes'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['MedCategoryID'] = this.MedCategoryID;
|
||||
data['MedSubCategoryID'] = this.MedSubCategoryID;
|
||||
data['MachineDate'] = this.MachineDate;
|
||||
data['Value'] = this.Value;
|
||||
data['TransactionsListID'] = this.TransactionsListID;
|
||||
data['Notes'] = this.Notes;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LaserBooking extends StatefulWidget {
|
||||
@override
|
||||
_LaserBookingState createState() => _LaserBookingState();
|
||||
}
|
||||
|
||||
class _LaserBookingState extends State<LaserBooking> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(isShowDecPage: false, isShowAppBar: true, showNewAppBarTitle: true, showNewAppBar: true, appBarTitle: TranslationBase.of(context).laserClinic, body: Container());
|
||||
}
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CardCommonEr extends StatelessWidget {
|
||||
final image;
|
||||
final text;
|
||||
final subText;
|
||||
final bool locked;
|
||||
|
||||
final Function onTap;
|
||||
const CardCommonEr({
|
||||
this.locked = false,
|
||||
@required this.image,
|
||||
@required this.text,
|
||||
@required this.subText,
|
||||
@required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: locked ? null : onTap,
|
||||
child: Opacity(
|
||||
opacity: locked ? 0.25 : 1.0,
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Color(0xffefefef),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Image.asset(this.image, width: 42.0, height: 42.0),
|
||||
Text(
|
||||
text + "${subText.isEmpty ? "" : "\n$subText"}",
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (locked) Align(alignment: Alignment.center, child: lock())
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget lock() {
|
||||
return Container(
|
||||
child: Icon(Icons.lock_rounded, size: 80),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:giffy_dialog/giffy_dialog.dart';
|
||||
import 'package:maps_launcher/maps_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class CardPosition extends StatelessWidget {
|
||||
final image;
|
||||
final text;
|
||||
final subText;
|
||||
final type;
|
||||
final telephone;
|
||||
final networkImage;
|
||||
final latitude;
|
||||
final longitude;
|
||||
final projectname;
|
||||
final cardSize;
|
||||
final String waitingTime;
|
||||
|
||||
const CardPosition({
|
||||
@required this.image,
|
||||
@required this.text,
|
||||
@required this.subText,
|
||||
@required this.type,
|
||||
@required this.telephone,
|
||||
@required this.networkImage,
|
||||
@required this.latitude,
|
||||
@required this.longitude,
|
||||
@required this.projectname,
|
||||
@required this.cardSize,
|
||||
@required this.waitingTime,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
navigateToSearch(context, this.type, this.telephone, this.networkImage, this.latitude, this.longitude, this.projectname);
|
||||
},
|
||||
child: Container(
|
||||
// width:MediaQuery.of(context).size.width * 0.47,//165,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),
|
||||
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: cardSize * 0.2 - 8,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
|
||||
child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 2 * SizeConfig.textMultiplier)),
|
||||
),
|
||||
Container(
|
||||
height: cardSize * 0.5 - 8,
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 8.0),
|
||||
child: Image.asset(this.image, width: 60.0, height: cardSize * 0.4),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
|
||||
height: cardSize * 0.2 - 8,
|
||||
child: Text(this.subText, overflow: TextOverflow.clip, style: TextStyle(color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future navigateToSearch(context, type, telephone, networkImage, latitude, longitude, projectname) async {
|
||||
var localize = TranslationBase.of(context);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AssetGiffyDialog(
|
||||
entryAnimation: EntryAnimation.BOTTOM,
|
||||
image: Image.network(
|
||||
networkImage,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
title: Text(
|
||||
projectname,
|
||||
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
|
||||
),
|
||||
description: Text(
|
||||
"${localize.averageWaitingTime}\n\n$waitingTime ${localize.minute}",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
buttonOkText: Text(
|
||||
"LOCATION",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
buttonOkColor: Colors.grey,
|
||||
buttonCancelText: Text(
|
||||
'CAll',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
buttonCancelColor: Colors.grey,
|
||||
onOkButtonPressed: () {
|
||||
MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude), projectname);
|
||||
},
|
||||
onCancelButtonPressed: () {
|
||||
launch("tel://" + telephone);
|
||||
}));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,274 @@
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
|
||||
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
|
||||
import 'package:fit_kit/fit_kit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class syncHealthDataButton extends StatefulWidget {
|
||||
double marginTop;
|
||||
|
||||
double hight;
|
||||
|
||||
double minWidth;
|
||||
|
||||
syncHealthDataButton({this.marginTop, this.hight, this.minWidth});
|
||||
|
||||
@override
|
||||
_syncHealthDataButtonState createState() => _syncHealthDataButtonState();
|
||||
}
|
||||
|
||||
class _syncHealthDataButtonState extends State<syncHealthDataButton> {
|
||||
List<DataType> dataTypes = List();
|
||||
|
||||
List<healthData> Med_InsertTransactionsInputsList = new List();
|
||||
List<healthData> Med_InsertTransactionsInputsList2 = new List();
|
||||
|
||||
List<healthData> sleepDataList = new List();
|
||||
|
||||
List<healthData> healthDataList = new List();
|
||||
|
||||
int TransactionsListID = 1;
|
||||
|
||||
int MedCategoryID = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
dataTypes.add(DataType.DISTANCE);
|
||||
dataTypes.add(DataType.STEP_COUNT);
|
||||
dataTypes.add(DataType.HEART_RATE);
|
||||
// dataTypes.add(DataType.SLEEP);
|
||||
// dataTypes.add(DataType.ENERGY);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: DefaultButton(TranslationBase.of(context).syncHealthData, () {
|
||||
print("ReadAll");
|
||||
readAll();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void readAll() async {
|
||||
TransactionsListID = 1;
|
||||
var MedSubCategoryID = 0;
|
||||
double value = 0.0;
|
||||
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
Med_InsertTransactionsInputsList.clear();
|
||||
var date;
|
||||
var differenceInHours;
|
||||
String strDifferenceInHours;
|
||||
var differenceInMinutes;
|
||||
String strDifferenceInMinutes;
|
||||
var today = DateTime.now();
|
||||
var yearNum = DateFormat('y').format(today).toString();
|
||||
|
||||
var firstDayOfTheYear = DateTime.parse(yearNum + "-" + "01" + "-" + "01");
|
||||
|
||||
if (await FitKit.requestPermissions(dataTypes)) {
|
||||
for (DataType type in dataTypes) {
|
||||
final results = await FitKit.read(
|
||||
type,
|
||||
dateFrom: firstDayOfTheYear,
|
||||
dateTo: DateTime.now(),
|
||||
limit: 1000500,
|
||||
);
|
||||
|
||||
if (type == DataType.DISTANCE) {
|
||||
MedCategoryID = 7;
|
||||
} else if (type == DataType.STEP_COUNT) {
|
||||
MedCategoryID = 6;
|
||||
} else if (type == DataType.HEART_RATE) {
|
||||
MedCategoryID = 3;
|
||||
}
|
||||
|
||||
results.forEach((result) {
|
||||
// print("in forEach");
|
||||
date = result.dateTo;
|
||||
if (result.value.runtimeType.toString() == "int") {
|
||||
value = double.parse(result.value.toString());
|
||||
} else {
|
||||
value = result.value;
|
||||
}
|
||||
|
||||
MedSubCategoryID = 0;
|
||||
|
||||
if (MedCategoryID == 4) {
|
||||
differenceInHours = null;
|
||||
var sleepDate = result.dateFrom.toString().substring(0, 10);
|
||||
|
||||
DateTime dateFrom = result.dateFrom;
|
||||
DateTime dateTo = result.dateTo;
|
||||
|
||||
differenceInMinutes = dateTo.difference(dateFrom).inMinutes;
|
||||
differenceInMinutes > 59 ? differenceInHours = differenceInMinutes / 60 : differenceInMinutes = differenceInMinutes;
|
||||
|
||||
if (differenceInHours != null && differenceInHours != 0) {
|
||||
differenceInHours = differenceInHours.toInt();
|
||||
differenceInMinutes = differenceInMinutes % 60;
|
||||
|
||||
differenceInHours < 10 ? strDifferenceInHours = "0" + differenceInHours.toString() : strDifferenceInHours = differenceInHours.toString();
|
||||
} else {
|
||||
strDifferenceInHours = "00";
|
||||
differenceInHours = 00;
|
||||
}
|
||||
differenceInMinutes < 10 ? strDifferenceInMinutes = "0" + differenceInMinutes.toString() : strDifferenceInMinutes = differenceInMinutes.toString();
|
||||
|
||||
sleepDate = DateTime.parse(sleepDate + " " + strDifferenceInHours + ":" + strDifferenceInMinutes + ":" + "00.00").toString();
|
||||
String hours = sleepDate.substring(11, sleepDate.indexOf(":"));
|
||||
print(hours);
|
||||
|
||||
String minutes = sleepDate.substring(sleepDate.indexOf(":") + 1, sleepDate.indexOf(":") + 3);
|
||||
print(minutes);
|
||||
|
||||
if (value == 0 || value == 109) {
|
||||
print("in Bed");
|
||||
MedSubCategoryID = 1;
|
||||
value = double.parse(hours + "." + minutes);
|
||||
print("value");
|
||||
print(value);
|
||||
} else if (value == 1 || value == 110) {
|
||||
print("Sleep");
|
||||
MedSubCategoryID = 2;
|
||||
value = double.parse(hours + "." + minutes);
|
||||
print("value");
|
||||
print(value);
|
||||
}
|
||||
}
|
||||
date = DateUtil.convertDateToString(date);
|
||||
Med_InsertTransactionsInputsList.add(
|
||||
healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++, Notes: ""));
|
||||
});
|
||||
}
|
||||
}
|
||||
getAllHealthDataLists();
|
||||
}
|
||||
|
||||
void getAllHealthDataLists() {
|
||||
var totalSteps = 0.0;
|
||||
var totalDistance = 0.0;
|
||||
// double totalCalories = 0.0 ;
|
||||
double totalHeartRate = 0.0;
|
||||
double avgTotalHeartRate = 0.0;
|
||||
var counter = 0;
|
||||
List data = [];
|
||||
TransactionsListID = 1;
|
||||
|
||||
DateTime date;
|
||||
sleepDataList.clear();
|
||||
|
||||
Med_InsertTransactionsInputsList.forEach((result) {
|
||||
data.add(result.toJson());
|
||||
});
|
||||
|
||||
Med_InsertTransactionsInputsList2.clear();
|
||||
|
||||
var newMap = groupBy(data, (obj) => DateUtil.convertStringToDate(obj['MachineDate']).toString().substring(0, 10));
|
||||
|
||||
newMap.forEach((key, value) {
|
||||
totalSteps = 0.0;
|
||||
totalDistance = 0.0;
|
||||
totalHeartRate = 0.0;
|
||||
avgTotalHeartRate = 0.0;
|
||||
counter = 0;
|
||||
|
||||
date = DateTime.parse(key);
|
||||
|
||||
value.forEach((element) {
|
||||
if (element['MedCategoryID'] == 6) {
|
||||
MedCategoryID = 6;
|
||||
|
||||
totalSteps += element['Value'];
|
||||
} else if (element['MedCategoryID'] == 7) {
|
||||
MedCategoryID = 7;
|
||||
// to convert from meter to km
|
||||
totalDistance += (element['Value'] * 0.001);
|
||||
} else if (element['MedCategoryID'] == 3) {
|
||||
print("HeartRate");
|
||||
MedCategoryID = 3;
|
||||
counter++;
|
||||
totalHeartRate += element['Value'];
|
||||
} else if (element['MedCategoryID'] == 4) {
|
||||
print("sleeeeep");
|
||||
sleepDataList.add(new healthData(
|
||||
MedCategoryID: 4,
|
||||
MedSubCategoryID: element['MedSubCategoryID'],
|
||||
MachineDate: DateUtil.convertDateToString(date),
|
||||
Value: element['Value'],
|
||||
TransactionsListID: TransactionsListID++,
|
||||
Notes: ""));
|
||||
|
||||
Med_InsertTransactionsInputsList2.add(new healthData(
|
||||
MedCategoryID: 4,
|
||||
MedSubCategoryID: element['MedSubCategoryID'],
|
||||
MachineDate: DateUtil.convertDateToString(date),
|
||||
Value: element['Value'],
|
||||
TransactionsListID: TransactionsListID++,
|
||||
Notes: ""));
|
||||
}
|
||||
// else if(element['MedCategoryID'] == 8){
|
||||
//
|
||||
// totalCalories += element['Value'] ;
|
||||
// }
|
||||
});
|
||||
|
||||
if (counter == 0) {
|
||||
counter = 1;
|
||||
}
|
||||
if (totalHeartRate == 0) {
|
||||
avgTotalHeartRate = 0;
|
||||
} else {
|
||||
avgTotalHeartRate = totalHeartRate / counter;
|
||||
}
|
||||
|
||||
Med_InsertTransactionsInputsList2.add(
|
||||
new healthData(MedCategoryID: 6, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalSteps, TransactionsListID: TransactionsListID++, Notes: ""));
|
||||
Med_InsertTransactionsInputsList2.add(
|
||||
new healthData(MedCategoryID: 7, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalDistance, TransactionsListID: TransactionsListID++, Notes: ""));
|
||||
Med_InsertTransactionsInputsList2.add(
|
||||
new healthData(MedCategoryID: 3, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: avgTotalHeartRate, TransactionsListID: TransactionsListID++, Notes: ""));
|
||||
|
||||
// Med_InsertTransactionsInputsList2.add(new healthData(MedCategoryID: 8 , MedSubCategoryID: 0 , MachineDate: DateUtil.convertDateToStringWithBackSlash(date) , Value: totalCalories , TransactionsListID: TransactionsListID++ , Notes: ""));
|
||||
});
|
||||
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
|
||||
AlertDialogBox dialog = new AlertDialogBox(
|
||||
context: context,
|
||||
confirmMessage: TranslationBase.of(context).alreadySynced,
|
||||
okText: TranslationBase.of(context).ok,
|
||||
okFunction: () => {
|
||||
AlertDialogBox.closeAlertDialog(context),
|
||||
},
|
||||
);
|
||||
|
||||
dialog.showAlertDialog(context);
|
||||
}
|
||||
|
||||
addInsertTransactionsInputsList() {
|
||||
if (Med_InsertTransactionsInputsList2.isNotEmpty) {
|
||||
SmartWatchIntegrationService service = new SmartWatchIntegrationService();
|
||||
service.insertPatientHealthData(Med_InsertTransactionsInputsList2, context).then((res) {
|
||||
print(res);
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppBarChart extends StatelessWidget {
|
||||
const AppBarChart({
|
||||
Key key,
|
||||
@required this.isArabic,
|
||||
@required this.seriesList,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<charts.Series> seriesList;
|
||||
final bool isArabic;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 400,
|
||||
//margin: EdgeInsets.only(top: 60),
|
||||
child: charts.BarChart(
|
||||
seriesList,
|
||||
// animate: animate,
|
||||
domainAxis: charts.OrdinalAxisSpec(
|
||||
renderSpec: charts.GridlineRendererSpec(
|
||||
labelAnchor: isArabic ? charts.TickLabelAnchor.before : charts.TickLabelAnchor.after,
|
||||
labelRotation: -30,
|
||||
labelOffsetFromAxisPx: 30,
|
||||
labelOffsetFromTickPx: 15,
|
||||
labelJustification: charts.TickLabelJustification.inside,
|
||||
),
|
||||
),
|
||||
|
||||
/// Customize the primary measure axis using a small tick renderer.
|
||||
/// Use String instead of num for ordinal domain axis
|
||||
/// (typically bar charts).
|
||||
primaryMeasureAxis: new charts.NumericAxisSpec(
|
||||
renderSpec: new charts.GridlineRendererSpec(
|
||||
// Display the measure axis labels below the gridline.
|
||||
//
|
||||
// 'Before' & 'after' follow the axis value direction.
|
||||
// Vertical axes draw 'before' below & 'after' above the tick.
|
||||
// Horizontal axes draw 'before' left & 'after' right the tick.
|
||||
labelAnchor: charts.TickLabelAnchor.before,
|
||||
|
||||
// Left justify the text in the axis.
|
||||
//
|
||||
// Note: outside means that the secondary measure axis would right
|
||||
// justify.
|
||||
labelJustification: charts.TickLabelJustification.outside,
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// chart line
|
||||
/// [seriesList] charts series
|
||||
/// [chartTitle] the charts title
|
||||
/// [animate] enable and disable animate on create chart
|
||||
/// [includeArea] chart include Area
|
||||
/// [stacked] stacked chart over the design
|
||||
class AppLineChart extends StatelessWidget {
|
||||
final List<charts.Series> seriesList;
|
||||
final String chartTitle;
|
||||
final bool animate;
|
||||
final bool includeArea;
|
||||
final bool stacked;
|
||||
|
||||
AppLineChart(
|
||||
{Key key,
|
||||
@required this.seriesList,
|
||||
this.chartTitle,
|
||||
this.animate = true,
|
||||
this.includeArea = false,
|
||||
this.stacked = true});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
chartTitle,
|
||||
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Expanded(
|
||||
child: charts.LineChart(seriesList,
|
||||
defaultRenderer: charts.LineRendererConfig(
|
||||
includeArea: false, stacked: true),
|
||||
animate: animate),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue