forked from eatvio/eatvio_app
feat(env): Issue-588
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@
|
|||||||
*.mocks.dart
|
*.mocks.dart
|
||||||
android/build/
|
android/build/
|
||||||
ios/XCBuildData/
|
ios/XCBuildData/
|
||||||
|
.env
|
||||||
|
|||||||
82
ENV_SETUP.md
Normal file
82
ENV_SETUP.md
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
# Настройка переменных окружения
|
||||||
|
|
||||||
|
Этот проект использует переменные окружения для хранения секретных данных и конфигурации.
|
||||||
|
|
||||||
|
## Установка
|
||||||
|
|
||||||
|
1. Скопируйте файл `env.example` в `.env`:
|
||||||
|
```bash
|
||||||
|
cp env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Отредактируйте файл `.env` и замените значения на ваши собственные секреты.
|
||||||
|
|
||||||
|
## Переменные окружения
|
||||||
|
|
||||||
|
### API URLs
|
||||||
|
- `BASE_URL` - основной URL API (по умолчанию: https://eatvio.ru)
|
||||||
|
- `DEV_BASE_URL` - URL API для разработки (по умолчанию: https://dev2.eatvio.com)
|
||||||
|
|
||||||
|
### Sentry Configuration
|
||||||
|
- `SENTRY_DSN` - DSN для Sentry мониторинга
|
||||||
|
|
||||||
|
### Firebase Configuration
|
||||||
|
- `FIREBASE_PROJECT_ID` - ID проекта Firebase
|
||||||
|
- `FIREBASE_DATABASE_URL` - URL базы данных Firebase
|
||||||
|
- `FIREBASE_STORAGE_BUCKET` - bucket для хранения файлов
|
||||||
|
- `FIREBASE_MESSAGING_SENDER_ID` - ID отправителя сообщений
|
||||||
|
|
||||||
|
### Firebase Android Configuration
|
||||||
|
- `FIREBASE_ANDROID_API_KEY` - API ключ для Android
|
||||||
|
- `FIREBASE_ANDROID_APP_ID` - ID приложения для Android
|
||||||
|
|
||||||
|
### Firebase iOS Configuration
|
||||||
|
- `FIREBASE_IOS_API_KEY` - API ключ для iOS
|
||||||
|
- `FIREBASE_IOS_APP_ID` - ID приложения для iOS
|
||||||
|
- `FIREBASE_IOS_BUNDLE_ID` - Bundle ID для iOS
|
||||||
|
|
||||||
|
### App Store URLs
|
||||||
|
- `APP_STORE_URL` - URL App Store
|
||||||
|
- `RUSTORE_URL` - URL RuStore
|
||||||
|
|
||||||
|
### Telegram Support
|
||||||
|
- `TELEGRAM_SUPPORT_URL` - URL поддержки в Telegram
|
||||||
|
|
||||||
|
### Test Credentials (только для разработки)
|
||||||
|
- `TEST_EMAIL` - тестовый email
|
||||||
|
- `TEST_PASSWORD` - тестовый пароль
|
||||||
|
|
||||||
|
### Email Validation API
|
||||||
|
- `EMAIL_VALIDATION_API_URL` - URL API для валидации email
|
||||||
|
|
||||||
|
### Connection Check URLs
|
||||||
|
- `GOOGLE_CHECK_URL` - URL для проверки соединения (Google)
|
||||||
|
- `YANDEX_CHECK_URL` - URL для проверки соединения (Yandex)
|
||||||
|
|
||||||
|
## Безопасность
|
||||||
|
|
||||||
|
⚠️ **ВАЖНО**: Файл `.env` добавлен в `.gitignore` и не должен попадать в репозиторий. Все секретные данные должны храниться только в этом файле.
|
||||||
|
|
||||||
|
## Использование в коде
|
||||||
|
|
||||||
|
Для доступа к переменным окружения используйте класс `EnvConfig`:
|
||||||
|
|
||||||
|
```dart
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
|
String baseUrl = EnvConfig.baseUrl;
|
||||||
|
String sentryDsn = EnvConfig.sentryDsn;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Миграция
|
||||||
|
|
||||||
|
Все секреты были перенесены из кода в переменные окружения:
|
||||||
|
|
||||||
|
1. **Sentry DSN** - из `main.dart`
|
||||||
|
2. **Firebase конфигурация** - из `firebase_options.dart`
|
||||||
|
3. **API URLs** - из `const.dart`
|
||||||
|
4. **URL для проверки соединения** - из `internet_connection_checker_screen.dart`
|
||||||
|
5. **URL для обновления приложения** - из `update_screen.dart`
|
||||||
|
6. **URL поддержки Telegram** - из `support_screen.dart`
|
||||||
|
7. **API для валидации email** - из `registration_repository.dart`
|
||||||
|
8. **Тестовые учетные данные** - из `test_cases.dart`
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
String baseUrl = 'https://eatvio.ru';
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
|
String baseUrl = EnvConfig.baseUrl;
|
||||||
bool hidePlans = const bool.fromEnvironment('HIDE_PLANS', defaultValue: false);
|
bool hidePlans = const bool.fromEnvironment('HIDE_PLANS', defaultValue: false);
|
||||||
|
|
||||||
const List<int> durationValues = [7, 14, 21];
|
const List<int> durationValues = [7, 14, 21];
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:eatvio_app/core/utils/toasts.dart';
|
|||||||
import 'package:eatvio_app/core/widgets/custom_outlined_button.dart';
|
import 'package:eatvio_app/core/widgets/custom_outlined_button.dart';
|
||||||
import 'package:eatvio_app/core/widgets/custom_text_form_field.dart';
|
import 'package:eatvio_app/core/widgets/custom_text_form_field.dart';
|
||||||
import 'package:eatvio_app/features/dev_tools/test_cases.dart';
|
import 'package:eatvio_app/features/dev_tools/test_cases.dart';
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
@@ -97,10 +98,15 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(padding: const EdgeInsets.all(8.0), child: Row(children: [Text('BaseUrl: $baseUrlForTest')])),
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(children: [Text('BaseUrl: $baseUrlForTest')]),
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: CustomTextFormField(controller: controller, hintText: 'type new base url')),
|
Expanded(
|
||||||
|
child: CustomTextFormField(controller: controller, hintText: 'type new base url'),
|
||||||
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -116,13 +122,13 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
CustomOutlinedButton(
|
CustomOutlinedButton(
|
||||||
text: baseUrl == 'https://dev2.eatvio.com' ? 'Set production base url' : 'Set dev2 base url',
|
text: baseUrl == EnvConfig.devBaseUrl ? 'Set production base url' : 'Set dev2 base url',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (baseUrl == 'https://eatvio.ru') {
|
if (baseUrl == EnvConfig.baseUrl) {
|
||||||
baseUrlForTest = 'https://dev2.eatvio.com';
|
baseUrlForTest = EnvConfig.devBaseUrl;
|
||||||
} else {
|
} else {
|
||||||
baseUrlForTest = 'https://eatvio.ru';
|
baseUrlForTest = EnvConfig.baseUrl;
|
||||||
}
|
}
|
||||||
baseUrl = baseUrlForTest.toLowerCase();
|
baseUrl = baseUrlForTest.toLowerCase();
|
||||||
sl<Dio>().options.baseUrl = baseUrl;
|
sl<Dio>().options.baseUrl = baseUrl;
|
||||||
@@ -132,7 +138,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
|||||||
buttonStyle: const ButtonStyle(),
|
buttonStyle: const ButtonStyle(),
|
||||||
),
|
),
|
||||||
SizedBox(height: baseUrlForTest != baseUrl ? 40 : 10),
|
SizedBox(height: baseUrlForTest != baseUrl ? 40 : 10),
|
||||||
if (baseUrl.toLowerCase() != 'https://eatvio.ru')
|
if (baseUrl.toLowerCase() != EnvConfig.baseUrl.toLowerCase())
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: testCases.length,
|
itemCount: testCases.length,
|
||||||
@@ -175,12 +181,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
|||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: const Text('Test Failed'),
|
title: const Text('Test Failed'),
|
||||||
content: SingleChildScrollView(child: Text(result.error ?? 'No error details.')),
|
content: SingleChildScrollView(child: Text(result.error ?? 'No error details.')),
|
||||||
actions: [
|
actions: [TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('OK'))],
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
child: const Text('OK'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -197,12 +198,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
|||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: const Text('Test Failed'),
|
title: const Text('Test Failed'),
|
||||||
content: SingleChildScrollView(child: Text('$e\n$stack')),
|
content: SingleChildScrollView(child: Text('$e\n$stack')),
|
||||||
actions: [
|
actions: [TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('OK'))],
|
||||||
TextButton(
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
child: const Text('OK'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -216,10 +212,10 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
|
|||||||
TestState.fail => Container(width: 20, height: 20, color: Colors.red),
|
TestState.fail => Container(width: 20, height: 20, color: Colors.red),
|
||||||
TestState.notRun => Container(width: 20, height: 20, color: Colors.grey),
|
TestState.notRun => Container(width: 20, height: 20, color: Colors.grey),
|
||||||
TestState.loading => const SizedBox(
|
TestState.loading => const SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
child: SizedBox(height: 20, width: 20, child: Center(child: CircularProgressIndicator())),
|
child: SizedBox(height: 20, width: 20, child: Center(child: CircularProgressIndicator())),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import 'package:eatvio_app/features/recipe/services/about_recipe_service.dart';
|
|||||||
import 'package:eatvio_app/features/recipe/services/my_recipes_service.dart';
|
import 'package:eatvio_app/features/recipe/services/my_recipes_service.dart';
|
||||||
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
||||||
import 'package:eatvio_app/features/settings/services/settings_service.dart';
|
import 'package:eatvio_app/features/settings/services/settings_service.dart';
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
class TestResult {
|
class TestResult {
|
||||||
final bool success;
|
final bool success;
|
||||||
@@ -477,7 +478,9 @@ class AuthServiceTest implements TestCases {
|
|||||||
final dio = sl<Dio>();
|
final dio = sl<Dio>();
|
||||||
final authService = AuthService(dio, baseUrl: baseUrl);
|
final authService = AuthService(dio, baseUrl: baseUrl);
|
||||||
// Use dummy credentials, expecting failure but no crash
|
// Use dummy credentials, expecting failure but no crash
|
||||||
await authService.getTokenByCredentials(credentials: const CredentialsModel(email: 'reshetnick.mike+user1@gmail.com', password: '1234567890'));
|
await authService.getTokenByCredentials(
|
||||||
|
credentials: CredentialsModel(email: EnvConfig.testEmail, password: EnvConfig.testPassword),
|
||||||
|
);
|
||||||
return TestResult(false, 'Should not succeed');
|
return TestResult(false, 'Should not succeed');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return TestResult(true, 'Exception expected for dummy credentials');
|
return TestResult(true, 'Exception expected for dummy credentials');
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
class InternetConnectionCheckerScreen extends StatefulWidget {
|
class InternetConnectionCheckerScreen extends StatefulWidget {
|
||||||
const InternetConnectionCheckerScreen({super.key, required this.child});
|
const InternetConnectionCheckerScreen({super.key, required this.child});
|
||||||
@@ -66,12 +67,7 @@ class _InternetConnectionCheckerScreenState extends State<InternetConnectionChec
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final uris = [
|
final uris = [Uri.parse(EnvConfig.googleCheckUrl), Uri.parse(EnvConfig.yandexCheckUrl), Uri.parse(EnvConfig.devBaseUrl), Uri.parse(EnvConfig.baseUrl)];
|
||||||
Uri.parse('https://google.com'),
|
|
||||||
Uri.parse('https://yandex.ru'),
|
|
||||||
Uri.parse('https://dev2.eatvio.com'),
|
|
||||||
Uri.parse('https://eatvio.ru'),
|
|
||||||
];
|
|
||||||
for (final uri in uris) {
|
for (final uri in uris) {
|
||||||
try {
|
try {
|
||||||
final response = await http.get(uri).timeout(const Duration(seconds: 3));
|
final response = await http.get(uri).timeout(const Duration(seconds: 3));
|
||||||
@@ -98,13 +94,9 @@ class _InternetConnectionCheckerScreenState extends State<InternetConnectionChec
|
|||||||
if (!_hasInternet)
|
if (!_hasInternet)
|
||||||
NoInternetScreen(
|
NoInternetScreen(
|
||||||
onTryAgain: () async {
|
onTryAgain: () async {
|
||||||
EasyDebounce.debounce(
|
EasyDebounce.debounce('internet connection check', const Duration(seconds: 2), () async {
|
||||||
'internet connection check',
|
await _checkConnection();
|
||||||
const Duration(seconds: 2),
|
});
|
||||||
() async {
|
|
||||||
await _checkConnection();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -129,9 +121,7 @@ class NoInternetScreen extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Отсутствует подключение \nк интернету',
|
'Отсутствует подключение \nк интернету',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyles.headingXLSemibold.copyWith(
|
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||||
color: appTheme.black,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
@@ -140,9 +130,7 @@ class NoInternetScreen extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Проверьте соединение с сетью\nи попробуйте ещё раз',
|
'Проверьте соединение с сетью\nи попробуйте ещё раз',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyles.textMMedium.copyWith(
|
style: TextStyles.textMMedium.copyWith(color: appTheme.gray),
|
||||||
color: appTheme.gray,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
@@ -153,10 +141,7 @@ class NoInternetScreen extends StatelessWidget {
|
|||||||
height: 52,
|
height: 52,
|
||||||
text: 'Попробовать ещё раз',
|
text: 'Попробовать ещё раз',
|
||||||
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
|
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
|
||||||
buttonStyle: ButtonStyle(
|
buttonStyle: ButtonStyle(backgroundColor: WidgetStatePropertyAll(appTheme.blueA400), side: const WidgetStatePropertyAll(BorderSide.none)),
|
||||||
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
|
|
||||||
side: const WidgetStatePropertyAll(BorderSide.none),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:eatvio_app/core/locator_service.dart';
|
|||||||
import 'package:eatvio_app/features/registration/models/user_registration_model.dart';
|
import 'package:eatvio_app/features/registration/models/user_registration_model.dart';
|
||||||
import 'package:eatvio_app/features/registration/models/location_model.dart';
|
import 'package:eatvio_app/features/registration/models/location_model.dart';
|
||||||
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
class RegistrationRepository {
|
class RegistrationRepository {
|
||||||
final RegistrationService registrationService;
|
final RegistrationService registrationService;
|
||||||
@@ -83,7 +84,7 @@ class RegistrationRepository {
|
|||||||
|
|
||||||
Future<bool> emailIsReachable(String email) async {
|
Future<bool> emailIsReachable(String email) async {
|
||||||
try {
|
try {
|
||||||
final response = await sl<Dio>().getUri(Uri.parse('https://api.validate.email/validate?email=$email'));
|
final response = await sl<Dio>().getUri(Uri.parse('${EnvConfig.emailValidationApiUrl}?email=$email'));
|
||||||
if (response.data['result']['reachable'] != 'invalid') {
|
if (response.data['result']['reachable'] != 'invalid') {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
class SupportScreen extends StatelessWidget {
|
class SupportScreen extends StatelessWidget {
|
||||||
const SupportScreen({super.key});
|
const SupportScreen({super.key});
|
||||||
@@ -15,48 +16,28 @@ class SupportScreen extends StatelessWidget {
|
|||||||
final s = S.of(context);
|
final s = S.of(context);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(title: const Text('Поддержка')),
|
||||||
title: const Text('Поддержка'),
|
|
||||||
),
|
|
||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.all(16),
|
padding: EdgeInsets.all(16),
|
||||||
child: Text(
|
child: Text('Если у вас есть вопросы по работе нашего приложения, вы можете задать их, перейдя по ссылке:', style: TextStyle(fontSize: 16)),
|
||||||
'Если у вас есть вопросы по работе нашего приложения, вы можете задать их, перейдя по ссылке:',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrl(
|
launchUrl(Uri.parse(EnvConfig.telegramSupportUrl), mode: LaunchMode.externalApplication);
|
||||||
Uri.parse('https://t.me/eatvio'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: Ink(
|
child: Ink(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(16)),
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
SvgPicture.asset('assets/icons/telegram.svg', colorFilter: const ColorFilter.mode(Colors.black, BlendMode.srcIn)),
|
||||||
'assets/icons/telegram.svg',
|
|
||||||
colorFilter: const ColorFilter.mode(Colors.black, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
const Text(
|
const Text('Telegram: t.me/eatvio', style: TextStyle(fontSize: 16)),
|
||||||
'Telegram: t.me/eatvio',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -69,21 +50,14 @@ class SupportScreen extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: Ink(
|
child: Ink(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(16)),
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: const Row(
|
child: const Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.alternate_email_rounded),
|
Icon(Icons.alternate_email_rounded),
|
||||||
SizedBox(width: 12),
|
SizedBox(width: 12),
|
||||||
Text(
|
Text('E-mail: help@eatv.io', style: TextStyle(fontSize: 16)),
|
||||||
'E-mail: help@eatv.io',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -92,13 +66,7 @@ class SupportScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Text(
|
child: Text('Правовые документы', style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500)),
|
||||||
'Правовые документы',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
InkWell(
|
InkWell(
|
||||||
@@ -106,12 +74,7 @@ class SupportScreen extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: const Padding(
|
child: const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||||
child: Text(
|
child: Text('Публичная офёрта', style: TextStyle(fontSize: 16)),
|
||||||
'Публичная офёрта',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
@@ -120,12 +83,7 @@ class SupportScreen extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: const Padding(
|
child: const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||||
child: Text(
|
child: Text('Политика конфиденциальности', style: TextStyle(fontSize: 16)),
|
||||||
'Политика конфиденциальности',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
@@ -134,12 +92,7 @@ class SupportScreen extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
child: const Padding(
|
child: const Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||||
child: Text(
|
child: Text('О компании', style: TextStyle(fontSize: 16)),
|
||||||
'О компании',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../../../core/theme/theme_helper.dart';
|
import '../../../../core/theme/theme_helper.dart';
|
||||||
|
import '../../../../core/env_config.dart';
|
||||||
|
|
||||||
class UpdateScreen extends StatelessWidget {
|
class UpdateScreen extends StatelessWidget {
|
||||||
const UpdateScreen({super.key});
|
const UpdateScreen({super.key});
|
||||||
@@ -17,16 +18,7 @@ class UpdateScreen extends StatelessWidget {
|
|||||||
body: Stack(
|
body: Stack(
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
Positioned(
|
Positioned(left: -20, top: -20, right: -20, bottom: -20, child: Image.asset('assets/images/bg_welcome.png', fit: BoxFit.cover)),
|
||||||
left: -20,
|
|
||||||
top: -20,
|
|
||||||
right: -20,
|
|
||||||
bottom: -20,
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/images/bg_welcome.png',
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -48,47 +40,26 @@ class UpdateScreen extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
const Text(
|
const Text('Пора обновиться! ⚡', style: TextStyle(fontSize: 28, fontWeight: FontWeight.w800, height: 1)),
|
||||||
'Пора обновиться! ⚡',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 28,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
height: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
const Text(
|
const Text(
|
||||||
'Мы выпустили важное обновление\nс новыми функциями и исправлениями.\nЧтобы продолжить пользоваться\nприложением без сбоев, обновите\nего прямо сейчас.',
|
'Мы выпустили важное обновление\nс новыми функциями и исправлениями.\nЧтобы продолжить пользоваться\nприложением без сбоев, обновите\nего прямо сейчас.',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, height: 1.15),
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
height: 1.15,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final Uri url = Platform.isAndroid
|
final Uri url = Platform.isAndroid ? Uri.parse(EnvConfig.rustoreUrl) : Uri.parse(EnvConfig.appStoreUrl);
|
||||||
? Uri.parse('https://www.rustore.ru/catalog/app/com.eatvioapp.app')
|
|
||||||
: Uri.parse('https://apps.apple.com/app/idYOUR_APP_ID');
|
|
||||||
await launchUrl(url);
|
await launchUrl(url);
|
||||||
},
|
},
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Ink(
|
child: Ink(
|
||||||
height: 52,
|
height: 52,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: appTheme.blueA400, borderRadius: BorderRadius.circular(8)),
|
||||||
color: appTheme.blueA400,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Обновить',
|
'Обновить',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, height: 1, color: Colors.white),
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
height: 1,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// File generated by FlutterFire CLI.
|
// File generated by FlutterFire CLI.
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||||
import 'package:flutter/foundation.dart'
|
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
/// Default [FirebaseOptions] for use with your Firebase apps.
|
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||||
///
|
///
|
||||||
@@ -43,28 +43,26 @@ class DefaultFirebaseOptions {
|
|||||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
throw UnsupportedError(
|
throw UnsupportedError('DefaultFirebaseOptions are not supported for this platform.');
|
||||||
'DefaultFirebaseOptions are not supported for this platform.',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const FirebaseOptions android = FirebaseOptions(
|
static FirebaseOptions get android => FirebaseOptions(
|
||||||
apiKey: 'AIzaSyBUe1UqAAMfgMcd4hWdRoLF1Os-yn-HE9k',
|
apiKey: EnvConfig.firebaseAndroidApiKey,
|
||||||
appId: '1:613980912922:android:4de95e5f2d50ba69ecc0a3',
|
appId: EnvConfig.firebaseAndroidAppId,
|
||||||
messagingSenderId: '613980912922',
|
messagingSenderId: EnvConfig.firebaseMessagingSenderId,
|
||||||
projectId: 'eatvio-3467b',
|
projectId: EnvConfig.firebaseProjectId,
|
||||||
databaseURL: 'https://eatvio-3467b-default-rtdb.europe-west1.firebasedatabase.app',
|
databaseURL: EnvConfig.firebaseDatabaseUrl,
|
||||||
storageBucket: 'eatvio-3467b.firebasestorage.app',
|
storageBucket: EnvConfig.firebaseStorageBucket,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const FirebaseOptions ios = FirebaseOptions(
|
static FirebaseOptions get ios => FirebaseOptions(
|
||||||
apiKey: 'AIzaSyBnE8tQjL9_1HuXrTnqNy6qbXpoenO36yQ',
|
apiKey: EnvConfig.firebaseIosApiKey,
|
||||||
appId: '1:613980912922:ios:c557d140a1212e63ecc0a3',
|
appId: EnvConfig.firebaseIosAppId,
|
||||||
messagingSenderId: '613980912922',
|
messagingSenderId: EnvConfig.firebaseMessagingSenderId,
|
||||||
projectId: 'eatvio-3467b',
|
projectId: EnvConfig.firebaseProjectId,
|
||||||
databaseURL: 'https://eatvio-3467b-default-rtdb.europe-west1.firebasedatabase.app',
|
databaseURL: EnvConfig.firebaseDatabaseUrl,
|
||||||
storageBucket: 'eatvio-3467b.firebasestorage.app',
|
storageBucket: EnvConfig.firebaseStorageBucket,
|
||||||
iosBundleId: 'com.eatvioapp.app',
|
iosBundleId: EnvConfig.firebaseIosBundleId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,22 +19,24 @@ import 'package:flutter_native_splash/flutter_native_splash.dart';
|
|||||||
import 'package:flutter_portal/flutter_portal.dart';
|
import 'package:flutter_portal/flutter_portal.dart';
|
||||||
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
|
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
import 'package:eatvio_app/core/env_config.dart';
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsBinding widgetsBinding = SentryWidgetsFlutterBinding.ensureInitialized();
|
WidgetsBinding widgetsBinding = SentryWidgetsFlutterBinding.ensureInitialized();
|
||||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||||
|
|
||||||
|
await dotenv.load(fileName: ".env");
|
||||||
|
|
||||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
await FirebaseMessaging.instance.requestPermission();
|
await FirebaseMessaging.instance.requestPermission();
|
||||||
await di.init();
|
await di.init();
|
||||||
|
|
||||||
await SentryFlutter.init(
|
await SentryFlutter.init((options) {
|
||||||
(options) {
|
options.dsn = EnvConfig.sentryDsn;
|
||||||
options.dsn = 'http://ba7f2653067776f3034e6e89850e85a1@sentry.md-desk.ru:9000/2';
|
options.tracesSampleRate = 1.0;
|
||||||
options.tracesSampleRate = 1.0;
|
options.debug = false;
|
||||||
options.debug = false;
|
}, appRunner: () => runApp(const MyApp()));
|
||||||
},
|
|
||||||
appRunner: () => runApp(const MyApp()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ dependencies:
|
|||||||
device_info_plus: ^11.5.0
|
device_info_plus: ^11.5.0
|
||||||
permission_handler: ^12.0.1
|
permission_handler: ^12.0.1
|
||||||
qr_code_scanner_plus: ^2.0.10+1
|
qr_code_scanner_plus: ^2.0.10+1
|
||||||
|
flutter_dotenv: ^5.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
build_runner: ^2.6.0
|
build_runner: ^2.6.0
|
||||||
|
|||||||
Reference in New Issue
Block a user