From df290fa89b09a2d568357ff48e600cbe57dae16f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 14 Oct 2024 16:23:43 +0300 Subject: [PATCH] =?UTF-8?q?feature(consultant):=20=D0=9D=D0=B5=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=BF=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D1=82=D0=BE=D1=87=D0=BA=D1=83?= =?UTF-8?q?=20=D0=B2=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=B5=20=D1=81=D0=B0?= =?UTF-8?q?=D0=B9=D1=82=D0=B0=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BB=D0=BE=D1=82=D0=B8=20=D0=B0=D0=BD=D0=B8=D0=BC?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8E=20=D0=BD=D0=B0=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0=D0=BB=D0=BA=D1=83=20=D0=B7=D0=B0=D0=B2=D0=B5=D1=80=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=D0=A3=D0=B1=D1=80=D0=B0=D1=82=D1=8C?= =?UTF-8?q?=20=D1=84=D0=BE=D0=BA=D1=83=D1=81=20=D0=BD=D0=B0=204=20=D1=88?= =?UTF-8?q?=D0=B0=D0=B3=D0=B5=20(=D1=81=D0=BE=D1=86=D1=81=D0=B5=D1=82?= =?UTF-8?q?=D0=B8)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D1=81=D1=82=20=D0=BD=D0=B0=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B2=D1=8B=D0=B9=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=D0=B2=D1=8B=D1=85=D0=BE=D0=B4=20=D1=81=20=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BB=D0=B5=D0=B4=D0=BD=D0=B5=D0=B3=D0=BE=20=D1=8D=D0=BA=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=D1=80=D0=B0=D0=B4=D0=B8=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D1=82=D1=82=D0=BE=D0=BD=20=D0=BD=D0=B0=205=20=D1=88=D0=B0?= =?UTF-8?q?=D0=B3=D0=B5=20=D0=B2=20=D1=81=D0=B8=D0=BD=D0=B8=D0=B9=20=D1=86?= =?UTF-8?q?=D0=B2=D0=B5=D1=82=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=D0=BE=D0=BF=D1=82=D0=B8=D0=BC=D0=B8=D0=B7?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B7=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=83=D0=B7=D0=BA=D1=83=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=D0=94=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B3=D0=B0=D0=BB=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D1=8E=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=D0=9B=D0=BE=D0=B0=D0=B4=D0=B8=D0=BD=D0=B3=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B5=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/lottie_animations/success.json | 1 + .../presentation/pages/photo_view_screen.dart | 14 +- .../pages/become_consultant_screen.dart | 7 +- .../pages/photo_or_scans_screen.dart | 105 +++++---- .../pages/registration_as_screen.dart | 2 + .../pages/social_networks_screen.dart | 6 +- .../stepper_become_consultant_screen.dart | 220 ++++++++++-------- pubspec.yaml | 2 + 8 files changed, 208 insertions(+), 149 deletions(-) create mode 100644 assets/lottie_animations/success.json diff --git a/assets/lottie_animations/success.json b/assets/lottie_animations/success.json new file mode 100644 index 00000000..7758fd87 --- /dev/null +++ b/assets/lottie_animations/success.json @@ -0,0 +1 @@ +{"v":"5.5.9","fr":24,"ip":0,"op":60,"w":800,"h":800,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[415,382,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-22,1],[0,0]],"o":[[0,0],[22,-1],[0,0]],"v":[[-134,56],[-74,108],[72,-56]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":55,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[85.449,85.449],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.853],"y":[1]},"o":{"x":[0.463],"y":[0]},"t":22,"s":[0]},{"t":36,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":5,"s":[0]},{"t":22,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":384,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[394,396,0],"ix":2},"a":{"a":0,"k":[-54.531,27.469,0],"ix":1},"s":{"a":0,"k":[152.399,152.399,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[262.938,262.938],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.6470588235294118,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-54.531,27.469],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.041],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":4,"s":[0]},{"i":{"x":[0.041],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":15,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.959],"y":[0]},"t":31,"s":[100]},{"t":42,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.093],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.093],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":12,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.907],"y":[0]},"t":27,"s":[100]},{"t":39,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":384,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[394,396,0],"ix":2},"a":{"a":0,"k":[-54.531,27.469,0],"ix":1},"s":{"a":0,"k":[170.654,170.654,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[262.938,262.938],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.9607843137254902,0.6509803921568628,0.13725490196078433,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-54.531,27.469],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":6,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":20,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0]},"t":33,"s":[100]},{"t":47,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":2,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":17,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0]},"t":29,"s":[100]},{"t":44,"s":[0]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":12,"s":[360]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0]},"t":27,"s":[360]},{"t":39,"s":[0]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":384,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[394,396,0],"ix":2},"a":{"a":0,"k":[-54.531,27.469,0],"ix":1},"s":{"a":0,"k":[191.952,191.952,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[262.938,262.938],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.6470588235294118,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-54.531,27.469],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":24,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0]},"t":36,"s":[100]},{"t":50,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":6,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":21,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0]},"t":32,"s":[100]},{"t":47,"s":[0]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":4,"s":[0]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":16,"s":[360]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[1],"y":[0]},"t":30,"s":[360]},{"t":42,"s":[0]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":384,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[394,396,0],"ix":2},"a":{"a":0,"k":[-54.531,27.469,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0,0,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"i":{"x":[0,0,0.667],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":16,"s":[141.835,141.835,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[1,1,0.333],"y":[0,0,0]},"t":27,"s":[141.835,141.835,100]},{"t":43,"s":[0,0,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[262.938,262.938],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.6470588235294118,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-54.531,27.469],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":384,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/lib/features/chat/presentation/pages/photo_view_screen.dart b/lib/features/chat/presentation/pages/photo_view_screen.dart index 4bc71ee9..b7fce0c5 100644 --- a/lib/features/chat/presentation/pages/photo_view_screen.dart +++ b/lib/features/chat/presentation/pages/photo_view_screen.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:dismissible_page/dismissible_page.dart'; import 'package:eatvio_app/core/const.dart'; @@ -11,11 +13,13 @@ import 'package:url_launcher/url_launcher.dart'; class PhotoViewScreen extends StatefulWidget { final List imageUrls; final int index; + final bool isLocal; const PhotoViewScreen({ super.key, required this.imageUrls, required this.index, + this.isLocal = false, }); @override @@ -47,9 +51,13 @@ class _PhotoViewScreenState extends State { scrollPhysics: const BouncingScrollPhysics(), builder: (BuildContext context, int index) { return PhotoViewGalleryPageOptions( - imageProvider: CachedNetworkImageProvider( - widget.imageUrls[index], - ), + imageProvider: widget.isLocal + ? FileImage( + File(widget.imageUrls[index]), + ) as ImageProvider + : CachedNetworkImageProvider( + widget.imageUrls[index], + ), initialScale: PhotoViewComputedScale.contained, minScale: PhotoViewComputedScale.contained, heroAttributes: PhotoViewHeroAttributes( diff --git a/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart index bf7ec475..c2807492 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart @@ -24,7 +24,12 @@ class _BecomeConsultantScreenState extends State { ), body: Padding( padding: const EdgeInsets.all(16), - child: Text('Для регистрации потребуется следующий список документов, подготовьте их заранее'), + child: Text( + ' Чтобы стать консультантом необходимо пройти короткую регистрацию. Подготовьте свои дипломы и/или сертификаты в формате jpg, они Вам пригодятся для проверки и подтверждения. Также необходимо будет указать ссылки на Ваши соц. сети и указать тип лица (физ. лицо или юр. лицо). На данный момент доступна регистрация в качестве физ. лица.\n\n Внутри Итвио разница между обычным пользователем и консультантом заключается в дополнительных возможностях последнего создавать публичные диеты, рецепты и планы питания; участвовать в ежемесячных рейтингах.', + style: TextStyle( + fontSize: 16, + ), + ), ), bottomSheet: _startRegistrationButton(), ); diff --git a/lib/features/consultant/become_consultant/presentation/pages/photo_or_scans_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/photo_or_scans_screen.dart index 51684b88..eae359c2 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/photo_or_scans_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/photo_or_scans_screen.dart @@ -1,5 +1,7 @@ import 'dart:io'; +import 'package:dismissible_page/dismissible_page.dart'; +import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:eatvio_app/features/consultant/become_consultant/presentation/bloc/register_consultant_cubit/register_consultant_cubit.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; @@ -75,51 +77,66 @@ class _PhotoOrScansScreenState extends State { ), ); } else { - return InkWell( - onTap: () {}, - borderRadius: BorderRadius.circular(20), - child: Stack( - clipBehavior: Clip.none, - children: [ - Ink( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(20), + return Hero( + tag: imagesPaths[index], + child: Material( + borderRadius: BorderRadius.circular(20), + child: InkWell( + onTap: () { + context.pushTransparentRoute( + rootNavigator: true, + PhotoViewScreen( + imageUrls: imagesPaths, + isLocal: true, + index: index, ), - image: DecorationImage( - fit: BoxFit.fitHeight, - image: FileImage( - File(imagesPaths[index]), - ), - ), - ), - ), - Positioned( - right: -12, - top: -12, - child: InkWell( - onTap: () { - setState(() { - imagesPaths.removeAt(index); - }); - _saveState(); - }, - customBorder: CircleBorder(), - child: Ink( - padding: EdgeInsets.all(4), + ); + }, + borderRadius: BorderRadius.circular(20), + child: Stack( + clipBehavior: Clip.none, + children: [ + Ink( decoration: BoxDecoration( - color: Color(0xFFF1F2F6), - shape: BoxShape.circle, - ), - child: Icon( - size: 20, - Icons.close, - color: Colors.black, + borderRadius: BorderRadius.all( + Radius.circular(20), + ), + image: DecorationImage( + fit: BoxFit.fitHeight, + image: FileImage( + File(imagesPaths[index]), + ), + ), ), ), - ), + Positioned( + right: -12, + top: -12, + child: InkWell( + onTap: () { + setState(() { + imagesPaths.removeAt(index); + }); + _saveState(); + }, + customBorder: CircleBorder(), + child: Ink( + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: Color(0xFFF1F2F6), + shape: BoxShape.circle, + ), + child: Icon( + size: 20, + Icons.close, + color: Colors.black, + ), + ), + ), + ), + ], ), - ], + ), ), ); } @@ -133,9 +150,9 @@ class _PhotoOrScansScreenState extends State { _saveState() { context.read().updateConsultantProfileModel( - context.read().state.consultant.copyWith( - photos: imagesPaths, - ), - ); + context.read().state.consultant.copyWith( + photos: imagesPaths, + ), + ); } } diff --git a/lib/features/consultant/become_consultant/presentation/pages/registration_as_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/registration_as_screen.dart index 9f6ee8e3..764f1653 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/registration_as_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/registration_as_screen.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/material.dart'; class RegistrationAsScreen extends StatefulWidget { @@ -42,6 +43,7 @@ class _RegistrationAsScreenState extends State { height: 1, ), ), + activeColor: appTheme.blueA400, onChanged: (value) {}, contentPadding: EdgeInsets.symmetric(horizontal: 8), ), diff --git a/lib/features/consultant/become_consultant/presentation/pages/social_networks_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/social_networks_screen.dart index 52e45d84..fb62e42d 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/social_networks_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/social_networks_screen.dart @@ -20,21 +20,21 @@ class _SocialNetworksScreenState extends State { var maskFormatter = new MaskTextInputFormatter( mask: 'https://########################################', filter: { - '#': RegExp(r"(\w+)"), + '#': RegExp(r"[a-zA-Z. ]+"), }, type: MaskAutoCompletionType.lazy, ); var maskTgFormatter = new MaskTextInputFormatter( mask: 'https://tg.me/########################################', filter: { - '#': RegExp(r"(\w+)"), + '#': RegExp(r"[a-zA-Z. ]+"), }, type: MaskAutoCompletionType.lazy, ); var maskVkFormatter = new MaskTextInputFormatter( mask: 'https://vk.com/########################################', filter: { - '#': RegExp(r"(\w+)"), + '#': RegExp(r"[a-zA-Z. ]+"), }, type: MaskAutoCompletionType.lazy, ); diff --git a/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart b/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart index 7bc05885..3d970a01 100644 --- a/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart +++ b/lib/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart @@ -12,6 +12,7 @@ import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:lottie/lottie.dart'; class StepperBecomeConsultantScreen extends StatefulWidget { const StepperBecomeConsultantScreen({super.key}); @@ -25,6 +26,7 @@ class _StepperBecomeConsultantScreenState extends State(); + bool isLoading = false; @override Widget build(BuildContext context) { @@ -73,108 +75,130 @@ class _StepperBecomeConsultantScreenState extends State Container( - padding: EdgeInsets.all(16), - width: MediaQuery.of(context).size.width, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - 'Спасибо!\nВаши данные отправлены на модерацию', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 20, - height: 1, - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(height: 16), - Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: appTheme.blueA400, - shape: BoxShape.circle, - ), - child: Icon( - size: 32, - Icons.done, - color: Colors.white, - ), - ), - const SizedBox(height: 16), - Text( - 'В течении трех рабочих дней Вам придет уведомление о смене статуса', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 16, - height: 1, - fontWeight: FontWeight.w500, - ), - ), - const SizedBox(height: 16), - InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: Ink( - width: MediaQuery.of(context).size.width - 32, - height: 52, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - color: appTheme.blueA400, - ), - child: Center( - child: Text( - 'Закрыть', - style: TextStyle( - color: Colors.white, - fontSize: 18, - fontWeight: FontWeight.w600, + backgroundColor: isLoading ? Colors.grey : appTheme.blueA400, + onPressed: isLoading + ? null + : () async { + if (step == 6) { + if (registrationConsultantCubit.state.acceptOffer) { + setState(() { + isLoading = true; + }); + try { + await registrationConsultantCubit.registerConsultant(); + await showModalBottomSheet( + useRootNavigator: true, + showDragHandle: true, + context: context, + builder: (context) => Container( + padding: EdgeInsets.all(16), + width: MediaQuery.of(context).size.width, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Спасибо!\nВаши данные отправлены на модерацию', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20, + height: 1, + fontWeight: FontWeight.w600, + ), ), - ), + const SizedBox(height: 16), + Lottie.asset( + 'assets/lottie_animations/success.json', + width: 160, + height: 160, + ), + const SizedBox(height: 16), + Text( + 'В течении трех рабочих дней Вам придет уведомление о смене статуса', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16, + height: 1, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(height: 16), + InkWell( + onTap: () { + Navigator.of(context).pop(); + GoRouter.of(context).pop(); + }, + child: Ink( + width: MediaQuery.of(context).size.width - 32, + height: 52, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Закрыть', + style: TextStyle( + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ), + ], ), ), + ); + } catch (e) { + showDialog( + context: context, + builder: (context) => AlertDialog( + actionsPadding: const EdgeInsets.symmetric(horizontal: 4), + content: Text(e.toString()), + actions: [ + TextButton( + child: const Text('Ок'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ), + ); + } finally { + setState(() { + isLoading = false; + }); + } + } else { + showDialog( + context: context, + builder: (context) => AlertDialog( + actionsPadding: const EdgeInsets.symmetric(horizontal: 4), + content: Text('Примите договор публичной офёрты'), + actions: [ + TextButton( + child: const Text('Ок'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], ), - ], - ), - ), - ); - } else { - showDialog( - context: context, - builder: (context) => AlertDialog( - actionsPadding: const EdgeInsets.symmetric(horizontal: 4), - content: Text('Примите договор публичной офёрты'), - actions: [ - TextButton( - child: const Text('Ок'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ), - ); - } - } else { - setState(() { - pageController.nextPage( - duration: const Duration(milliseconds: 350), - curve: Curves.easeInOut, - ); - }); - } - }, - label: Text( + ); + } + } else { + FocusManager.instance.primaryFocus?.unfocus(); + setState(() { + pageController.nextPage( + duration: const Duration(milliseconds: 350), + curve: Curves.easeInOut, + ); + }); + } + }, + label: isLoading ? CircularProgressIndicator() : Text( 'Продолжить', style: theme.textTheme.titleSmall!.copyWith(color: Colors.white), ), diff --git a/pubspec.yaml b/pubspec.yaml index d87c49e8..9383ed5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,6 +49,7 @@ dependencies: intl: ^0.19.0 rive: ^0.13.14 mask_text_input_formatter: ^2.9.0 + lottie: ^3.1.3 dev_dependencies: build_runner: ^2.4.13 @@ -67,6 +68,7 @@ flutter: - assets/audio/ - assets/icons/ - assets/rive_animations/ + - assets/lottie_animations/ flutter_intl: enabled: true