diff --git a/app/lib/features/bangs/presentation/screens/search.dart b/app/lib/features/bangs/presentation/screens/search.dart index 28185a44..c28f2f9e 100644 --- a/app/lib/features/bangs/presentation/screens/search.dart +++ b/app/lib/features/bangs/presentation/screens/search.dart @@ -99,7 +99,7 @@ class BangSearchScreen extends HookConsumerWidget { error: (error, stackTrace) => Center( child: FailureWidget(title: 'Bang Search failed', exception: error), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), ); } diff --git a/app/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart b/app/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart index bcef9c48..85a909b0 100644 --- a/app/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart +++ b/app/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart @@ -362,7 +362,7 @@ class BookmarkListScreen extends HookConsumerWidget { }, ), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), ), ), diff --git a/app/lib/features/geckoview/features/bookmarks/presentation/widgets/folder_tree_picker.dart b/app/lib/features/geckoview/features/bookmarks/presentation/widgets/folder_tree_picker.dart index 7ee5c4a0..e8a44be4 100644 --- a/app/lib/features/geckoview/features/bookmarks/presentation/widgets/folder_tree_picker.dart +++ b/app/lib/features/geckoview/features/bookmarks/presentation/widgets/folder_tree_picker.dart @@ -156,7 +156,7 @@ class FolderTreePicker extends HookConsumerWidget { }, ), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), ], ); diff --git a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/tracking_protection_section.dart b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/tracking_protection_section.dart index e8bdbf92..4f779fec 100644 --- a/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/tracking_protection_section.dart +++ b/app/lib/features/geckoview/features/browser/presentation/widgets/sheets/tracking_protection_section.dart @@ -52,7 +52,14 @@ class TrackingProtectionSection extends HookConsumerWidget { secondary: const Icon(Icons.shield_outlined), ), ), - error: (error, stack) => const SizedBox.shrink(), + error: (error, stack) { + final colorScheme = Theme.of(context).colorScheme; + + return ListTile( + title: const Text('Failed to load tracking protection'), + leading: Icon(Icons.error_outline, color: colorScheme.error), + ); + }, ); } } diff --git a/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_button.dart b/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_button.dart index e114f46a..d4aa8d1c 100644 --- a/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_button.dart +++ b/app/lib/features/geckoview/features/readerview/presentation/widgets/reader_button.dart @@ -75,7 +75,8 @@ class ReaderButton extends HookConsumerWidget { readerabilityState.active, icon, ), - error: (error, stackTrace) => SizedBox.shrink(), + error: (error, stackTrace) => + Center(child: Icon(Icons.error_outline, color: colorScheme.error)), loading: () => AnimateGradientShader( duration: const Duration(milliseconds: 500), primaryEnd: Alignment.bottomLeft, diff --git a/app/lib/features/geckoview/features/tabs/presentation/screens/container_list.dart b/app/lib/features/geckoview/features/tabs/presentation/screens/container_list.dart index 92b13b8a..86178cdf 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/screens/container_list.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/screens/container_list.dart @@ -32,6 +32,7 @@ import 'package:weblibre/features/geckoview/features/tabs/domain/providers/selec import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/container.dart'; import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/container_list_tile.dart'; import 'package:weblibre/features/tor/presentation/controllers/start_tor_proxy.dart'; +import 'package:weblibre/presentation/widgets/failure_widget.dart'; class ContainerListScreen extends HookConsumerWidget { const ContainerListScreen(); @@ -136,7 +137,13 @@ class ContainerListScreen extends HookConsumerWidget { ); }, ), - error: (error, stackTrace) => SizedBox.shrink(), + error: (error, stackTrace) => Center( + child: FailureWidget( + title: 'Failed to load containers', + exception: error, + onRetry: () => ref.invalidate(watchContainersWithCountProvider), + ), + ), loading: () => ListView.builder( itemCount: 3, itemBuilder: (context, index) => ContainerListTile( diff --git a/app/lib/features/geckoview/features/tabs/presentation/screens/container_selection.dart b/app/lib/features/geckoview/features/tabs/presentation/screens/container_selection.dart index 25e2b6cc..06c8a293 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/screens/container_selection.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/screens/container_selection.dart @@ -30,6 +30,7 @@ import 'package:weblibre/features/geckoview/features/tabs/data/models/container_ import 'package:weblibre/features/geckoview/features/tabs/domain/providers.dart'; import 'package:weblibre/features/geckoview/features/tabs/domain/repositories/container.dart'; import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/container_list_tile.dart'; +import 'package:weblibre/presentation/widgets/failure_widget.dart'; class ContainerSelectionScreen extends HookConsumerWidget { const ContainerSelectionScreen(); @@ -62,7 +63,13 @@ class ContainerSelectionScreen extends HookConsumerWidget { ); }, ), - error: (error, stackTrace) => SizedBox.shrink(), + error: (error, stackTrace) => Center( + child: FailureWidget( + title: 'Failed to load containers', + exception: error, + onRetry: () => ref.invalidate(watchContainersWithCountProvider), + ), + ), loading: () => ListView.builder( itemCount: 3, itemBuilder: (context, index) => ContainerListTile( diff --git a/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart b/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart index e64ebb7a..5dd95b0b 100644 --- a/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart +++ b/app/lib/features/geckoview/features/tabs/presentation/widgets/container_chips.dart @@ -256,7 +256,17 @@ class ContainerChips extends HookConsumerWidget { ), ); }, - error: (error, stackTrace) => const SizedBox.shrink(), + error: (error, stackTrace) => SizedBox( + height: 48, + width: double.infinity, + child: Center( + child: Icon( + Icons.error_outline, + size: 20, + color: Theme.of(context).colorScheme.error, + ), + ), + ), loading: () => const SizedBox(height: 48, width: double.infinity), ); } diff --git a/app/lib/features/onboarding/presentation/pages/default_search.dart b/app/lib/features/onboarding/presentation/pages/default_search.dart index b72a3143..ba596a0b 100644 --- a/app/lib/features/onboarding/presentation/pages/default_search.dart +++ b/app/lib/features/onboarding/presentation/pages/default_search.dart @@ -29,6 +29,7 @@ import 'package:weblibre/features/settings/presentation/controllers/save_setting import 'package:weblibre/features/settings/presentation/widgets/bang_icon.dart'; import 'package:weblibre/features/user/data/models/general_settings.dart'; import 'package:weblibre/features/user/domain/repositories/general_settings.dart'; +import 'package:weblibre/presentation/widgets/failure_widget.dart'; import 'package:weblibre/presentation/widgets/url_icon.dart'; const defaultBangs = ['ddg', 'brave', 'startpage', 'qwant']; @@ -161,7 +162,14 @@ class DefaultSearchPage extends HookConsumerWidget { ], ); }, - error: (error, stackTrace) => const SizedBox.shrink(), + error: (error, stackTrace) => Center( + child: FailureWidget( + title: 'Could not load search engines', + exception: error, + onRetry: () => + ref.refresh(bangListProvider(triggers: defaultBangs)), + ), + ), loading: () => const SizedBox(height: 48, width: double.infinity), ), ); diff --git a/app/lib/features/settings/presentation/screens/web_engine_hardening.dart b/app/lib/features/settings/presentation/screens/web_engine_hardening.dart index 75d7dbcf..3e5594af 100644 --- a/app/lib/features/settings/presentation/screens/web_engine_hardening.dart +++ b/app/lib/features/settings/presentation/screens/web_engine_hardening.dart @@ -129,7 +129,7 @@ class WebEngineHardeningScreen extends HookConsumerWidget { ), ), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), ); } diff --git a/app/lib/features/settings/presentation/screens/web_engine_hardening_group.dart b/app/lib/features/settings/presentation/screens/web_engine_hardening_group.dart index 79ba0462..93d35211 100644 --- a/app/lib/features/settings/presentation/screens/web_engine_hardening_group.dart +++ b/app/lib/features/settings/presentation/screens/web_engine_hardening_group.dart @@ -198,7 +198,7 @@ class WebEngineHardeningGroupScreen extends HookConsumerWidget { ), ), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), ); } diff --git a/app/lib/features/settings/presentation/widgets/default_search_selector.dart b/app/lib/features/settings/presentation/widgets/default_search_selector.dart index 27d24f86..3b571690 100644 --- a/app/lib/features/settings/presentation/widgets/default_search_selector.dart +++ b/app/lib/features/settings/presentation/widgets/default_search_selector.dart @@ -83,7 +83,9 @@ class DefaultSearchSelector extends HookConsumerWidget { ), ); }, - error: (error, stackTrace) => const SizedBox.shrink(), + error: (error, stackTrace) => Center( + child: Icon(Icons.error, color: Theme.of(context).colorScheme.error), + ), loading: () => const SizedBox(height: 48, width: double.infinity), ); } diff --git a/app/lib/features/web_feed/presentation/screens/feed_article_list.dart b/app/lib/features/web_feed/presentation/screens/feed_article_list.dart index 6d0cde9d..7d7b4018 100644 --- a/app/lib/features/web_feed/presentation/screens/feed_article_list.dart +++ b/app/lib/features/web_feed/presentation/screens/feed_article_list.dart @@ -190,7 +190,7 @@ class FeedArticleListScreen extends HookConsumerWidget { exception: error, ), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), ), ); diff --git a/app/lib/features/web_feed/presentation/screens/feed_list.dart b/app/lib/features/web_feed/presentation/screens/feed_list.dart index 18a70577..413b4802 100644 --- a/app/lib/features/web_feed/presentation/screens/feed_list.dart +++ b/app/lib/features/web_feed/presentation/screens/feed_list.dart @@ -93,7 +93,7 @@ class FeedListScreen extends HookConsumerWidget { }, ), ), - loading: () => const SizedBox.shrink(), + loading: () => const Center(child: CircularProgressIndicator()), ), floatingActionButton: FloatingActionButton.extended( label: const Text('Feed'), diff --git a/app/lib/features/web_feed/presentation/widgets/feed_card.dart b/app/lib/features/web_feed/presentation/widgets/feed_card.dart index 42a20eee..020c6c00 100644 --- a/app/lib/features/web_feed/presentation/widgets/feed_card.dart +++ b/app/lib/features/web_feed/presentation/widgets/feed_card.dart @@ -146,7 +146,13 @@ class FeedCard extends HookConsumerWidget { ); }, error: (error, stackTrace) => const Text('N/A'), - loading: () => const SizedBox.shrink(), + loading: () => const SizedBox( + height: 16, + width: 16, + child: Center( + child: CircularProgressIndicator(strokeWidth: 2), + ), + ), ); }, ),