mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add pull-to-refresh to the notifications list
The devices list already supported pull-to-refresh; mirror that on the notifications list by wrapping its CustomScrollView in a RefreshIndicator with AlwaysScrollableScrollPhysics. Keep the existing list visible during a refresh (_isLoading = _items.isEmpty) instead of flashing the skeleton, matching the devices list behaviour. Add widget tests covering pull-to-refresh for both lists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7b8a33606c
commit
8b8fa5ce89
@@ -126,7 +126,7 @@ class _NotificationsListState extends State<NotificationsList>
|
||||
final token = CancelToken();
|
||||
_fetchToken = token;
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_isLoading = _items.isEmpty;
|
||||
_error = null;
|
||||
});
|
||||
try {
|
||||
@@ -217,12 +217,16 @@ class _NotificationsListState extends State<NotificationsList>
|
||||
children: [
|
||||
_buildNotificationsHeader(context),
|
||||
Expanded(
|
||||
child: CustomScrollView(
|
||||
controller: _scrollController,
|
||||
slivers: [
|
||||
..._buildNotificationSlivers(context),
|
||||
...widget.trailingSlivers,
|
||||
],
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () => _fetchPage(_currentPage),
|
||||
child: CustomScrollView(
|
||||
controller: _scrollController,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
slivers: [
|
||||
..._buildNotificationSlivers(context),
|
||||
...widget.trailingSlivers,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user