|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import 'package:flutter_charts/flutter_charts.dart' as charts;
|
|
|
|
|
// import 'package:charts_flutter/flutter.dart';
|
|
|
|
|
// import 'package:charts_flutter/flutter.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/list/flexible_container.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
@ -10,51 +10,51 @@ import 'package:flutter/material.dart';
|
|
|
|
|
/// [chartName] the name of the chart
|
|
|
|
|
/// [startDate] the start date
|
|
|
|
|
/// [endDate] the end date
|
|
|
|
|
class AppTimeSeriesChar,b m extends StatelessWidget {
|
|
|
|
|
AppTimeSeriesChart({
|
|
|
|
|
Key? key,
|
|
|
|
|
required this.seriesList,
|
|
|
|
|
this.chartName = '',
|
|
|
|
|
this.startDate,
|
|
|
|
|
this.endDate,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final String chartName;
|
|
|
|
|
final List<Series<dynamic, DateTime>> seriesList;
|
|
|
|
|
final DateTime? startDate;sz
|
|
|
|
|
final DateTime? endDate;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return FlexibleContainer(
|
|
|
|
|
heightFactor: 0.47,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Texts(chartName, fontSize: SizeConfig.textMultiplier * 3),
|
|
|
|
|
Container(
|
|
|
|
|
height: SizeConfig.realScreenHeight * 0.37,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: charts.LineChart(
|
|
|
|
|
seriesList,
|
|
|
|
|
animate: true,
|
|
|
|
|
behaviors: [
|
|
|
|
|
charts.RangeAnnotation(
|
|
|
|
|
[
|
|
|
|
|
charts.RangeAnnotationSegment(startDate, endDate,
|
|
|
|
|
charts.RangeAnnotationAxisType.domain ),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// class AppTimeSeriesChar,b m extends StatelessWidget {
|
|
|
|
|
// AppTimeSeriesChart({
|
|
|
|
|
// Key? key,
|
|
|
|
|
// required this.seriesList,
|
|
|
|
|
// this.chartName = '',
|
|
|
|
|
// this.startDate,
|
|
|
|
|
// this.endDate,
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// final String chartName;
|
|
|
|
|
// final List<Series<dynamic, DateTime>> seriesList;
|
|
|
|
|
// final DateTime? startDate;
|
|
|
|
|
// final DateTime? endDate;
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
|
// return FlexibleContainer(
|
|
|
|
|
// heightFactor: 0.47,
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Texts(chartName, fontSize: SizeConfig.textMultiplier * 3),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: SizeConfig.realScreenHeight * 0.37,
|
|
|
|
|
// child: Center(
|
|
|
|
|
// child: Container(
|
|
|
|
|
// child: charts.LineChart(
|
|
|
|
|
// seriesList,
|
|
|
|
|
// animate: true,
|
|
|
|
|
// behaviors: [
|
|
|
|
|
// charts.RangeAnnotation(
|
|
|
|
|
// [
|
|
|
|
|
// charts.RangeAnnotationSegment(startDate, endDate,
|
|
|
|
|
// charts.RangeAnnotationAxisType.domain ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
class TimeSeriesSales {
|
|
|
|
|
final DateTime time;
|
|
|
|
|