forked from eatvio/eatvio_app
feat(verify): phone + email
This commit is contained in:
@@ -36,10 +36,6 @@ class ProfileCubit extends Cubit<ProfileState> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getPassKey(String phone) async {
|
||||
return (await profileRepository.getPassKey('+79150626151'));
|
||||
}
|
||||
|
||||
Future<void> getMyProfile({
|
||||
String period = '1',
|
||||
}) async {
|
||||
|
||||
@@ -26,6 +26,7 @@ import 'package:eatvio_app/features/profile/presentation/widgets/profile_blog_po
|
||||
import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart';
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@@ -54,6 +55,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
final List<String> chipsLabelList = ['Вес', 'Замеры', 'ИМТ'];
|
||||
final List<String> chipsIntervalLabelList = ['1М', '3М', '6М', '1Г', 'ВСЁ ВРЕМЯ'];
|
||||
final List<String> chipsIntervalList = ['1', '3', '6', '12', 'all'];
|
||||
final TextEditingController controller = TextEditingController();
|
||||
|
||||
List<WeightModel> weightPoints = [];
|
||||
List<CircumferenceModel> circumferencePoints = [];
|
||||
@@ -222,9 +224,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
ElevatedButton(onPressed: () async {
|
||||
final String passKey = await profileCubit.getPassKey('+79150626151');
|
||||
GoRouter.of(context).pushNamed('verifyScreen', extra: passKey);
|
||||
}, child: Text('phone verify')),
|
||||
await sl<ProfileRepository>().sendEmailCode();
|
||||
}, child: Text('send email verify code')),
|
||||
TextFormField(
|
||||
controller: controller,
|
||||
),
|
||||
ElevatedButton(onPressed: () async {
|
||||
await sl<ProfileRepository>().tryVerifyEmailByCode(controller.text);
|
||||
}, child: Text('try verify email by code')),
|
||||
_header(state),
|
||||
if (state.profile.roles.contains('consultant'))
|
||||
Column(
|
||||
|
||||
Reference in New Issue
Block a user