diff --git a/android/gradle.properties b/android/gradle.properties index 604fc088e204d265443088fe8d1680c63a2b132f..c8bbff9bd599a7c3ffbe76de5a61ead3de90631a 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.38 -app.versionCode=38 +app.versionName=0.0.39 +app.versionCode=39 diff --git a/fastlane/metadata/android/en-US/changelogs/39.txt b/fastlane/metadata/android/en-US/changelogs/39.txt new file mode 100644 index 0000000000000000000000000000000000000000..d69d1880ef349932064a2f21ff997d610e86843f --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/39.txt @@ -0,0 +1 @@ +Update data on page pull down. diff --git a/fastlane/metadata/android/fr-FR/changelogs/39.txt b/fastlane/metadata/android/fr-FR/changelogs/39.txt new file mode 100644 index 0000000000000000000000000000000000000000..4abfdd78ae815d65812872110d4701da19b91973 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/39.txt @@ -0,0 +1 @@ +Mise à jour des données en tirant la page vers le bas. diff --git a/lib/ui/screens/discoveries.dart b/lib/ui/screens/discoveries.dart index d93e921af0c410a90152bfc919f762f7a2e3b6be..7a039c7d5327bfc62679f1929e255fd5bb825b10 100644 --- a/lib/ui/screens/discoveries.dart +++ b/lib/ui/screens/discoveries.dart @@ -3,20 +3,27 @@ import 'package:flutter/material.dart'; import 'package:scrobbles/ui/widgets/cards/discoveries.dart'; class ScreenDiscoveries extends StatelessWidget { - const ScreenDiscoveries({super.key}); + final Function() notifyParent; + + const ScreenDiscoveries({super.key, required this.notifyParent}); @override Widget build(BuildContext context) { return Material( color: Theme.of(context).colorScheme.background, - child: ListView( - padding: const EdgeInsets.symmetric(horizontal: 4), - physics: const BouncingScrollPhysics(), - children: <Widget>[ - const SizedBox(height: 8), - const CardDiscoveries(), - const SizedBox(height: 36), - ], + child: RefreshIndicator( + onRefresh: () async { + this.notifyParent(); + }, + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 4), + physics: const BouncingScrollPhysics(), + children: <Widget>[ + const SizedBox(height: 8), + const CardDiscoveries(), + const SizedBox(height: 36), + ], + ), ), ); } diff --git a/lib/ui/screens/home.dart b/lib/ui/screens/home.dart index 7bf2d94b7ecc9c9dbe5f234645b24cf32aba474a..4960e2e3e2e5f67475cbc19f479b659a6aa50e8e 100644 --- a/lib/ui/screens/home.dart +++ b/lib/ui/screens/home.dart @@ -6,26 +6,33 @@ import 'package:scrobbles/ui/widgets/cards/timeline.dart'; import 'package:scrobbles/ui/widgets/cards/top_artists.dart'; class ScreenHome extends StatelessWidget { - const ScreenHome({super.key}); + final Function() notifyParent; + + const ScreenHome({super.key, required this.notifyParent}); @override Widget build(BuildContext context) { return Material( color: Theme.of(context).colorScheme.background, - child: ListView( - padding: const EdgeInsets.symmetric(horizontal: 4), - physics: const BouncingScrollPhysics(), - children: <Widget>[ - const SizedBox(height: 8), - const CardStatisticsGlobal(), - const SizedBox(height: 6), - const CardStatisticsRecent(), - const SizedBox(height: 6), - const CardTimeline(), - const SizedBox(height: 6), - const CardTopArtists(), - const SizedBox(height: 36), - ], + child: RefreshIndicator( + onRefresh: () async { + this.notifyParent(); + }, + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 4), + physics: const BouncingScrollPhysics(), + children: <Widget>[ + const SizedBox(height: 8), + const CardStatisticsGlobal(), + const SizedBox(height: 6), + const CardStatisticsRecent(), + const SizedBox(height: 6), + const CardTimeline(), + const SizedBox(height: 6), + const CardTopArtists(), + const SizedBox(height: 36), + ], + ), ), ); } diff --git a/lib/ui/screens/statistics.dart b/lib/ui/screens/statistics.dart index 6f15f7e11a59469139bf64bb95f55e9a4125ceef..1dfffd1cb85cdf5680169cca761a5195e1779cb3 100644 --- a/lib/ui/screens/statistics.dart +++ b/lib/ui/screens/statistics.dart @@ -4,22 +4,29 @@ import 'package:scrobbles/ui/widgets/cards/counts_by_day.dart'; import 'package:scrobbles/ui/widgets/cards/counts_by_hour.dart'; class ScreenStatistics extends StatelessWidget { - const ScreenStatistics({super.key}); + final Function() notifyParent; + + const ScreenStatistics({super.key, required this.notifyParent}); @override Widget build(BuildContext context) { return Material( color: Theme.of(context).colorScheme.background, - child: ListView( - padding: const EdgeInsets.symmetric(horizontal: 4), - physics: const BouncingScrollPhysics(), - children: <Widget>[ - const SizedBox(height: 8), - const CardCountsByDay(), - const SizedBox(height: 6), - const CardCountsByHour(), - const SizedBox(height: 36), - ], + child: RefreshIndicator( + onRefresh: () async { + this.notifyParent(); + }, + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 4), + physics: const BouncingScrollPhysics(), + children: <Widget>[ + const SizedBox(height: 8), + const CardCountsByDay(), + const SizedBox(height: 6), + const CardCountsByHour(), + const SizedBox(height: 36), + ], + ), ), ); } diff --git a/lib/ui/skeleton.dart b/lib/ui/skeleton.dart index 46c449c208958e368280f2deb58f355176ca7d65..5ff784f1133de542be74d0109ec656e8c6ad3ae6 100644 --- a/lib/ui/skeleton.dart +++ b/lib/ui/skeleton.dart @@ -20,10 +20,10 @@ class SkeletonScreen extends StatefulWidget { class _SkeletonScreenState extends State<SkeletonScreen> { @override Widget build(BuildContext context) { - const List<Widget> pageNavigation = <Widget>[ - const ScreenHome(), - const ScreenDiscoveries(), - const ScreenStatistics(), + List<Widget> pageNavigation = <Widget>[ + ScreenHome(notifyParent: refresh), + ScreenDiscoveries(notifyParent: refresh), + ScreenStatistics(notifyParent: refresh), const ScreenSettings(), ]; @@ -53,6 +53,11 @@ class _SkeletonScreenState extends State<SkeletonScreen> { } refresh() { - setState(() {}); + void rebuild(Element el) { + el.markNeedsBuild(); + el.visitChildren(rebuild); + } + + (context as Element).visitChildren(rebuild); } } diff --git a/pubspec.yaml b/pubspec.yaml index 106d606c7adf6ee9a94665ccb769851cd0363382..2a55e387cde6b464793416530810b03057f0607c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Display scrobbles data and charts publish_to: 'none' -version: 0.0.38+38 +version: 0.0.39+39 environment: sdk: '^3.0.0'