feat(consultant): registration steps

This commit is contained in:
mso7nueh
2024-10-06 14:46:53 +03:00
parent ac7cd8e3fb
commit 26f25a40ed
16 changed files with 1060 additions and 436 deletions

View File

@@ -1,3 +1,5 @@
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AdditionalSettingsScreen extends StatefulWidget {
@@ -8,8 +10,89 @@ class AdditionalSettingsScreen extends StatefulWidget {
}
class _AdditionalSettingsScreenState extends State<AdditionalSettingsScreen> {
bool publishDiplomasAndCertificatesInProfile = false;
bool haveMedicalDegree = false;
@override
Widget build(BuildContext context) {
return const Placeholder();
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'Дополнительные настройки',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
),
const SizedBox(height: 16),
_tile(
title: 'Опубликовать дипломы\nи сертификаты в профиле',
value: publishDiplomasAndCertificatesInProfile,
onTap: () {
setState(() {
publishDiplomasAndCertificatesInProfile = !publishDiplomasAndCertificatesInProfile;
});
},
),
_divider(context),
_tile(
title: 'У меня есть медицинское образование ',
value: haveMedicalDegree,
onTap: () {
setState(() {
haveMedicalDegree = !haveMedicalDegree;
});
},
),
],
),
);
}
_tile({
required String title,
required Function() onTap,
required bool value,
}) {
return ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
onTap: onTap,
title: Text(
title,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w400,
height: 1,
),
),
trailing: CupertinoSwitch(
value: value,
activeColor: appTheme.blueA400,
onChanged: (_) {
onTap();
},
),
);
}
_divider(BuildContext context) {
return Center(
child: Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,
decoration: BoxDecoration(
color: Colors.black26,
borderRadius: BorderRadius.circular(16),
),
),
);
}
}

View File

@@ -0,0 +1,88 @@
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class CertificatesAndDiplomasScreen extends StatefulWidget {
const CertificatesAndDiplomasScreen({super.key});
@override
State<CertificatesAndDiplomasScreen> createState() => _CertificatesAndDiplomasScreenState();
}
class _CertificatesAndDiplomasScreenState extends State<CertificatesAndDiplomasScreen> {
late DateTime selectedDate = DateTime.now();
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Добавьте дипломы\nи сертификаты',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
const SizedBox(height: 16),
CustomTextFormField(),
const SizedBox(height: 8),
ListTile(
onTap: onTapCalendar(context),
trailing: Icon(
Icons.keyboard_arrow_down_rounded,
color: Colors.grey.shade700,
),
contentPadding: EdgeInsets.symmetric(horizontal: 12),
title: Text(selectedDate.format('dd MMMM yyyy', 'ru')),
tileColor: Color(0xFFF6F6F6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
],
),
);
}
onTapCalendar(BuildContext context) {
return () {
_showDialog(
CupertinoDatePicker(
initialDateTime: selectedDate,
maximumDate: DateTime.now(),
minimumDate: DateTime(1900),
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (DateTime newDateTime) {
setState(() {
selectedDate = newDateTime;
});
},
),
);
};
}
void _showDialog(Widget child) {
showCupertinoModalPopup<void>(
context: context,
builder: (BuildContext context) => Container(
height: 216,
padding: const EdgeInsets.only(top: 6),
margin: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
color: CupertinoColors.systemBackground.resolveFrom(context),
child: SafeArea(
top: false,
child: child,
),
),
);
}
}

View File

@@ -1,30 +0,0 @@
import 'package:flutter/material.dart';
class CertificatesAndDiplomsScreen extends StatefulWidget {
const CertificatesAndDiplomsScreen({super.key});
@override
State<CertificatesAndDiplomsScreen> createState() => _CertificatesAndDiplomsScreenState();
}
class _CertificatesAndDiplomsScreenState extends State<CertificatesAndDiplomsScreen> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Добавьте дипломы\nи сертификаты',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
],
),
);
}
}

View File

@@ -1,3 +1,4 @@
import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
class LastStepScreen extends StatefulWidget {
@@ -8,8 +9,80 @@ class LastStepScreen extends StatefulWidget {
}
class _LastStepScreenState extends State<LastStepScreen> {
bool checkboxState = false;
@override
Widget build(BuildContext context) {
return const Placeholder();
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'Последний шаг',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
),
const SizedBox(height: 16),
CheckboxListTile(
value: checkboxState,
title: Text(
'Я ознакомлен и принимаю договор публичной оферты',
style: TextStyle(
fontSize: 18,
height: 1,
),
),
onChanged: (_) {
setState(() {
checkboxState = !checkboxState;
});
},
activeColor: appTheme.blueA400,
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
child: _divider(context),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: TextButton(
onPressed: () {},
child: Text(
'Договор офёрты',
style: TextStyle(
height: 1,
fontSize: 16,
color: Color(0xFF323F4B),
decoration: TextDecoration.underline,
),
),
),
),
],
),
);
}
_divider(BuildContext context) {
return Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,
decoration: BoxDecoration(
color: Colors.black26,
borderRadius: BorderRadius.circular(16),
),
);
}
}

View File

@@ -10,6 +10,23 @@ class PhotoOrScansScreen extends StatefulWidget {
class _PhotoOrScansScreenState extends State<PhotoOrScansScreen> {
@override
Widget build(BuildContext context) {
return const Placeholder();
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Загрузите фото или сканы дипломов и сертификатов',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
const SizedBox(height: 16),
],
),
);
}
}

View File

@@ -7,9 +7,109 @@ class RegistrationAsScreen extends StatefulWidget {
State<RegistrationAsScreen> createState() => _RegistrationAsScreenState();
}
enum RegistrationAsType { Physical, SelfBusy, IP, OOO }
class _RegistrationAsScreenState extends State<RegistrationAsScreen> {
RegistrationAsType registrationAsType = RegistrationAsType.Physical;
@override
Widget build(BuildContext context) {
return const Placeholder();
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'Регистрация в качестве',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
),
const SizedBox(height: 16),
RadioListTile<RegistrationAsType>(
value: RegistrationAsType.Physical,
groupValue: registrationAsType,
title: Text(
'Физического лица',
style: TextStyle(
fontSize: 18,
height: 1,
),
),
onChanged: (value) {},
contentPadding: EdgeInsets.symmetric(horizontal: 8),
),
RadioListTile<RegistrationAsType>(
value: RegistrationAsType.SelfBusy,
groupValue: registrationAsType,
title: Text(
'Самозанятого',
style: TextStyle(
fontSize: 18,
height: 1,
),
),
onChanged: null,
contentPadding: EdgeInsets.symmetric(horizontal: 8),
),
RadioListTile<RegistrationAsType>(
value: RegistrationAsType.IP,
groupValue: registrationAsType,
title: Text(
'Индивидуального предпринимателя',
style: TextStyle(
fontSize: 18,
height: 1,
),
),
onChanged: null,
contentPadding: EdgeInsets.symmetric(horizontal: 8),
),
RadioListTile<RegistrationAsType>(
value: RegistrationAsType.OOO,
groupValue: registrationAsType,
title: Text(
'Общества с ограниченной ответственностью',
style: TextStyle(
fontSize: 18,
height: 1,
),
),
onChanged: null,
contentPadding: EdgeInsets.symmetric(horizontal: 8),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16,
vertical: 16,
),
child: _divider(context),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(
'* На данный момент регистрация доступна только в качестве физического лица. Остальные варианты скоро появятся',
),
),
],
),
);
}
_divider(BuildContext context) {
return Container(
height: 0.4,
width: MediaQuery.of(context).size.width - 32,
decoration: BoxDecoration(
color: Colors.black26,
borderRadius: BorderRadius.circular(16),
),
);
}
}

View File

@@ -1,4 +1,6 @@
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class SocialNetworksScreen extends StatefulWidget {
const SocialNetworksScreen({super.key});
@@ -10,6 +12,97 @@ class SocialNetworksScreen extends StatefulWidget {
class _SocialNetworksScreenState extends State<SocialNetworksScreen> {
@override
Widget build(BuildContext context) {
return const Placeholder();
return SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80, right: 16, left: 16, top: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Социальные сети',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
height: 1.1,
),
),
const SizedBox(height: 24),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 52,
width: 52,
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(20),
),
child: SvgPicture.asset(
'assets/icons/vk.svg',
),
),
const SizedBox(width: 8),
SizedBox(
width: MediaQuery.of(context).size.width - 92,
child: CustomTextFormField(
hintText: 'ВКонтакте',
),
),
],
),
const SizedBox(height: 12),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 52,
width: 52,
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(20),
),
child: SvgPicture.asset(
'assets/icons/telegram.svg',
),
),
const SizedBox(width: 8),
SizedBox(
width: MediaQuery.of(context).size.width - 92,
child: CustomTextFormField(
hintText: 'Telegram',
),
),
],
),
const SizedBox(height: 12),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 52,
width: 52,
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(20),
),
child: SvgPicture.asset(
'assets/icons/web.svg',
),
),
const SizedBox(width: 8),
SizedBox(
width: MediaQuery.of(context).size.width - 92,
child: CustomTextFormField(
hintText: 'Личный сайт',
),
),
],
),
],
),
);
}
}

View File

@@ -1,6 +1,6 @@
import 'package:eatvio_app/core/utils/image_constant.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/additional_settings_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/certificates_and_diploms_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/certificates_and_diplomas_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/last_step_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/photo_or_scans_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/registration_as_screen.dart';
@@ -132,7 +132,7 @@ class _StepperBecomeConsultantScreenState extends State<StepperBecomeConsultantS
});
},
children: [
CertificatesAndDiplomsScreen(),
CertificatesAndDiplomasScreen(),
PhotoOrScansScreen(),
AdditionalSettingsScreen(),
SocialNetworksScreen(),