Skip to content

Commit

Permalink
Merge pull request #50 from Krishna-Baldwa/idf2
Browse files Browse the repository at this point in the history
Idf2
  • Loading branch information
Krishna-Baldwa authored Dec 9, 2023
2 parents cf5e1df + bfd6434 commit 5d3c480
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 30 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
2 changes: 1 addition & 1 deletion assets/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<div class="lowerdiv">
<div class="logindiv">
<a class="login" id="loginLink" onclick="showLoading()"
href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=vR1pU7wXWyve1rUkg0fMS6StL1Kr6paoSmRIiLXJ&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html">
href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=HeKlfCluQLxa5cG5c4yHYiAEFZynroiKwylpiwNV&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html">
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=5jyMJufq0Vk0aDlj9Hnudsj84UfbFZlYRUnn02Xd&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=MQXcx3EHMqoGW57dXM27j2HSzEpvGAARASXraRmX&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=gxzx6u7aw6wco6SJBioORPwum5Sug7OrIPrm8r2W&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
Expand Down
2 changes: 1 addition & 1 deletion assets/login/login_dark.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<div class="lowerdiv">
<div class="logindiv">
<a class="login" onclick="showLoading()"
href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=vR1pU7wXWyve1rUkg0fMS6StL1Kr6paoSmRIiLXJ&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html">
href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=HeKlfCluQLxa5cG5c4yHYiAEFZynroiKwylpiwNV&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html">
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=5jyMJufq0Vk0aDlj9Hnudsj84UfbFZlYRUnn02Xd&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=8iPdGfcUEoe6P3IHmQQ63CuPW4glQd1mbsdQtHkW&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=MQXcx3EHMqoGW57dXM27j2HSzEpvGAARASXraRmX&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down
3 changes: 2 additions & 1 deletion lib/src/api/apiclient.dart
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ abstract class InstiAppApi {
Future<CommunityPostListResponse> getCommunityPosts(
@rt.Header("Cookie") String sessionId,
@rt.Query("status") int? status,
@rt.Query("query") String query);
@rt.Query("query") String query,
@rt.Query("community") String id);

@rt.GET("/communityposts/{id}")
Future<CommunityPost> getCommunityPost(
Expand Down
5 changes: 3 additions & 2 deletions lib/src/api/apiclient.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions lib/src/blocs/community_post_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ class CommunityPostBloc {
bloc.getSessionIdHeader(), post.id!, reaction);
}

Future refresh({CPType type = CPType.All}) async {
Future refresh({CPType type = CPType.All, required String? id}) async {
// _communityPosts = defCommunities;
// _communitySubject.add(defCommunities);
// print("refresh");
if (id == null) {
_communitySubject.add([]);
return;
}

int? status;
switch (type) {
case CPType.All:
Expand All @@ -60,9 +65,9 @@ class CommunityPostBloc {
status = null;
break;
}
_communityPosts = (await bloc.client
.getCommunityPosts(bloc.getSessionIdHeader(), status, query))
.data ??
_communityPosts = (await bloc.client.getCommunityPosts(
bloc.getSessionIdHeader(), status, query, id))
.data ??
[];

// print("community" + _communityPosts.toString());
Expand Down
2 changes: 1 addition & 1 deletion lib/src/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class _NavDrawerState extends State<NavDrawer> {
),
15: NavListTile(
icon: Icons.forum_outlined,
title: "Insight Discussion Forum",
title: "Communities",
onTap: () {
changeSelection(15, drawerState!);
navigateNamed('/groups');
Expand Down
26 changes: 16 additions & 10 deletions lib/src/routes/communitydetails.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ class _CommunityDetailsState extends State<CommunityDetails> {
appBarSearchStyle:
AppBarSearchStyle(hintText: "Search " + (community?.name ?? "")),
//TODO: Uncomment leading style
// leadingStyle: LeadingStyle(
// icon: Icons.arrow_back,
// onPressed: () async {
// Navigator.of(context).pop();
// }),
leadingStyle: LeadingStyle(
icon: Icons.arrow_back,
onPressed: () async {
Navigator.of(context).pop();
}),
),
drawer: NavDrawer(),
bottomNavigationBar: MyBottomAppBar(
Expand Down Expand Up @@ -496,7 +496,7 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {

if (firstBuild) {
communityPostBloc.query = "";
communityPostBloc.refresh();
communityPostBloc.refresh(id: widget.community?.id);
firstBuild = false;
}

Expand Down Expand Up @@ -527,7 +527,9 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
loading = true;
cpType = CPType.All;
});
await communityPostBloc.refresh(type: CPType.All);
await communityPostBloc.refresh(
type: CPType.All,
id: widget.community?.id);
setState(() {
loading = false;
});
Expand All @@ -546,7 +548,8 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
cpType = CPType.YourPosts;
});
await communityPostBloc.refresh(
type: CPType.YourPosts);
type: CPType.YourPosts,
id: widget.community?.id);
setState(() {
loading = false;
});
Expand All @@ -567,7 +570,9 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
cpType = CPType.PendingPosts;
});
await communityPostBloc.refresh(
type: CPType.PendingPosts);
type: CPType.PendingPosts,
id: widget.community?.id
);
setState(() {
loading = false;
});
Expand All @@ -589,7 +594,8 @@ class _CommunityPostSectionState extends State<CommunityPostSection> {
cpType = CPType.ReportedContent;
});
await communityPostBloc.refresh(
type: CPType.ReportedContent,
type: CPType.ReportedContent,
id: widget.community?.id,
);
setState(() {
loading = false;
Expand Down
13 changes: 6 additions & 7 deletions lib/src/routes/communitypage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ class _CommunityPageState extends State<CommunityPage> {
//move to next page

if (firstCallBack) {
//TODO: Remove this navigation if more than one community
WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
Navigator.of(context).pop();
CommunityDetails.navigateWith(context, communityBloc, communities[0]);
});
// //TODO: Remove this navigation if more than one community
// WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
// Navigator.of(context).pop();
// CommunityDetails.navigateWith(context, communityBloc, communities[0]);
// });
firstCallBack = false;
}

Expand Down Expand Up @@ -244,8 +244,7 @@ class _CommunityPageState extends State<CommunityPage> {
.cover, //I assumed you want to occupy the entire space of the card
image: community.coverImg != null
? CachedNetworkImageProvider(community.coverImg!)
: CachedNetworkImageProvider(
"https://devcom-iitb.org/images/logos/DC_logo.png"),
: Image.asset('assets/buynsell/DevcomLogo.png').image,
colorFilter:
ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.darken),
),
Expand Down

0 comments on commit 5d3c480

Please sign in to comment.