fix: email verify + consultant registration

This commit is contained in:
mso7nueh
2025-06-04 15:26:34 +03:00
parent cf6ad1eafe
commit cacfaff4cf
13 changed files with 87 additions and 67 deletions

View File

@@ -33,6 +33,7 @@ class ProfileCubit extends Cubit<ProfileState> {
);
} catch (e) {
emit(ProfileState.error(errorMessage: e.toString()));
rethrow;
}
}

View File

@@ -93,12 +93,15 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
return widget.author == null || widget.author!.authorIsMe ? _myProfileScreen(state) : _profileScreen(state);
} else if (state is ProfileStateError) {
return DataErrorWidget(
onReload: () async {
widget.author == null || widget.author!.authorIsMe
? await profileCubit.getMyProfile()
: await profileCubit.getProfileBySlug(widget.author!.authorSlug);
},
return Scaffold(
appBar: AppBar(),
body: DataErrorWidget(
onReload: () async {
widget.author == null || widget.author!.authorIsMe
? await profileCubit.getMyProfile()
: await profileCubit.getProfileBySlug(widget.author!.authorSlug);
},
),
);
} else {
return Scaffold(
@@ -437,12 +440,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: const EdgeInsets.only(bottom: 16),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
Text(
'Дипломы\nи сертификаты',
style: TextStyle(
color: Color(0xFF323F4B),
@@ -451,19 +454,19 @@ class _ProfileScreenState extends State<ProfileScreen> {
fontWeight: FontWeight.w600,
),
),
GestureDetector(
onTap: () {
GoRouter.of(context).pushNamed('stepperBecomeConsultantScreen', extra: state.profile.slug);
},
child: Text(
widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '',
style: const TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
// GestureDetector(
// onTap: () {
// GoRouter.of(context).pushNamed('stepperBecomeConsultantScreen', extra: state.profile.slug);
// },
// child: Text(
// widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '',
// style: const TextStyle(
// color: Color(0xFF2F80ED),
// fontSize: 16,
// fontWeight: FontWeight.w500,
// ),
// ),
// ),
],
),
),
@@ -538,12 +541,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
padding: const EdgeInsets.only(bottom: 16),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
Text(
'Образование',
style: TextStyle(
color: Color(0xFF323F4B),
@@ -551,19 +554,19 @@ class _ProfileScreenState extends State<ProfileScreen> {
fontWeight: FontWeight.w600,
),
),
GestureDetector(
onTap: () {
GoRouter.of(context).pushNamed('stepperBecomeConsultantScreen', extra: state.profile.slug);
},
child: Text(
widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '',
style: const TextStyle(
color: Color(0xFF2F80ED),
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
// GestureDetector(
// onTap: () {
// GoRouter.of(context).pushNamed('stepperBecomeConsultantScreen', extra: state.profile.slug);
// },
// child: Text(
// widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '',
// style: const TextStyle(
// color: Color(0xFF2F80ED),
// fontSize: 16,
// fontWeight: FontWeight.w500,
// ),
// ),
// ),
],
),
),