From 4e690c2df84acef86e8303035ce559f4af928864 Mon Sep 17 00:00:00 2001 From: Harshith Goka Date: Sun, 6 Jan 2019 23:54:42 +0530 Subject: [PATCH] [App] bump versionName, versionCode; [BlogPage, ExplorePage] add firstBuild bool; --- Changelog.md | 6 ++++++ lib/src/blocs/explore_bloc.dart | 2 +- lib/src/routes/blogpage.dart | 8 ++++++++ lib/src/routes/explorepage.dart | 10 ++++++++-- pubspec.yaml | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9d92943d..3f73b835 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/lib/src/blocs/explore_bloc.dart b/lib/src/blocs/explore_bloc.dart index cce52b40..109a5fce 100644 --- a/lib/src/blocs/explore_bloc.dart +++ b/lib/src/blocs/explore_bloc.dart @@ -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)); } } diff --git a/lib/src/routes/blogpage.dart b/lib/src/routes/blogpage.dart index 44acb266..ea60875f 100644 --- a/lib/src/routes/blogpage.dart +++ b/lib/src/routes/blogpage.dart @@ -37,6 +37,8 @@ class _BlogPageState extends State { bool searchMode = false; IconData actionIcon = OMIcons.search; + bool firstBuild = true; + @override void initState() { super.initState(); @@ -65,6 +67,12 @@ class _BlogPageState extends State { var bloc = BlocProvider.of(context).bloc; var blogBloc = bloc.getPostsBloc(widget.postType); + if (firstBuild) { + blogBloc.query = ""; + blogBloc.refresh(); + firstBuild = false; + } + var footerButtons = searchMode ? [ Expanded( diff --git a/lib/src/routes/explorepage.dart b/lib/src/routes/explorepage.dart index bb8790ae..08ef91d0 100644 --- a/lib/src/routes/explorepage.dart +++ b/lib/src/routes/explorepage.dart @@ -25,6 +25,8 @@ class _ExplorePageState extends State { bool searchMode = false; IconData actionIcon = OMIcons.search; + bool firstBuild = true; + @override void initState() { super.initState(); @@ -51,7 +53,11 @@ class _ExplorePageState extends State { 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 ? [ @@ -152,7 +158,7 @@ class _ExplorePageState extends State { return RefreshIndicator( key: _refreshIndicatorKey, onRefresh: () { - exploreBloc.refresh(); + return exploreBloc.refresh(); }, child: ListView( scrollDirection: Axis.vertical, diff --git a/pubspec.yaml b/pubspec.yaml index 441b1743..af5f815a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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"