diff --git a/lib/src/api/apiclient.dart b/lib/src/api/apiclient.dart index 6ed84066..8a4fa461 100644 --- a/lib/src/api/apiclient.dart +++ b/lib/src/api/apiclient.dart @@ -48,7 +48,7 @@ part 'apiclient.g.dart'; //@rt.RestApi(baseUrl: "http://192.168.1.103:8000/api") // @rt.RestApi(baseUrl: "http://10.105.177.150/api") -@rt.RestApi(baseUrl: "https://0d01-2405-201-5004-3e45-7431-160c-1fa7-d48.ngrok-free.app/api") +@rt.RestApi(baseUrl: "https://gymkhana.iitb.ac.in/instiapp/api") // @rt.RestApi(baseUrl: "https://272c-2405-201-5004-3c2f-d836-b028-6ac-ad9.ngrok-free.app/api") abstract class InstiAppApi { factory InstiAppApi(Dio dio, {String baseUrl}) = _InstiAppApi; diff --git a/lib/src/api/apiclient.g.dart b/lib/src/api/apiclient.g.dart index 7b1c5dc5..c98d3d20 100644 --- a/lib/src/api/apiclient.g.dart +++ b/lib/src/api/apiclient.g.dart @@ -8,7 +8,7 @@ part of 'apiclient.dart'; class _InstiAppApi implements InstiAppApi { _InstiAppApi(this._dio, {this.baseUrl}) { - baseUrl ??= 'https://0d01-2405-201-5004-3e45-7431-160c-1fa7-d48.ngrok-free.app/api'; + baseUrl ??= 'https://gymkhana.iitb.ac.in/instiapp/api'; } final Dio _dio; diff --git a/lib/src/blocs/community_post_bloc.dart b/lib/src/blocs/community_post_bloc.dart index 83ac4c00..9ca72ad8 100644 --- a/lib/src/blocs/community_post_bloc.dart +++ b/lib/src/blocs/community_post_bloc.dart @@ -45,8 +45,9 @@ class CommunityPostBloc { // _communityPosts = defCommunities; // _communitySubject.add(defCommunities); // print("refresh"); + + _communitySubject.add([]); if (id == null) { - _communitySubject.add([]); return; } @@ -66,8 +67,8 @@ class CommunityPostBloc { break; } _communityPosts = (await bloc.client.getCommunityPosts( - bloc.getSessionIdHeader(), status, query, id)) - .data ?? + bloc.getSessionIdHeader(), status, query, id)) + .data ?? []; // print("community" + _communityPosts.toString()); diff --git a/lib/src/routes/communitydetails.dart b/lib/src/routes/communitydetails.dart index fb773bcd..44d180d0 100644 --- a/lib/src/routes/communitydetails.dart +++ b/lib/src/routes/communitydetails.dart @@ -1,17 +1,17 @@ import 'dart:async'; import 'package:InstiApp/src/api/model/community.dart'; +import 'package:InstiApp/src/api/model/communityPost.dart'; import 'package:InstiApp/src/api/model/user.dart'; import 'package:InstiApp/src/blocs/community_bloc.dart'; import 'package:InstiApp/src/blocs/community_post_bloc.dart'; -import 'package:InstiApp/src/api/model/communityPost.dart'; -import 'package:InstiApp/src/routes/createpost_form.dart'; -import 'package:InstiApp/src/utils/customappbar.dart'; import 'package:InstiApp/src/drawer.dart'; +import 'package:InstiApp/src/routes/createpost_form.dart'; import 'package:InstiApp/src/utils/common_widgets.dart'; +import 'package:InstiApp/src/utils/customappbar.dart'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; import '../bloc_provider.dart'; @@ -494,15 +494,7 @@ class _CommunityPostSectionState extends State { var theme = Theme.of(context); var bloc = BlocProvider.of(context)!.bloc; var communityPostBloc = bloc.communityPostBloc; - () async { - setState(() { - loading = true; - cpType = CPType.All; - }); - await communityPostBloc.refresh( - type: CPType.All, - id: widget.community?.id); - }; + loading=false; if (firstBuild) { communityPostBloc.query = "";