Skip to content

Commit

Permalink
feat: Removed tabs when user does not has any relation. Fix for issue a…
Browse files Browse the repository at this point in the history
  • Loading branch information
justdvnsh committed Aug 3, 2020
1 parent 77fc5b3 commit 48c1237
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*___Generated_by_IDEA___*/

package org.systers.mentorship_client;

/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*___Generated_by_IDEA___*/

package org.systers.mentorship_client;

/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
12 changes: 9 additions & 3 deletions lib/screens/home/pages/relation/relation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class RelationPage extends StatefulWidget {

class _RelationPageState extends State<RelationPage> {
Completer<void> _refreshCompleter;
bool _isAppbarVisible = true;

@override
void initState() {
Expand All @@ -32,13 +33,13 @@ class _RelationPageState extends State<RelationPage> {
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: TabBar(
appBar: _isAppbarVisible ? TabBar(
labelColor: Theme.of(context).accentColor,
tabs: [
Tab(text: "Details".toUpperCase()),
Tab(text: "Tasks".toUpperCase()),
],
),
]
) : null,
body: BlocConsumer<RelationPageBloc, RelationPageState>(listener: (context, state) {
if (state.message != null && state is RelationPageSuccess) {
context.showSnackBar(state.message);
Expand All @@ -48,6 +49,11 @@ class _RelationPageState extends State<RelationPage> {
_refreshCompleter?.complete();
_refreshCompleter = Completer();
}
if (state is RelationPageFailure) {
setState(() {
_isAppbarVisible = false;
});
}
}, builder: (context, state) {
return BlocBuilder<RelationPageBloc, RelationPageState>(
builder: (context, state) {
Expand Down
22 changes: 4 additions & 18 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.4"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
code_builder:
dependency: transitive
description:
Expand Down Expand Up @@ -225,13 +218,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
fixnum:
dependency: transitive
description:
Expand Down Expand Up @@ -421,7 +407,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.6.4"
pedantic:
dependency: transitive
description:
Expand All @@ -435,7 +421,7 @@ packages:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
version: "2.4.0"
platform_detect:
dependency: transitive
description:
Expand Down Expand Up @@ -559,7 +545,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.16"
version: "0.2.15"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -636,7 +622,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.7.0"
version: "3.6.1"
yaml:
dependency: transitive
description:
Expand Down

0 comments on commit 48c1237

Please sign in to comment.