Skip to content

Commit

Permalink
removed subscribed to mail data for others profile
Browse files Browse the repository at this point in the history
  • Loading branch information
noman2002 committed Mar 16, 2022
1 parent 3a36b23 commit 2dfe2fb
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions lib/ui/views/profile/profile_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,37 @@ class _ProfileViewState extends State<ProfileView> {
return Container();
}

Widget _buildSubscribeToMailComponent() {
var _attrs = _model.user?.data.attributes;

var _localStorageService = locator<LocalStorageService>();
if (_localStorageService.isLoggedIn &&
userId == _localStorageService.currentUser!.data.id) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 4),
alignment: Alignment.centerLeft,
child: RichText(
text: TextSpan(
style: Theme.of(context).textTheme.bodyText1,
children: <TextSpan>[
TextSpan(
text: 'Subscribed to mails : ',
style: Theme.of(context).textTheme.bodyText1?.copyWith(
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: _attrs?.subscribed.toString(),
)
],
),
),
);
}

return Container();
}

Widget _buildProfileCard() {
var _attrs = _model.user?.data.attributes;

Expand Down Expand Up @@ -149,10 +180,7 @@ class _ProfileViewState extends State<ProfileView> {
'Educational Institute',
_attrs?.educationalInstitute,
),
_buildProfileComponent(
'Subscribed to mails',
_attrs?.subscribed.toString(),
),
_buildSubscribeToMailComponent(),
_buildEditProfileButton()
],
),
Expand Down

0 comments on commit 2dfe2fb

Please sign in to comment.