From 664aaefd8a8bb0411072078243e127651b0d6aca Mon Sep 17 00:00:00 2001 From: Prayas-Agrawal Date: Sun, 28 Jan 2024 18:30:29 +0530 Subject: [PATCH 1/4] FIX: Lost&Found: Loading Posts #48 --- lib/src/routes/lostandfoundfeedpage.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/routes/lostandfoundfeedpage.dart b/lib/src/routes/lostandfoundfeedpage.dart index 82a9ed8..7e85da1 100644 --- a/lib/src/routes/lostandfoundfeedpage.dart +++ b/lib/src/routes/lostandfoundfeedpage.dart @@ -168,6 +168,14 @@ class _LostpageState extends State { stream: lnFPostBloc.lostAndFoundPosts, builder: (BuildContext context, AsyncSnapshot> snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return Center( + child: CircularProgressIndicatorExtended( + label: Text("Getting the latest posts"), + ), + ); + } if (snapshot.data?.length != 0) { return ListView.builder( primary: false, @@ -178,7 +186,7 @@ class _LostpageState extends State { return Center( child: CircularProgressIndicatorExtended( - label: Text("Loading..."), + label: Text("Loading..."), )); } From 10b75243a9fe247add6718c8cd2f6f30aca5aafd Mon Sep 17 00:00:00 2001 From: Prayas-Agrawal Date: Sun, 28 Jan 2024 18:38:02 +0530 Subject: [PATCH 2/4] FIX: Buy&Sell: Loading Posts --- lib/src/routes/buynsell_page.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/src/routes/buynsell_page.dart b/lib/src/routes/buynsell_page.dart index 687b28a..dd8cdf5 100644 --- a/lib/src/routes/buynsell_page.dart +++ b/lib/src/routes/buynsell_page.dart @@ -204,6 +204,14 @@ class _SellpageState extends State { stream: buynSellPostBloc.buynsellposts, builder: (BuildContext context, AsyncSnapshot> snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return Center( + child: CircularProgressIndicatorExtended( + label: Text("Getting the latest posts"), + ), + ); + } return ListView.builder( primary: false, shrinkWrap: true, From aeffd7963eeceb3033f268b590a7fff4ed37114d Mon Sep 17 00:00:00 2001 From: Prayas-Agrawal Date: Sun, 28 Jan 2024 20:19:08 +0530 Subject: [PATCH 3/4] reset to master --- lib/src/routes/buynsell_page.dart | 8 -------- lib/src/routes/lostandfoundfeedpage.dart | 8 -------- 2 files changed, 16 deletions(-) diff --git a/lib/src/routes/buynsell_page.dart b/lib/src/routes/buynsell_page.dart index dd8cdf5..687b28a 100644 --- a/lib/src/routes/buynsell_page.dart +++ b/lib/src/routes/buynsell_page.dart @@ -204,14 +204,6 @@ class _SellpageState extends State { stream: buynSellPostBloc.buynsellposts, builder: (BuildContext context, AsyncSnapshot> snapshot) { - if (snapshot.connectionState == - ConnectionState.waiting) { - return Center( - child: CircularProgressIndicatorExtended( - label: Text("Getting the latest posts"), - ), - ); - } return ListView.builder( primary: false, shrinkWrap: true, diff --git a/lib/src/routes/lostandfoundfeedpage.dart b/lib/src/routes/lostandfoundfeedpage.dart index 7e85da1..96e3124 100644 --- a/lib/src/routes/lostandfoundfeedpage.dart +++ b/lib/src/routes/lostandfoundfeedpage.dart @@ -168,14 +168,6 @@ class _LostpageState extends State { stream: lnFPostBloc.lostAndFoundPosts, builder: (BuildContext context, AsyncSnapshot> snapshot) { - if (snapshot.connectionState == - ConnectionState.waiting) { - return Center( - child: CircularProgressIndicatorExtended( - label: Text("Getting the latest posts"), - ), - ); - } if (snapshot.data?.length != 0) { return ListView.builder( primary: false, From 49bbedda45f0575de4374b85f6ae03fab92064ef Mon Sep 17 00:00:00 2001 From: Prayas-Agrawal Date: Sun, 28 Jan 2024 23:17:26 +0530 Subject: [PATCH 4/4] FIX: Communities: Loading About & Featured Posts #47 --- lib/src/blocs/community_post_bloc.dart | 2 +- lib/src/routes/communitydetails.dart | 65 +++++++++++++++----------- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/lib/src/blocs/community_post_bloc.dart b/lib/src/blocs/community_post_bloc.dart index 9ca72ad..1202e39 100644 --- a/lib/src/blocs/community_post_bloc.dart +++ b/lib/src/blocs/community_post_bloc.dart @@ -46,7 +46,7 @@ class CommunityPostBloc { // _communitySubject.add(defCommunities); // print("refresh"); - _communitySubject.add([]); + // _communitySubject.add([]); if (id == null) { return; } diff --git a/lib/src/routes/communitydetails.dart b/lib/src/routes/communitydetails.dart index 44d180d..c16b62c 100644 --- a/lib/src/routes/communitydetails.dart +++ b/lib/src/routes/communitydetails.dart @@ -60,7 +60,6 @@ class _CommunityDetailsState extends State { }); } }); - } @override @@ -297,27 +296,27 @@ class CommunityAboutSectionState extends State { mainAxisSize: MainAxisSize.min, children: [ Container( - child: TabBar( - tabs: [ - Tab( - child: Text( - "About", - style: theme.textTheme.bodyText1, - ), + child: TabBar( + tabs: [ + Tab( + child: Text( + "About", + style: theme.textTheme.bodyText1, ), - Tab( - child: Text( - "Members", - style: theme.textTheme.bodyText1, - ), - ) - ], - onTap: (index) { - setState(() { - _selectedIndex = index; - }); - }, - ), + ), + Tab( + child: Text( + "Members", + style: theme.textTheme.bodyText1, + ), + ) + ], + onTap: (index) { + setState(() { + _selectedIndex = index; + }); + }, + ), ), IndexedStack( children: [ @@ -425,7 +424,11 @@ class CommunityAboutSectionState extends State { Widget _buildFeaturedPosts(ThemeData theme, List? posts) { if (posts == null || posts.isEmpty) { - return Container(); + return Center( + child: CircularProgressIndicatorExtended( + label: Text("Getting Featured Posts"), + ), + ); } return Column( children: [ @@ -494,8 +497,8 @@ class _CommunityPostSectionState extends State { var theme = Theme.of(context); var bloc = BlocProvider.of(context)!.bloc; var communityPostBloc = bloc.communityPostBloc; - - loading=false; + + loading = false; if (firstBuild) { communityPostBloc.query = ""; communityPostBloc.refresh(id: widget.community?.id); @@ -530,8 +533,7 @@ class _CommunityPostSectionState extends State { cpType = CPType.All; }); await communityPostBloc.refresh( - type: CPType.All, - id: widget.community?.id); + type: CPType.All, id: widget.community?.id); setState(() { loading = false; }); @@ -573,8 +575,7 @@ class _CommunityPostSectionState extends State { }); await communityPostBloc.refresh( type: CPType.PendingPosts, - id: widget.community?.id - ); + id: widget.community?.id); setState(() { loading = false; }); @@ -624,6 +625,14 @@ class _CommunityPostSectionState extends State { stream: communityPostBloc.communityposts, builder: (BuildContext context, AsyncSnapshot> snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return Center( + child: CircularProgressIndicatorExtended( + label: Text("Getting the latest posts"), + ), + ); + } return Column( children: _buildPostList(snapshot, theme, communityPostBloc, community.id),