From 03448ebd2d5e205b0fde4aa644d1ba0b4f0daab2 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 6 Oct 2025 17:27:11 +0300 Subject: [PATCH] feat(oauth): Issue-691 --- lib/core/routing/auth_routes.dart | 2 + lib/core/routing/route_constants.dart | 1 + .../pages/register_via_social_screen.dart | 100 ++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 lib/features/auth/presentation/pages/register_via_social_screen.dart diff --git a/lib/core/routing/auth_routes.dart b/lib/core/routing/auth_routes.dart index fc4558d1..67ecbca6 100644 --- a/lib/core/routing/auth_routes.dart +++ b/lib/core/routing/auth_routes.dart @@ -1,6 +1,7 @@ import 'package:eatvio_app/core/routing/route_constants.dart'; import 'package:eatvio_app/features/auth/presentation/pages/auth_screen.dart'; import 'package:eatvio_app/features/auth/presentation/pages/forget_password_screen.dart'; +import 'package:eatvio_app/features/auth/presentation/pages/register_via_social_screen.dart'; import 'package:eatvio_app/features/auth/presentation/pages/scan_qr_code_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart'; import 'package:eatvio_app/features/registration/presentation/pages/verify_screen.dart'; @@ -32,6 +33,7 @@ class AuthRoutes { builder: (context, state) => VerifyScreen(passKey: state.extra as String), ), GoRoute(path: RouteConstants.verifyEmailScreen, name: 'verifyEmailScreen', builder: (context, state) => const VerifyEmailScreen()), + GoRoute(path: RouteConstants.registerViaSocialScreen, name: 'registerViaSocialScreen', builder: (context, state) => const RegisterViaSocialScreen()), ]; } } diff --git a/lib/core/routing/route_constants.dart b/lib/core/routing/route_constants.dart index dcc82c17..1702b425 100644 --- a/lib/core/routing/route_constants.dart +++ b/lib/core/routing/route_constants.dart @@ -7,6 +7,7 @@ class RouteConstants { static const String scanQRCodeScreen = 'scan-qr-code-screen'; static const String verifyScreen = '/verify-screen'; static const String verifyEmailScreen = '/verify-email-screen'; + static const String registerViaSocialScreen = '/register-via-social-screen'; // Main navigation routes static const String myProfileScreen = '/my-profile-screen'; diff --git a/lib/features/auth/presentation/pages/register_via_social_screen.dart b/lib/features/auth/presentation/pages/register_via_social_screen.dart new file mode 100644 index 00000000..24c4fc46 --- /dev/null +++ b/lib/features/auth/presentation/pages/register_via_social_screen.dart @@ -0,0 +1,100 @@ +import 'package:eatvio_app/core/widgets/custom_text_form_field.dart'; +import 'package:flutter/material.dart'; +import 'package:mask_text_input_formatter/mask_text_input_formatter.dart'; + +class RegisterViaSocialScreen extends StatefulWidget { + const RegisterViaSocialScreen({super.key}); + + @override + State createState() => _RegisterViaSocialScreenState(); +} + +class _RegisterViaSocialScreenState extends State { + final maskFormatter = MaskTextInputFormatter(mask: '+7 (###) ### ## ##', filter: {"#": RegExp(r'[0-9]')}); + final maskFormatterForBirthday = MaskTextInputFormatter(mask: '##.##.####', filter: {"#": RegExp(r'[0-9]')}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(toolbarHeight: 0), + body: SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 24), + const Center( + child: Text( + 'Регистрация', + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, height: 1.1, color: Color(0xFF323F4B)), + ), + ), + const SizedBox(height: 24), + Row( + children: [ + SizedBox( + width: MediaQuery.of(context).size.width / 2 - 22, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Text('Имя'), + const SizedBox(height: 4), + CustomTextFormField(controller: TextEditingController(), hintText: 'Введите имя', onChanged: (newValue) {}), + ], + ), + ), + const SizedBox(width: 12), + SizedBox( + width: MediaQuery.of(context).size.width / 2 - 22, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('Фамилия'), + const SizedBox(height: 4), + CustomTextFormField(controller: TextEditingController(), hintText: 'Введите фамилию', onChanged: (newValue) {}), + ], + ), + ), + ], + ), + const SizedBox(height: 12), + const Text('Почта'), + const SizedBox(height: 4), + CustomTextFormField( + controller: TextEditingController(), + textInputType: TextInputType.emailAddress, + keyboardType: TextInputType.emailAddress, + hintText: 'Введите email', + autofocus: true, + textInputAction: TextInputAction.next, + onChanged: (newValue) {}, + ), + const SizedBox(height: 12), + const Text('Номер телефона'), + const SizedBox(height: 4), + CustomTextFormField( + textInputAction: TextInputAction.done, + hintText: '+7 (999) 999 99 99', + controller: TextEditingController(), + keyboardType: TextInputType.number, + inputFormatters: [maskFormatter], + onChanged: (newValue) {}, + ), + const SizedBox(height: 12), + const Text('Дата рождения'), + const SizedBox(height: 4), + CustomTextFormField( + textInputAction: TextInputAction.done, + hintText: '01.01.2000', + controller: TextEditingController(), + keyboardType: TextInputType.number, + inputFormatters: [maskFormatterForBirthday], + onChanged: (newValue) {}, + ), + ], + ), + ), + ); + } +}