Skip to content

Commit

Permalink
[App] bump versionName, versionCode; [BlogPage, ExplorePage] add firs…
Browse files Browse the repository at this point in the history
…tBuild bool;
  • Loading branch information
tastelessjolt committed Jan 6, 2019
1 parent 1919e1c commit 4e690c2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.9-alpha

* Implemented ExplorePage
* Change back to Side Navigation Drawer
* Fix few bugs

## v0.8.1-alpha

* Implemented UserPage, NewsPage, QuickLinksPage
Expand Down
2 changes: 1 addition & 1 deletion lib/src/blocs/explore_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class ExploreBloc {
}
_push(ExploreResponse(bodies: allBodies));

return Future.delayed(Duration(milliseconds: 300));
} else {
_push(await bloc.client.search(bloc.getSessionIdHeader(), query));
}
return Future.delayed(Duration(milliseconds: 300));
}
}
8 changes: 8 additions & 0 deletions lib/src/routes/blogpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class _BlogPageState extends State<BlogPage> {
bool searchMode = false;
IconData actionIcon = OMIcons.search;

bool firstBuild = true;

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -65,6 +67,12 @@ class _BlogPageState extends State<BlogPage> {
var bloc = BlocProvider.of(context).bloc;
var blogBloc = bloc.getPostsBloc(widget.postType);

if (firstBuild) {
blogBloc.query = "";
blogBloc.refresh();
firstBuild = false;
}

var footerButtons = searchMode
? [
Expanded(
Expand Down
10 changes: 8 additions & 2 deletions lib/src/routes/explorepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class _ExplorePageState extends State<ExplorePage> {
bool searchMode = false;
IconData actionIcon = OMIcons.search;

bool firstBuild = true;

@override
void initState() {
super.initState();
Expand All @@ -51,7 +53,11 @@ class _ExplorePageState extends State<ExplorePage> {
var theme = Theme.of(context);
var bloc = BlocProvider.of(context).bloc;
var exploreBloc = bloc.exploreBloc;
exploreBloc.refresh();
if (firstBuild) {
exploreBloc.query = "";
exploreBloc.refresh();
firstBuild = false;
}

var footerButtons = searchMode
? [
Expand Down Expand Up @@ -152,7 +158,7 @@ class _ExplorePageState extends State<ExplorePage> {
return RefreshIndicator(
key: _refreshIndicatorKey,
onRefresh: () {
exploreBloc.refresh();
return exploreBloc.refresh();
},
child: ListView(
scrollDirection: Axis.vertical,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Flutter App for Indian Institute of Technology, Bombay
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 0.8.1+10
version: 0.9.0+11

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
Expand Down

0 comments on commit 4e690c2

Please sign in to comment.