forked from eatvio/eatvio_app
feat(consultant_scoring): fixed registration update flow
This commit is contained in:
@@ -107,7 +107,7 @@ class RegisterConsultantCubit extends Cubit<RegisterConsultantState> {
|
||||
birthPlace: _emptyToNull(legal?.birthPlace),
|
||||
registrationAddress: _emptyToNull(legal?.registrationAddress),
|
||||
residenceAddress: _emptyToNull(legal?.residenceAddress),
|
||||
citizenship: _emptyToNull(legal?.citizenship) ?? 'RU',
|
||||
citizenship: _emptyToNull(legal?.citizenship),
|
||||
taxResidentUs: legal?.taxResidentUs ?? false,
|
||||
foreignTaxResident: legal?.foreignTaxResident ?? false,
|
||||
sbpPhone: _emptyToNull(legal?.sbpPhone),
|
||||
@@ -149,7 +149,7 @@ class RegisterConsultantCubit extends Cubit<RegisterConsultantState> {
|
||||
error: null,
|
||||
consultant: state.consultant.copyWith(
|
||||
legalType: individualPersonLegalType,
|
||||
citizenship: state.consultant.citizenship ?? 'RU',
|
||||
citizenship: state.consultant.citizenship,
|
||||
taxResidentUs: state.consultant.taxResidentUs ?? false,
|
||||
foreignTaxResident: state.consultant.foreignTaxResident ?? false,
|
||||
),
|
||||
@@ -198,7 +198,7 @@ class RegisterConsultantCubit extends Cubit<RegisterConsultantState> {
|
||||
ConsultantProfileModel buildSubmitPayload() {
|
||||
final withLegalType = state.consultant.copyWith(
|
||||
legalType: individualPersonLegalType,
|
||||
citizenship: state.consultant.citizenship ?? 'RU',
|
||||
citizenship: state.consultant.citizenship,
|
||||
taxResidentUs: state.consultant.taxResidentUs ?? false,
|
||||
foreignTaxResident: state.consultant.foreignTaxResident ?? false,
|
||||
certificates: state.consultant.certificates
|
||||
|
||||
@@ -48,6 +48,35 @@ class _LastStepScreenState extends State<LastStepScreen> {
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text('Последний шаг', style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, height: 1.1)),
|
||||
),
|
||||
if (state.requestModel?.canceledModeration != null) ...[
|
||||
const SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0x33FFCC00),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
state.requestModel!.canceledModeration!.title,
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600, height: 1.2),
|
||||
),
|
||||
if (state.requestModel!.canceledModeration!.additional != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
for (final item in state.requestModel!.canceledModeration!.additional!) ...[
|
||||
Text('• $item', style: const TextStyle(fontSize: 14, height: 1.3)),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 16),
|
||||
CheckboxListTile(
|
||||
value: state.acceptOffer,
|
||||
|
||||
@@ -101,7 +101,7 @@ class _PassportDataScreenState extends State<PassportDataScreen> {
|
||||
text: consultant.birthPlace ?? '',
|
||||
);
|
||||
citizenshipController = TextEditingController(
|
||||
text: consultant.citizenship ?? 'RU',
|
||||
text: consultant.citizenship,
|
||||
);
|
||||
registrationAddressController = TextEditingController(
|
||||
text: consultant.registrationAddress ?? '',
|
||||
|
||||
@@ -123,20 +123,23 @@ class _StepperBecomeConsultantScreenState extends State<StepperBecomeConsultantS
|
||||
label: Icon(Icons.arrow_back_ios_new_rounded, color: appTheme.blueA400),
|
||||
),
|
||||
),
|
||||
if (widget.isCanceled == true)
|
||||
if (widget.isCanceled == true && step != totalSteps)
|
||||
InkWell(
|
||||
onTap: () {
|
||||
final canceledModeration = state.requestModel?.canceledModeration;
|
||||
if (canceledModeration == null) return;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(state.requestModel!.canceledModeration!.title),
|
||||
title: Text(canceledModeration.title),
|
||||
content: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (int i = 0; i < state.requestModel!.canceledModeration!.additional!.length; i++) ...[
|
||||
Text('• ${state.requestModel!.canceledModeration!.additional![i]}'),
|
||||
],
|
||||
if (canceledModeration.additional != null)
|
||||
for (final item in canceledModeration.additional!) ...[
|
||||
Text('• $item'),
|
||||
],
|
||||
],
|
||||
),
|
||||
actions: [TextButton(onPressed: () => Navigator.pop(context), child: const Text('OK'))],
|
||||
@@ -158,7 +161,7 @@ class _StepperBecomeConsultantScreenState extends State<StepperBecomeConsultantS
|
||||
),
|
||||
Container(
|
||||
height: 48,
|
||||
width: widget.isCanceled == true
|
||||
width: widget.isCanceled == true && step != totalSteps
|
||||
? MediaQuery.of(context).size.width * 0.2
|
||||
: MediaQuery.of(context).size.width * 0.8,
|
||||
padding: const EdgeInsets.only(left: 4, right: 16),
|
||||
@@ -170,16 +173,13 @@ class _StepperBecomeConsultantScreenState extends State<StepperBecomeConsultantS
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||
backgroundColor: isLoading
|
||||
? Colors.grey
|
||||
: widget.isCanceled == true
|
||||
: widget.isCanceled == true && step != totalSteps
|
||||
? const Color(0xFFEAF2FD)
|
||||
: appTheme.blueA400,
|
||||
onPressed: isLoading
|
||||
? null
|
||||
: () async {
|
||||
if (step == totalSteps) {
|
||||
if (widget.isCanceled == true) {
|
||||
return;
|
||||
}
|
||||
if (!state.consultant.hasValidPassportData) {
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -301,9 +301,12 @@ class _StepperBecomeConsultantScreenState extends State<StepperBecomeConsultantS
|
||||
},
|
||||
label: isLoading
|
||||
? const CircularProgressIndicator()
|
||||
: widget.isCanceled == true
|
||||
: widget.isCanceled == true && step != totalSteps
|
||||
? Icon(Icons.arrow_forward_ios_outlined, color: appTheme.blueA400)
|
||||
: Text('Продолжить', style: theme.textTheme.titleSmall!.copyWith(color: Colors.white)),
|
||||
: Text(
|
||||
step == totalSteps ? 'Отправить' : 'Продолжить',
|
||||
style: theme.textTheme.titleSmall!.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user