-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception caught by rendering library #363
Comments
Please give us a reproducible code. |
Actually I used another library and updated the code a lot so it is difficult for me to give the code but let me explain the entire situation So I was using moor and I made a function to get a Future<List<... >> and now in FutureBuilder I tried
`
Now in this you could see I used changeNotfiers , and by the way that calculate method returns a double now I provided the respective values to PieChartSectionData like this |
I hope I gave you an approx idea of how I did this thing and let me know if anything else you want to know |
It doesn't help me, |
same issue happens with me when I make:
while any finite value doesn't throw this exception |
Hello, I think I had the same problem using drift. The problem is not related to the library but to how the FutureBuilder is used. The Instead the future property should be mapped to a variable that is initialized on init: class _MyWidgetState extends State<MyWidget> {
late Future<List<String>> myFutureVariable;
Future<List<String>> _getStringValueFromDb() async {
return await db.getSomething();
}
@override
void initState() {
super.initState();
myFutureVariable= _getStringValueFromDb();
}
...
FutureBuilder<List<String>>(
future: myFutureVariable,
... |
`
The following assertion was thrown during paint():
Offset argument contained a NaN value.
dart:ui/painting.dart':
Failed assertion: line 39: ''
The relevant error-causing widget was:
PieChart file:///D:/flutterProjects/moneymanager/lib/stats.dart:72:14
When the exception was thrown, this was the stack:
#2 _offsetIsValid (dart:ui/painting.dart:39:10)
#3 Canvas.drawLine (dart:ui/painting.dart:3649:12)
#4 PieChartPainter._removeSectionsSpace. (package:fl_chart/src/chart/pie_chart/pie_chart_painter.dart:147:14)
#5 ListMapView.forEach (dart:_internal/list.dart:244:8)
#6 PieChartPainter._removeSectionsSpace (package:fl_chart/src/chart/pie_chart/pie_chart_painter.dart:117:27)
...
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#43a5c relayoutBoundary=up3
... parentData: (can use size)
... constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)
... size: Size(252.0, 252.0)
RenderObject: RenderCustomPaint#43a5c relayoutBoundary=up3
parentData: (can use size)
constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)
size: Size(252.0, 252.0)
`
This is the exception I am getting every time I run the code
The text was updated successfully, but these errors were encountered: