File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
app/lib/features/web_feed/presentation/screens Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1818 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1919 */
2020import 'package:flutter/material.dart' ;
21+ import 'package:flutter_hooks/flutter_hooks.dart' ;
22+ import 'package:flutter_material_design_icons/flutter_material_design_icons.dart' ;
2123import 'package:hooks_riverpod/hooks_riverpod.dart' ;
2224import 'package:weblibre/core/routing/routes.dart' ;
2325import 'package:weblibre/features/web_feed/domain/providers.dart' ;
@@ -33,7 +35,37 @@ class FeedListScreen extends HookConsumerWidget {
3335 final feeds = ref.watch (feedListProvider);
3436
3537 return Scaffold (
36- appBar: AppBar (title: const Text ('Feeds' )),
38+ appBar: AppBar (
39+ title: const Text ('Feeds' ),
40+ actions: [
41+ HookBuilder (
42+ builder: (context) {
43+ final future = useState <Future <void >?>(null );
44+ final state = useFuture (future.value);
45+
46+ if (state.connectionState == ConnectionState .waiting) {
47+ return const Padding (
48+ padding: EdgeInsets .all (12.0 ),
49+ child: SizedBox (
50+ width: 24 ,
51+ height: 24 ,
52+ child: CircularProgressIndicator (strokeWidth: 2.0 ),
53+ ),
54+ );
55+ }
56+
57+ return IconButton (
58+ onPressed: () {
59+ future.value = ref
60+ .read (fetchArticlesControllerProvider.notifier)
61+ .fetchAllArticles ();
62+ },
63+ icon: const Icon (MdiIcons .cloudSync),
64+ );
65+ },
66+ ),
67+ ],
68+ ),
3769 body: feeds.when (
3870 skipLoadingOnReload: true ,
3971 data: (feeds) {
You can’t perform that action at this time.
0 commit comments