You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
When using OrdinalComboChart or LineChart I noticed that they stop working when run in release mode and placed inside a MaterialApp widget. This is the error I get:
I/flutter (30490): The following RenderObject was being processed when the exception was fired:
I/flutter (30490): ChartContainerRenderObject<String>#6aca1 NEEDS-PAINT
I/flutter (30490): parentData: <none>
I/flutter (30490): constraints: BoxConstraints(w=360.0, h=640.0)
I/flutter (30490): semantic boundary
I/flutter (30490): size: Size(0.0, 0.0)
I/flutter (30490): This RenderObject has no descendants.
And this is the code to reproduce the problem:
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
void main() {
runApp(new OrdinalComboBarLineChart());
}
class OrdinalComboBarLineChart extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<charts.Series> seriesList = _createSampleData();
return MaterialApp(
home: Container(
height: 205.0,
width: 350.0,
child: charts.OrdinalComboChart(seriesList,
animate: false,
defaultRenderer: charts.LineRendererConfig(
areaOpacity: 0.8, includeArea: true),
customSeriesRenderers: [
new charts.LineRendererConfig(customRendererId: 'LineOne'),
])));
}
/// Create series list with multiple series
List<charts.Series<OrdinalSales, String>> _createSampleData() {
var categoryOne = [
new OrdinalSales('0:00', 0),
new OrdinalSales('12:00', 0),
new OrdinalSales('23:59', 25),
];
var lineOne = [
new OrdinalSales('0:00', 30),
new OrdinalSales('12:00', 15),
new OrdinalSales('23:59', 7),
];
final Color myRed = const Color(0xFFEB4141);
final Color myDarkBackground = const Color(0xFF101926);
return [
new charts.Series<OrdinalSales, String>(
id: 'CategoryOne',
colorFn: (_, __) => charts.Color(
r: myRed.red, g: myRed.green, b: myRed.blue, a: myRed.alpha),
domainFn: (OrdinalSales sales, _) => sales.year,
measureFn: (OrdinalSales sales, _) => sales.sales,
data: categoryOne),
new charts.Series<OrdinalSales, String>(
id: 'LineOne ',
colorFn: (_, __) => charts.Color(
r: myDarkBackground.red,
g: myDarkBackground.green,
b: myDarkBackground.blue,
a: myDarkBackground.alpha),
domainFn: (OrdinalSales sales, _) => sales.year,
measureFn: (OrdinalSales sales, _) => sales.sales,
data: lineOne)
..setAttribute(charts.rendererIdKey, 'LineOne'),
];
}
}
/// Sample ordinal data type.
class OrdinalSales {
final String year;
final int sales;
OrdinalSales(this.year, this.sales);
}
I am using charts_flutter: ^0.5.0.
The text was updated successfully, but these errors were encountered:
TomOerlemans
changed the title
OrdinalComboChart throws exception in release mode
OrdinalComboChart and Line chart do not work in release mode, when placed inside MaterialApp
Dec 6, 2018
TomOerlemans
changed the title
OrdinalComboChart and Line chart do not work in release mode, when placed inside MaterialApp
OrdinalComboChart and LineChart do not work in release mode, when placed inside MaterialApp
Dec 6, 2018
So I am far from a great programmer (and thus I don't really understand what is going on), but I just discovered that this issue does not exist when I use charts_flutter: ^0.4.0, as opposed to charts_flutter: ^0.5.0. So it seems like the issue got introduced with the latest update.
TomOerlemans
changed the title
OrdinalComboChart and LineChart do not work in release mode, when placed inside MaterialApp
OrdinalComboChart and LineChart do not work in release mode, when placed inside MaterialApp (in v5 not in v4)
Dec 6, 2018
TomOerlemans
changed the title
OrdinalComboChart and LineChart do not work in release mode, when placed inside MaterialApp (in v5 not in v4)
OrdinalComboChart and LineChart do not work in release mode, when placed inside MaterialApp (in v0.5 not in v0.4)
Dec 6, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using OrdinalComboChart or LineChart I noticed that they stop working when run in release mode and placed inside a MaterialApp widget. This is the error I get:
And this is the code to reproduce the problem:
I am using charts_flutter: ^0.5.0.
The text was updated successfully, but these errors were encountered: