Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

feat: Removed tabs when user does not has any relation. Fix for issue #122 #125

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*___Generated_by_IDEA___*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gitignore please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justdvnsh any updates?


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___*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gitignore


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