diff --git a/lib/dateRangeDialog.dart b/lib/dateRangeDialog.dart index 1f74c93..fa3d0af 100644 --- a/lib/dateRangeDialog.dart +++ b/lib/dateRangeDialog.dart @@ -96,7 +96,7 @@ class _DateRangeDialogState extends State { initialDate: selectedRange.start ); - if(newDate != selectedRange.start) { + if(newDate != null && newDate != selectedRange.start) { fromController.text = dateFormat.format(newDate); selectedRange = DateTimeRange( start: newDate, @@ -127,7 +127,7 @@ class _DateRangeDialogState extends State { initialDate: selectedRange.end ); - if(newDate != selectedRange.end) { + if(newDate != null && newDate != selectedRange.end) { toController.text = dateFormat.format(newDate); selectedRange = DateTimeRange( start: selectedRange.start, diff --git a/lib/main.dart b/lib/main.dart index da50284..bac519d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -519,6 +519,23 @@ class _MyHomePageState extends State with TickerProviderStateMixin { ); return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + getTooltipItems: (List touchedBarSpots) { + return touchedBarSpots.map((barSpot) { + if (barSpot.x < start || barSpot.x > end) return null; + return LineTooltipItem( + barSpot.x.toString(), + TextStyle( + color: data.gradientColors[1], + fontWeight: FontWeight.bold, + fontSize: 14 + ) + ); + }).toList(); + }, + ), + ), clipData: FlClipData.horizontal(), gridData: FlGridData( show: true, @@ -633,6 +650,23 @@ class _MyHomePageState extends State with TickerProviderStateMixin { ); return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + getTooltipItems: (List touchedBarSpots) { + return touchedBarSpots.map((barSpot) { + if (barSpot.x < start || barSpot.x > end) return null; + return LineTooltipItem( + barSpot.x.toString(), + TextStyle( + color: data.gradientColors[1], + fontWeight: FontWeight.bold, + fontSize: 14 + ) + ); + }).toList(); + }, + ), + ), clipData: FlClipData.horizontal(), gridData: FlGridData( show: true, diff --git a/pubspec.lock b/pubspec.lock index 04b4a0e..a6dc72a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -56,7 +56,7 @@ packages: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.5" fake_async: dependency: transitive description: @@ -136,7 +136,7 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.4.1+1" path_parsing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a042d8e..074ae80 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A mobile app developed with Flutter to view Covid19 statistics. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.0.1+9 +version: 2.0.2+9 environment: sdk: ">=2.2.2 <3.0.0" diff --git a/repo_files/app-release.apk b/repo_files/app-release.apk index c75a143..f6a5f12 100644 Binary files a/repo_files/app-release.apk and b/repo_files/app-release.apk differ