Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/blocs/community_post_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CommunityPostBloc {
// _communitySubject.add(defCommunities);
// print("refresh");

_communitySubject.add([]);
// _communitySubject.add([]);
if (id == null) {
return;
}
Expand Down
65 changes: 37 additions & 28 deletions lib/src/routes/communitydetails.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class _CommunityDetailsState extends State<CommunityDetails> {
});
}
});

}

@override
Expand Down Expand Up @@ -297,27 +296,27 @@ class CommunityAboutSectionState extends State<CommunityAboutSection> {
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: [
Expand Down Expand Up @@ -425,7 +424,11 @@ class CommunityAboutSectionState extends State<CommunityAboutSection> {

Widget _buildFeaturedPosts(ThemeData theme, List<CommunityPost>? posts) {
if (posts == null || posts.isEmpty) {
return Container();
return Center(
child: CircularProgressIndicatorExtended(
label: Text("Getting Featured Posts"),
),
);
}
return Column(
children: [
Expand Down Expand Up @@ -494,8 +497,8 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
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);
Expand Down Expand Up @@ -530,8 +533,7 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
cpType = CPType.All;
});
await communityPostBloc.refresh(
type: CPType.All,
id: widget.community?.id);
type: CPType.All, id: widget.community?.id);
setState(() {
loading = false;
});
Expand Down Expand Up @@ -573,8 +575,7 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
});
await communityPostBloc.refresh(
type: CPType.PendingPosts,
id: widget.community?.id
);
id: widget.community?.id);
setState(() {
loading = false;
});
Expand Down Expand Up @@ -624,6 +625,14 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
stream: communityPostBloc.communityposts,
builder: (BuildContext context,
AsyncSnapshot<List<CommunityPost>> 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),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/routes/lostandfoundfeedpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class _LostpageState extends State<LostPage> {
return Center(
child:
CircularProgressIndicatorExtended(
label: Text("Loading..."),
label: Text("Loading..."),
));
}

Expand Down