Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Username1548
2025-03-10 22:25:36 +07:00
23 changed files with 294 additions and 204 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -2,27 +2,27 @@ C/C++ Structured Loga
_
]/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ‰ÚÙ²Ö2  ‹°™²Ö2^
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Úðèû×2  ‹°™²Ö2^
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/android_gradle_build.json  <EFBFBD>ÚÙ²Ö2¥ ‘°™²Ö2c
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/android_gradle_build.json  Úðèû×2¥ ‘°™²Ö2c
a
_/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/android_gradle_build_mini.json  <EFBFBD>ÚÙ²Ö2² –°™²Ö2P
_/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/android_gradle_build_mini.json  Úðèû×2² –°™²Ö2P
N
L/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/build.ninja  <EFBFBD>ÚÙ²Ö2ŠÃ 쯙²Ö2T
L/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/build.ninja  Úðèû×2ŠÃ 쯙²Ö2T
R
P/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/build.ninja.txt  <EFBFBD>ÚÙ²Ö2Y
P/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/build.ninja.txt  Úðèû×2Y
W
U/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/build_file_index.txt  <EFBFBD>ÚÙ²Ö2
U/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/build_file_index.txt  Úðèû×2
P —°™²Ö2Z
X
X
V/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/compile_commands.json  Úðèû×2^
\
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/compile_commands.json.bin  Úðèû×2 d
b
b
`/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/metadata_generation_command.txt  Úðèû×2
ÿ —°™²Ö2W
U
U
S/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/prefab_config.json  Úðèû×2
 ( —°™²Ö2\
 ( —°™²Ö2\
Z
X/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/symbol_folder_index.txt  <EFBFBD>ÚÙ²Ö2
X/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/arm64-v8a/symbol_folder_index.txt  Úðèû×2

View File

@@ -2,27 +2,27 @@ C/C++ Structured Logc
a
_/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ¦ÚÙ²Ö2  àòš²Ö2`
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  íðèû×2  àòš²Ö2`
^
\/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/android_gradle_build.json  ¦ÚÙ²Ö2© âòš²Ö2e
\/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/android_gradle_build.json  íðèû×2© âòš²Ö2e
c
a/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/android_gradle_build_mini.json  ¦ÚÙ²Ö2 ãòš²Ö2R
a/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/android_gradle_build_mini.json  íðèû×2 ãòš²Ö2R
P
N/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/build.ninja  ¦ÚÙ²Ö2–Ã Âòš²Ö2V
N/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/build.ninja  íðèû×2–Ã Âòš²Ö2V
T
R/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/build.ninja.txt  ¦ÚÙ²Ö2[
R/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/build.ninja.txt  íðèû×2[
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/build_file_index.txt  ¦ÚÙ²Ö2
W/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/build_file_index.txt  íðèû×2
P ãòš²Ö2\
Z
Z
X/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/compile_commands.json  íðèû×2`
^
^
\/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/compile_commands.json.bin  íðèû×2 f
d
d
b/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/metadata_generation_command.txt  íðèû×2
‰ ãòš²Ö2Y
W
W
U/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/prefab_config.json  íðèû×2
 ( ãòš²Ö2^
 ( ãòš²Ö2^
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/symbol_folder_index.txt  ¦ÚÙ²Ö2
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/armeabi-v7a/symbol_folder_index.txt  íðèû×2

View File

@@ -2,27 +2,27 @@ C/C++ Structured Log[
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ®ÚÙ²Ö2  <20>÷š²Ö2X
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ôðèû×2  <20>÷š²Ö2X
V
T/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/android_gradle_build.json  ®ÚÙ²Ö2™ <20>÷š²Ö2]
T/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/android_gradle_build.json  ôðèû×2™ <20>÷š²Ö2]
[
Y/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/android_gradle_build_mini.json  ®ÚÙ²Ö2¦ ‘÷š²Ö2J
Y/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/android_gradle_build_mini.json  ôðèû×2¦ ‘÷š²Ö2J
H
F/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/build.ninja  ®ÚÙ²Ö2æÂ †÷š²Ö2N
F/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/build.ninja  ôðèû×2æÂ †÷š²Ö2N
L
J/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/build.ninja.txt  ®ÚÙ²Ö2S
J/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/build.ninja.txt  ôðèû×2S
Q
O/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/build_file_index.txt  ®ÚÙ²Ö2
O/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/build_file_index.txt  ôðèû×2
P ‘÷š²Ö2T
R
R
P/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/compile_commands.json  ôðèû×2X
V
V
T/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/compile_commands.json.bin  ôðèû×2 ^
\
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/metadata_generation_command.txt  ôðèû×2
á ‘÷š²Ö2Q
O
O
M/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/prefab_config.json  ôðèû×2
 ( ‘÷š²Ö2V
 ( ‘÷š²Ö2V
T
R/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/symbol_folder_index.txt  ®ÚÙ²Ö2
R/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86/symbol_folder_index.txt  ôðèû×2

View File

@@ -2,27 +2,27 @@ C/C++ Structured Log^
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ÀÚÙ²Ö2  Üúš²Ö2[
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  úðèû×2  Üúš²Ö2[
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/android_gradle_build.json  ÁÚÙ²Ö2Ÿ Þúš²Ö2`
W/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/android_gradle_build.json  úðèû×2Ÿ Þúš²Ö2`
^
\/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/android_gradle_build_mini.json  ÁÚÙ²Ö2¬ Þúš²Ö2M
\/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/android_gradle_build_mini.json  úðèû×2¬ Þúš²Ö2M
K
I/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/build.ninja  ÁÚÙ²Ö2øÂ Ðúš²Ö2Q
I/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/build.ninja  úðèû×2øÂ Ðúš²Ö2Q
O
M/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/build.ninja.txt  ÁÚÙ²Ö2V
M/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/build.ninja.txt  úðèû×2V
T
R/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/build_file_index.txt  ÁÚÙ²Ö2
R/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/build_file_index.txt  úðèû×2
P ßúš²Ö2W
U
U
S/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/compile_commands.json  úðèû×2[
Y
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/compile_commands.json.bin  úðèû×2 a
_
_
]/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/metadata_generation_command.txt  úðèû×2
ð ßúš²Ö2T
R
R
P/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/prefab_config.json  úðèû×2
 ( ßúš²Ö2Y
 ( ßúš²Ö2Y
W
U/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/symbol_folder_index.txt  ÁÚÙ²Ö2
U/Users/alex/eatvio_app/android/app/.cxx/Debug/5g696y4j/x86_64/symbol_folder_index.txt  úðèû×2

BIN
assets/.DS_Store vendored

Binary file not shown.

BIN
assets/images/no_avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -365,7 +365,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -383,7 +383,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.45;
MARKETING_VERSION = 1.0.46;
PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -514,7 +514,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -532,7 +532,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.45;
MARKETING_VERSION = 1.0.46;
PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -551,7 +551,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 45;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -569,7 +569,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.45;
MARKETING_VERSION = 1.0.46;
PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -65,7 +65,7 @@ class AppRouter {
routes: [
GoRoute(
path: '/auth-screen',
name: 'authScreen',
name: 'authScreen',
builder: (context, state) => const AuthScreen(),
routes: [
GoRoute(

View File

@@ -167,7 +167,7 @@ Future<void> init() async {
sl.registerLazySingleton(
() => Dio(
BaseOptions(
baseUrl: baseUrl,
baseUrl: baseUrl,
headers: {
'accept': 'application/json',
'content-type': 'application/json',

View File

@@ -1,12 +1,11 @@
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
abstract class TokenStorage {
static Future<bool> haveTokenInStorage() async {
try {
if (await FlutterSecureStorage().read(key: 'token') == null) {
return false;
} else {
} else {
return true;
}
} catch (e) {
@@ -17,7 +16,7 @@ abstract class TokenStorage {
static Future<String?> getTokenFromStorage() async => await FlutterSecureStorage().read(key: 'token');
static saveTokenInStorage(String token) async {
await FlutterSecureStorage().write(key: 'token', value: token);
await FlutterSecureStorage().write(key: 'token', value: token);
}
static Future<void> removeTokenInStorage() async => (await FlutterSecureStorage().delete(key: 'token'));

View File

@@ -1,4 +1,5 @@
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
const int _toastDuration = 2;
@@ -19,10 +20,10 @@ void showErrorToast(String message) {
Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.TOP,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: _toastDuration,
backgroundColor: appTheme.whiteA700,
textColor: appTheme.gray,
backgroundColor: appTheme.red,
textColor: Colors.white,
fontSize: 16.0,
);
}
@@ -31,7 +32,7 @@ void showSuccessToast(String message) {
Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.TOP,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: _toastDuration,
backgroundColor: appTheme.greenA70001,
textColor: appTheme.whiteA700,

View File

@@ -1,6 +1,7 @@
import 'package:eatvio_app/core/app_router.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/core/token_storage.dart';
import 'package:eatvio_app/core/utils/toasts.dart';
import 'package:eatvio_app/features/auth/presentation/bloc/auth_state.dart';
import 'package:eatvio_app/features/auth/repositories/auth_repository.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
@@ -28,11 +29,13 @@ class AuthCubit extends Cubit<AuthState> {
token: token,
),
);
showSuccessToast('Успешный вход');
await TokenStorage.saveTokenInStorage(token);
await sl<ProfileAvatarCubit>().getMyProfile();
AppRouter.navigatorKey.currentContext?.go('/my-profile-screen');
} catch (e) {
print(e);
showErrorToast('Неверный адрес электронной почты или пароль');
emit(AuthState.error(errorMessage: '$e'));
}
}

View File

@@ -5,6 +5,7 @@ import 'package:eatvio_app/core/utils/image_constant.dart';
import 'package:eatvio_app/core/widgets/custom_text_form_field.dart';
import 'package:eatvio_app/features/auth/presentation/bloc/auth_cubit.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
@@ -12,6 +13,8 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:url_launcher/url_launcher.dart';
import '../bloc/auth_state.dart';
class AuthScreen extends StatefulWidget {
const AuthScreen();
@@ -32,120 +35,128 @@ class _AuthScreenState extends State<AuthScreen> {
FlutterNativeSplash.remove();
return BlocProvider<AuthCubit>(
create: (BuildContext context) => authCubit,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
title: SvgPicture.asset(
ImageConstant.imgLogoEatvio,
height: 48,
fit: BoxFit.contain,
),
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.email),
const SizedBox(height: 4),
CustomTextFormField(
controller: emailController,
textInputAction: TextInputAction.next,
keyboardType: TextInputType.emailAddress,
textInputType: TextInputType.emailAddress,
hintText: 'Введите email',
),
const SizedBox(height: 16),
Text(s.password),
const SizedBox(height: 4),
CustomTextFormField(
obscureText: hidePassword,
controller: passwordController,
hintText: 'Введите пароль',
suffix: IconButton(
onPressed: () {
setState(() {
hidePassword = !hidePassword;
});
},
icon: Icon(
hidePassword ? Icons.visibility_outlined : Icons.visibility_off_outlined,
color: Colors.grey,
),
),
),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Нет аккаунта? '),
GestureDetector(
onTap: () => GoRouter.of(context).goNamed('webViewRegistrationScreen'),
child: Text(
'Зарегистрироваться',
style: TextStyle(
color: appTheme.blueA400,
decorationColor: appTheme.blueA400,
decoration: TextDecoration.underline,
),
),
),
],
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Нажимая "Войти", Вы соглашаетесь с ',
style: TextStyle(
fontSize: 12,
),
),
GestureDetector(
onTap: () async {
await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf'));
},
child: Text(
'Публичной офертой',
style: TextStyle(
fontSize: 12,
color: appTheme.blueA400,
decorationColor: appTheme.blueA400,
decoration: TextDecoration.underline,
),
),
),
],
),
const SizedBox(height: 16),
Container(
height: 48,
width: MediaQuery.of(context).size.width - 32,
child: FloatingActionButton.extended(
heroTag: 'authButton',
highlightElevation: 0,
elevation: 0,
focusElevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
backgroundColor: appTheme.blueA400,
onPressed: () => authCubit.getTokenByCredentials(
emailController.text,
passwordController.text,
),
label: Text(
'Войти',
style: theme.textTheme.titleSmall!.copyWith(color: Colors.white),
),
),
),
],
child: BlocBuilder<AuthCubit, AuthState>(
builder: (BuildContext context, AuthState state) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: SvgPicture.asset(
ImageConstant.imgLogoEatvio,
height: 64,
fit: BoxFit.contain,
),
),
),
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(s.email),
const SizedBox(height: 4),
CustomTextFormField(
controller: emailController,
textInputAction: TextInputAction.next,
keyboardType: TextInputType.emailAddress,
textInputType: TextInputType.emailAddress,
hintText: 'Введите email',
),
const SizedBox(height: 16),
Text(s.password),
const SizedBox(height: 4),
CustomTextFormField(
obscureText: hidePassword,
controller: passwordController,
hintText: 'Введите пароль',
suffix: IconButton(
onPressed: () {
setState(() {
hidePassword = !hidePassword;
});
},
icon: Icon(
hidePassword ? Icons.visibility_outlined : Icons.visibility_off_outlined,
color: Colors.grey,
),
),
),
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Нет аккаунта? '),
GestureDetector(
onTap: () => GoRouter.of(context).goNamed('webViewRegistrationScreen'),
child: Text(
'Зарегистрироваться',
style: TextStyle(
color: appTheme.blueA400,
decorationColor: appTheme.blueA400,
decoration: TextDecoration.underline,
),
),
),
],
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Нажимая "Войти", Вы соглашаетесь с ',
style: TextStyle(
fontSize: 12,
),
),
GestureDetector(
onTap: () async {
await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf'));
},
child: Text(
'Публичной офертой',
style: TextStyle(
fontSize: 12,
color: appTheme.blueA400,
decorationColor: appTheme.blueA400,
decoration: TextDecoration.underline,
),
),
),
],
),
const SizedBox(height: 16),
Container(
height: 48,
width: MediaQuery.of(context).size.width - 32,
child: FloatingActionButton.extended(
heroTag: 'authButton',
highlightElevation: 0,
elevation: 0,
focusElevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
backgroundColor: state is AuthStateLoading ? Colors.black.withAlpha(50) : appTheme.blueA400,
onPressed: state is AuthStateLoading
? null
: () => authCubit.getTokenByCredentials(
emailController.text,
passwordController.text,
),
label: state is AuthStateLoading
? CupertinoActivityIndicator()
: Text(
'Войти',
style: theme.textTheme.titleSmall!.copyWith(color: Colors.white),
),
),
),
],
),
),
),
);
},
),
);
}

View File

@@ -72,7 +72,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
style: TextStyle(
height: 1,
color: appTheme.gray,
fontSize: 12,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
@@ -84,7 +84,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
style: TextStyle(
height: 1,
color: appTheme.black,
fontSize: 12,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
@@ -97,7 +97,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
style: TextStyle(
height: 1,
color: appTheme.gray,
fontSize: 12,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
@@ -112,8 +112,8 @@ class _CommentsWidgetState extends State<CommentsWidget> {
style: TextStyle(
height: 1,
color: appTheme.gray,
fontSize: 12,
fontWeight: FontWeight.w500,
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),

View File

@@ -102,7 +102,7 @@ class _PlanWidgetState extends State<PlanWidget> {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
widget.plan.name,
style: TextStyles.textMSemibold.copyWith(color: appTheme.black),
style: TextStyles.textMSemibold.copyWith(color: appTheme.black, fontSize: 18),
),
),
if (widget.plan.details.isNotEmpty) ...[
@@ -117,7 +117,7 @@ class _PlanWidgetState extends State<PlanWidget> {
"*": Style(
margin: Margins.zero,
color: appTheme.black,
fontSize: FontSize(TextStyles.textSMedium.fontSize ?? 14),
fontSize: FontSize(16),
fontWeight: TextStyles.textSMedium.fontWeight ?? FontWeight.w400,
),
},

View File

@@ -145,7 +145,7 @@ class NoInternetScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Text(
'Проверьте соединение с сетью и попробуйте ещё раз',
'Проверьте соединение с сетью\nи попробуйте ещё раз',
textAlign: TextAlign.center,
style: TextStyles.textMMedium.copyWith(
color: appTheme.gray,

View File

@@ -8,6 +8,7 @@ import 'package:eatvio_app/features/dev_tools/presentation/dev_tools_screen.dart
import 'package:eatvio_app/features/my_diets/presentation/my_diets_screen.dart';
import 'package:eatvio_app/features/my_plans/presentation/my_plans_screen.dart';
import 'package:eatvio_app/features/profile/models/profile_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
@@ -68,12 +69,12 @@ class MenuScreen extends StatelessWidget {
}
},
),
_divider(context),
_tile(
leading: 'assets/icons/calendar.svg',
title: 'Календарь',
onTap: () => GoRouter.of(context).push('/calendar-screen'),
),
// _divider(context),
// _tile(
// leading: 'assets/icons/calendar.svg',
// title: 'Календарь',
// onTap: () => GoRouter.of(context).push('/calendar-screen'),
// ),
_divider(context),
_tile(
leading: ImageConstant.icnGlossary,
@@ -141,15 +142,36 @@ class MenuScreen extends StatelessWidget {
_onTapLogout(BuildContext context) {
return () async {
try {
await sl<Dio>().post(
baseUrl + '/api/profile/logout',
);
} catch (e) {
} finally {
await TokenStorage.removeTokenInStorage();
GoRouter.of(context).go('/auth-screen', extra: true);
}
showDialog(
context: context,
builder: (context) => CupertinoAlertDialog(
title: Text("Выход"),
actions: [
CupertinoDialogAction(
onPressed: () async {
try {
await sl<Dio>().post(
baseUrl + '/api/profile/logout',
);
} catch (e) {
} finally {
await TokenStorage.removeTokenInStorage();
GoRouter.of(context).go('/auth-screen', extra: true);
}
},
child: Text("Выйти"),
isDestructiveAction: true,
),
CupertinoDialogAction(
onPressed: () {
Navigator.of(context).pop();
},
child: Text("Отмена"),
),
],
content: Text("Вы уверены что хотите выйти из аккаунта?"),
),
);
};
}
}

View File

@@ -931,7 +931,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
tag: state.profile.profilePhotoUrl,
child: CircleAvatar(
radius: 32,
backgroundImage: NetworkImage(state.profile.profilePhotoUrl),
foregroundImage: NetworkImage(state.profile.profilePhotoUrl),
backgroundImage: AssetImage('assets/images/no_avatar.png'),
),
),
),

View File

@@ -106,6 +106,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
state.blogPosts[widget.index].title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18,
color: Colors.black87,
),
),
@@ -120,6 +121,7 @@ class _ProfileBlogPostWidgetState extends State<ProfileBlogPostWidget> {
: state.blogPosts[widget.index].description,
style: {
"*": Style(
fontSize: FontSize(16),
color: Colors.black87,
),
},

View File

@@ -1,6 +1,9 @@
import 'dart:convert';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/features/auth/presentation/bloc/auth_cubit.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewRegistrationScreen extends StatefulWidget {
@@ -12,23 +15,71 @@ class WebViewRegistrationScreen extends StatefulWidget {
class _WebViewRegistrationScreenState extends State<WebViewRegistrationScreen> {
late final WebViewController _controller;
late final AuthCubit authCubit;
String? email;
String? password;
@override
void initState() {
super.initState();
authCubit = sl<AuthCubit>();
_controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..addJavaScriptChannel(
'flutter_inject',
onMessageReceived: (JavaScriptMessage message) {
final data = jsonDecode(message.message);
if (data['type'] == 'email') {
email = data['value'];
print("Email: $email");
} else if (data['type'] == 'password') {
password = data['value'];
print("Password: $password");
}
},
)
..setNavigationDelegate(
NavigationDelegate(
onNavigationRequest: (NavigationRequest request) {
if (request.url.contains('profile')) {
GoRouter.of(context).go('authScreen');
authCubit.getTokenByCredentials(
email!,
password!,
);
}
return NavigationDecision.navigate;
},
),
)
..loadRequest(Uri.parse(baseUrl + '/registration/step1'));
_injectJavaScript();
}
void _injectJavaScript() async {
await Future.delayed(Duration(seconds: 2));
_controller.runJavaScript('''
function sendMessageToFlutter(data) {
window.flutter_inject.postMessage(JSON.stringify(data));
}
function trackInputChanges() {
let emailField = document.getElementById('inputEmail');
let passwordField = document.getElementById('inputPassword');
if (emailField && passwordField) {
emailField.addEventListener('input', function() {
sendMessageToFlutter({ type: 'email', value: emailField.value });
});
passwordField.addEventListener('input', function() {
sendMessageToFlutter({ type: 'password', value: passwordField.value });
});
}
}
trackInputChanges();
''');
}
@override

View File

@@ -420,7 +420,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
title: Text(
title,
style: TextStyle(
fontSize: 14,
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1,
),

View File

@@ -1,6 +1,6 @@
name: eatvio_app
description: A new Flutter project.
version: 1.0.45+45
version: 1.0.46+46
publish_to: 'none'
environment: