From 0b9e57e654b8003bd3c26f5dcb678c63b516f3a1 Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Mon, 1 Apr 2024 19:52:44 +0330 Subject: [PATCH] Update then statement in StatMainCard's onPressed callback The onPressed callback of StatMainCard's RaisedButton now has a then statement with a more explicit syntax. The getStatistic method of the state object is still being called after the user taps the button. --- lib/views/home/new_statistic/new_statistic.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/views/home/new_statistic/new_statistic.dart b/lib/views/home/new_statistic/new_statistic.dart index af3ee07..534217d 100644 --- a/lib/views/home/new_statistic/new_statistic.dart +++ b/lib/views/home/new_statistic/new_statistic.dart @@ -233,7 +233,9 @@ class StatMainCard extends StatelessWidget { 'label': statistic.label, 'title': statistic.title, 'marked': statistic.marked, - }).then((value) => state.getStatistic()) + }).then( + (value) => state.getStatistic(), + ) : null, child: Padding( padding: const EdgeInsets.all(4.0),