Welcome to the Flutter feedback portal. We’re happy you’re here! If you have feedback on how to improve the Flutter, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:syncfusion_flutter_charts/charts.dart';

void main() {
runApp(MaterialApp(
home: TestPage(),
));
}

class TestPage extends StatefulWidget {
@override
_TestPageState createState() => _TestPageState();
}

class _TestPageState extends State<TestPage> {
Future future;

@override
void initState() {
super.initState();
future = Future.delayed(Duration(seconds: 1));
}

@override
Widget build(BuildContext context) {
print('build SensorPage');
return Scaffold(
appBar: AppBar(),
body: LayoutBuilder(
builder: (_, lwb) {
print('build SensorPage.LayoutBuilder');
return Column(
children: [
Container(
height: lwb.maxHeight / 2,
color: Colors.red,
),
Container(
height: lwb.maxHeight / 2,
child: FutureBuilder(
future: future,
builder: (_, AsyncSnapshot asyncSnapshot) {
print('build SensorPage.LayoutBuilder.FutureBuilder');
if (asyncSnapshot.connectionState == ConnectionState.done)
return SfCartesianChart(
series: [
LineSeries<Datum, DateTime>(
dataSource: [
Datum(DateTime(2020, 7, 1), 3),
Datum(DateTime(2020, 7, 2), 1),
Datum(DateTime(2020, 7, 3), 4),
Datum(DateTime(2020, 7, 4), 8),
Datum(DateTime(2020, 7, 5), 5),
Datum(DateTime(2020, 7, 6), 1),
Datum(DateTime(2020, 7, 7), 3),
Datum(DateTime(2020, 7, 8), 7),
Datum(DateTime(2020, 7, 9), 2),
],
xValueMapper: (Datum datum, _) => datum.x,
yValueMapper: (Datum datum, _) => datum.y,
markerSettings: MarkerSettings(
isVisible: true,
),
),
],
primaryXAxis: DateTimeAxis(
dateFormat: DateFormat.Md().add_Hm(),
),
primaryYAxis: NumericAxis(
labelFormat: '{value} mm',
),
tooltipBehavior: TooltipBehavior(
enable: true,
shouldAlwaysShow: true,
),
zoomPanBehavior: ZoomPanBehavior(
enablePanning: true,
enablePinching: true,
zoomMode: ZoomMode.x,
),
onActualRangeChanged: (rangeChangedArgs) => print("visibleMax = ${rangeChangedArgs.visibleMax}"),
);
else
return Center(
child: CircularProgressIndicator(),
);
},
),
)
],
);
},
),
);
}
}

class Datum {
DateTime x;
num y;

Datum(this.x, this.y);
}


════════ Exception caught by gesture library ═══════════════════════════════════════════════════════

The following assertion was thrown while dispatching a pointer event:

Failed assertion: boolean expression must not be null


When the exception was thrown, this was the stack:

#0 _ContainerArea._performPointerUp (package:syncfusion_flutter_charts/src/chart/base/chart_base.dart:2193:31)

#1 _ContainerArea._getListener. (package:syncfusion_flutter_charts/src/chart/base/chart_base.dart:2631:11)

#2 RenderPointerListener.handleEvent (package:flutter/src/rendering/proxy_box.dart:2620:25)

#3 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)

#4 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)

...

Event: PointerUpEvent#85188(position: Offset(169.3, 512.3))

  position: Offset(169.3, 512.3)

Target: RenderPointerListener#e58d8 relayoutBoundary=up1

  parentData: not positioned; offset=Offset(0.0, 0.0) (can use size)

  constraints: BoxConstraints(0.0<=w<=340.0, 0.0<=h<=260.0)

  size: Size(340.0, 260.0)

  behavior: deferToChild

  listeners: down, move, up, signal

════════════════════════════════════════════════════════════════════════════════════════════════════

An exception will be raised when user zoom in. After that, a panning gesture cause zooming.


P.S. The library is not working quite well when it is putted in LayoutBuilder and FutureBuilder. Please consider adding LayoutBuilder and FutureBuilder compatibility test.