diff --git a/flutter/ayf_pack/lib/platform/web/ayf_platform_specific.dart b/flutter/ayf_pack/lib/platform/web/ayf_platform_specific.dart index 5d01809f..5a769d06 100644 --- a/flutter/ayf_pack/lib/platform/web/ayf_platform_specific.dart +++ b/flutter/ayf_pack/lib/platform/web/ayf_platform_specific.dart @@ -23,7 +23,7 @@ class AudYoFloPlatformSpecificHtml extends AudYoFloPlatformSpecific { } @override - Future triggerClose(AudYoFloBackendCache theBeCache) async {} + Future triggerClose() async {} // Allocate and return file drop widget - there is none at this time.. @override diff --git a/flutter/ayf_pack/lib/plot-widgets/ayf_property_plot_widget.dart b/flutter/ayf_pack/lib/plot-widgets/ayf_property_plot_widget.dart index a2d9f3b1..fd074ab2 100644 --- a/flutter/ayf_pack/lib/plot-widgets/ayf_property_plot_widget.dart +++ b/flutter/ayf_pack/lib/plot-widgets/ayf_property_plot_widget.dart @@ -20,7 +20,7 @@ class AudYoFloPropertyPlot extends StatefulWidget { final List lineNamesInit; final List xShiftPropertiesInit; final double maxShow; - final bool fastSeries; + // final bool fastSeries; final String chartTitle; /* final List xValues; @@ -34,21 +34,22 @@ class AudYoFloPropertyPlot extends StatefulWidget { final double minY; final double maxY; - const AudYoFloPropertyPlot( - this.cpId, this.linePropertiesInit, this.lineNamesInit, this.maxShow, this.chartTitle, + const AudYoFloPropertyPlot(this.cpId, this.linePropertiesInit, + this.lineNamesInit, this.maxShow, this.chartTitle, {this.logarithmicX = false, this.logarithmicY = false, this.titleXAxis, - this.titleYAxis, + this.titleYAxis, this.minY = 0, this.maxY = -1, - this.fastSeries = false, + // this.fastSeries = true, this.xShiftPropertiesInit = const [], super.key}); @override State createState() { - return _AudYoFloPropertyPlotState(linePropertiesInit, lineNamesInit, xShiftPropertiesInit, chartTitle); + return _AudYoFloPropertyPlotState( + linePropertiesInit, lineNamesInit, xShiftPropertiesInit, chartTitle); } } @@ -77,7 +78,8 @@ class _AudYoFloPropertyPlotState extends State 'tagPropertyPlot', []); - _AudYoFloPropertyPlotState(this.lineProperties, this.lineNames, this.xShiftPropertiesInit, this.chartTitle) { + _AudYoFloPropertyPlotState(this.lineProperties, this.lineNames, + this.xShiftPropertiesInit, this.chartTitle) { // Set required member variable in base class /* super.cpId = JvxComponentIdentification( @@ -88,12 +90,11 @@ class _AudYoFloPropertyPlotState extends State // If some events do not reach the rebuild function, we can produce some // additional output printfs - // dbgOutput = true; + // dbgOutput = true; List allProperties = List.from(lineProperties); - for(var elm in xShiftPropertiesInit) - { - if(elm.isNotEmpty){ - allProperties.add(elm); + for (var elm in xShiftPropertiesInit) { + if (elm.isNotEmpty) { + allProperties.add(elm); } } oneGroupPlotWidget = AudYoFloPropertyOnChangeOneGroup(allProperties); @@ -145,23 +146,20 @@ class _AudYoFloPropertyPlotState extends State // If the the size requires an update, update if (vecLength != xValues.length) { double maxXVal = vecLength.toDouble(); - if(widget.maxShow > 0) - { + if (widget.maxShow > 0) { maxXVal = widget.maxShow; } - xValues = new List.generate( - vecLength, (i) => i * maxXVal / vecLength); + xValues = + new List.generate(vecLength, (i) => i * maxXVal / vecLength); } for (int j = 0; j < lineProperties.length; j++) { final String property = lineProperties[j]; String propertyOffset = ''; int offsetX = 0; - if(j < xShiftPropertiesInit.length) - { + if (j < xShiftPropertiesInit.length) { final String entryProp = xShiftPropertiesInit[j]; - if(entryProp.isNotEmpty) - { + if (entryProp.isNotEmpty) { propertyOffset = entryProp; } } @@ -174,16 +172,14 @@ class _AudYoFloPropertyPlotState extends State } else if (pp is AudYoFloPropertyMultiContentBackend?) { propertyData = pp as AudYoFloPropertyMultiContentBackend?; - } + } var ppO = oneGroupPlotWidget!.extractPropMultiContent(propertyOffset); AudYoFloPropertyMultiContentBackend? propertyDataOffset; if (ppO is AudYoFloPropertyMultiContentBackend?) { propertyDataOffset = ppO; - if(propertyDataOffset != null) - { - if(propertyDataOffset.fldSz > 0) - { + if (propertyDataOffset != null) { + if (propertyDataOffset.fldSz > 0) { offsetX = propertyDataOffset.fld[0]; } } @@ -196,18 +192,15 @@ class _AudYoFloPropertyPlotState extends State _chartData.update(nmShow, (data) { data.clear(); for (int i = 0; i < xValues.length; i++) { - double value = 0; - if ((propertyData != null) && (i < propertyData.fldSz)) - { - value = propertyData!.fld[i]; + if ((propertyData != null) && (i < propertyData.fldSz)) { + value = propertyData!.fld[i]; } // TODO NaN/Infinite workaround.. - data.add(ChartData( - xValues[i] + offsetX, (value.isNaN || value.isInfinite) ? 0 : value)); + data.add(ChartData(xValues[i] + offsetX, + (value.isNaN || value.isInfinite) ? 0 : value)); } - if(data.isEmpty) - { + if (data.isEmpty) { data.add(ChartData(0, 0)); legendPostfix = '(no-data)'; } @@ -216,16 +209,14 @@ class _AudYoFloPropertyPlotState extends State List data = []; for (int i = 0; i < xValues.length; i++) { double value = 0; - if ((propertyData != null) && (i < propertyData.fldSz)) - { - value = propertyData!.fld[i]; + if ((propertyData != null) && (i < propertyData.fldSz)) { + value = propertyData!.fld[i]; } // TODO NaN/Infinite workaround.. - data.add(ChartData( - xValues[i] + offsetX, (value.isNaN || value.isInfinite) ? 0 : value)); + data.add(ChartData(xValues[i] + offsetX, + (value.isNaN || value.isInfinite) ? 0 : value)); } - if(data.isEmpty) - { + if (data.isEmpty) { data.add(ChartData(0, 0)); legendPostfix = '(no-data)'; } @@ -314,16 +305,13 @@ class _AudYoFloPropertyPlotState extends State //minorTicksPerInterval: 9, // NOTE minor ticks are logarithmically spaced (in data; so visually linear) unfortunately ); } else { - if( widget.maxY > widget.minY) - { + if (widget.maxY > widget.minY) { yAxis = NumericAxis( title: AxisTitle(text: this.widget.titleYAxis), minimum: widget.minY, maximum: widget.maxY, ); - } - else - { + } else { yAxis = NumericAxis(title: AxisTitle(text: this.widget.titleYAxis)); } } @@ -332,32 +320,29 @@ class _AudYoFloPropertyPlotState extends State for (final MapEntry> entry in _chartData.entries) { String nameLocal = entry.key; nameLocal = nameLocal + legendPostfix; - if(widget.fastSeries) - { + //if (widget.fastSeries) { series.add(FastLineSeries( name: nameLocal, dataSource: entry.value, xValueMapper: (ChartData data, _) => data.x, yValueMapper: (ChartData data, _) => data.y, )); - } - else{ - series.add(LineSeries( - name: nameLocal, - dataSource: entry.value, - xValueMapper: (ChartData data, _) => data.x, - yValueMapper: (ChartData data, _) => data.y, - )); - } + //} else { + // series.add(LineSeries( + // name: nameLocal, + // dataSource: entry.value, + // xValueMapper: (ChartData data, _) => data.x, + // yValueMapper: (ChartData data, _) => data.y, + // )); + //} } // Update this widget if there is a notification in the uiModel return Consumer(builder: (context, notifier, child) { return SfCartesianChart( - title: ChartTitle( - text: chartTitle), - primaryXAxis: xAxis, - primaryYAxis: yAxis, + title: ChartTitle(text: chartTitle), + primaryXAxis: xAxis!, + primaryYAxis: yAxis!, series: series, legend: Legend(isVisible: true), ); diff --git a/flutter/ayf_pack/pubspec.yaml b/flutter/ayf_pack/pubspec.yaml index 45f857d9..ee7ff74d 100644 --- a/flutter/ayf_pack/pubspec.yaml +++ b/flutter/ayf_pack/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: collection: ^1.16.0 fixnum: ^1.0.0 - intl: ^0.17.0 + intl: ^0.18.0 clipboard: ^0.1.3 @@ -35,7 +35,7 @@ dependencies: path: '../ayf_webhost' # Plot widgets - syncfusion_flutter_charts: ^21.2.4 + syncfusion_flutter_charts: ^26.2.7 dev_dependencies: flutter_test: diff --git a/sources/sub-projects/ayfstarter/flutter/starter_app/pubspec.yaml b/sources/sub-projects/ayfstarter/flutter/starter_app/pubspec.yaml index afc1e5fc..001f3915 100644 --- a/sources/sub-projects/ayfstarter/flutter/starter_app/pubspec.yaml +++ b/sources/sub-projects/ayfstarter/flutter/starter_app/pubspec.yaml @@ -18,9 +18,7 @@ dependencies: provider: ^6.0.3 collection: ^1.16.0 fixnum: ^1.0.0 - - intl: ^0.17.0 - + clipboard: ^0.1.3 flutter_dotenv: ^5.0.2