fix(mobile): stabilize router and add loading timeout/retry on playlists screen

This commit is contained in:
Michael committed 2026-03-09 17:35:09 +01:00
1 parent 180b57e1b7
commit e4f8ebcf8f
2 files changed
+26 -4

No files matched your search

@@ -40,7 +40,27 @@ class MobilePlaylistSelectionScreen extends ConsumerWidget {
],
),
body: playlistsAsync.when(
loading: () => const Center(child: CircularProgressIndicator()),
loading: () => Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const CircularProgressIndicator(),
const SizedBox(height: 24),
FutureBuilder(
future: Future.delayed(const Duration(seconds: 5)),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return TextButton(
onPressed: () => ref.refresh(playlistsProvider),
child: const Text('Still loading? Tap to retry'),
);
}
return const SizedBox.shrink();
},
),
],
),
),
error: (error, stack) => Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,