upgrade-to-flutter-3 #1
|
@ -12,6 +12,14 @@ class ExpensesChart extends StatefulWidget {
|
||||||
class ExpensesChartState extends State {
|
class ExpensesChartState extends State {
|
||||||
int? touchedIndex;
|
int? touchedIndex;
|
||||||
|
|
||||||
|
bool disposed = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
disposed = true;
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<String> categories =
|
List<String> categories =
|
||||||
|
@ -24,6 +32,7 @@ class ExpensesChartState extends State {
|
||||||
pieTouchData:
|
pieTouchData:
|
||||||
PieTouchData(touchCallback: (event, pieTouchResponse) {
|
PieTouchData(touchCallback: (event, pieTouchResponse) {
|
||||||
if (pieTouchResponse == null) return;
|
if (pieTouchResponse == null) return;
|
||||||
|
if (disposed) return;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
if (event is FlLongPressEnd || event is FlPanEndEvent) {
|
if (event is FlLongPressEnd || event is FlPanEndEvent) {
|
||||||
|
|
Loading…
Reference in a new issue