fixed profile, recipeis and diets

This commit is contained in:
Username1548
2025-02-10 21:50:13 +07:00
parent 5ea3264474
commit 070d7e1047
51 changed files with 1382 additions and 1360 deletions

View File

@@ -81,7 +81,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
if (isFirstFetch) {
canSub = !state.profile.isEntitySubscribedByMe;
if (state.profile.role == 'consultant') {
if (state.profile.roles.contains('consultant')) {
plansCubit..getPlans(state.profile.slug);
}
isFirstFetch = false;
@@ -127,7 +127,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_header(state),
if (state.profile.role == 'consultant')
if (state.profile.roles.contains('consultant'))
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -192,10 +192,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.role == 'consultant') _socialLinks(state),
if (state.profile.role == 'consultant') _education(state),
if (state.profile.role == 'consultant') _diplomasAndCertificates(state),
if (state.profile.role == 'consultant') _activePlans(state),
if (state.profile.roles.contains('consultant')) _socialLinks(state),
if (state.profile.roles.contains('consultant')) _education(state),
if (state.profile.roles.contains('consultant')) _diplomasAndCertificates(state),
if (state.profile.roles.contains('consultant')) _activePlans(state),
_blogPosts(state),
],
),
@@ -228,11 +228,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
_subscriptionsAndSubscribers(state),
if (state.profile.badges.isNotEmpty) Padding(padding: EdgeInsets.only(bottom: 16), child: _badges(state)),
if (state.profile.role == 'consultant') _socialLinks(state),
if (state.profile.role == 'consultant') _education(state),
if (state.profile.role == 'consultant') _diplomasAndCertificates(state),
if (state.profile.roles.contains('consultant')) _socialLinks(state),
if (state.profile.roles.contains('consultant')) _education(state),
if (state.profile.roles.contains('consultant')) _diplomasAndCertificates(state),
Padding(padding: EdgeInsets.only(bottom: 16), child: _charts()),
if (state.profile.role == 'consultant') _activePlans(state),
if (state.profile.roles.contains('consultant')) _activePlans(state),
_newBlogPostButton(),
_blogPosts(state),
],
@@ -242,7 +242,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_activePlans(ProfileStateLoaded state) {
if (state.profile.role != 'consultant') {
if (!state.profile.roles.contains('consultant')) {
return const SizedBox.shrink();
}
return BlocBuilder<PlansCubit, PlansState>(
@@ -372,7 +372,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_diplomasAndCertificates(ProfileStateLoaded state) {
if (state.profile.role != 'consultant' || state.profile.diplomasAndCertificates == null || state.profile.diplomasAndCertificates!.isEmpty) {
if (!state.profile.roles.contains('consultant') || state.profile.diplomasAndCertificates == null || state.profile.diplomasAndCertificates!.isEmpty) {
return const SizedBox.shrink();
}
return Padding(
@@ -456,7 +456,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_education(ProfileStateLoaded state) {
if (state.profile.role != 'consultant' ||
if (!state.profile.roles.contains('consultant') ||
state.profile.educationResource?.completedCourses == null ||
state.profile.educationResource?.completedCourses?.length == 0) {
return const SizedBox.shrink();
@@ -549,7 +549,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_socialLinks(ProfileStateLoaded state) {
if (state.profile.role != 'consultant') {
if (!state.profile.roles.contains('consultant')) {
return const SizedBox.shrink();
}
return Padding(