fix: black screen

This commit is contained in:
Alex
2025-01-10 11:32:19 +03:00
parent 7f2e4df309
commit 9ccb1d08c3
11 changed files with 71 additions and 50 deletions

View File

@@ -1,21 +1,22 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eatvioapp.app">
package="com.eatvioapp.app">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<application
android:label="Eatvio"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
@@ -24,11 +25,6 @@
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@@ -40,4 +36,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:gravity="fill" android:src="@drawable/background"/>
</item>
</layer-list>

View File

@@ -1,4 +1,5 @@
String baseUrl = 'https://dev2.eatvio.com';
String baseUrl = 'https://eatvio.ru';
// String baseUrl = 'https://dev2.eatvio.com';
const List<int> durationValues = [7, 14, 21];

View File

@@ -8,11 +8,15 @@ abstract class TokenStorage {
}
static haveTokenInStorage() async {
if (await FlutterSecureStorage().read(key: 'token') == null) {
try {
if (await FlutterSecureStorage().read(key: 'token') == null) {
return false;
} else {
_addTokenToDioHeader((await FlutterSecureStorage().read(key: 'token'))!);
return true;
}
} catch (e) {
return false;
} else {
_addTokenToDioHeader((await FlutterSecureStorage().read(key: 'token'))!);
return true;
}
}

View File

@@ -11,6 +11,7 @@ import 'package:eatvio_app/generated/l10n.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:http/http.dart' as http;
@@ -19,7 +20,6 @@ import 'package:validators/validators.dart';
import 'bloc/auth_bloc.dart';
import 'models/auth_model.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
class AuthScreen extends StatefulWidget {
static Widget builder(BuildContext context) {

View File

@@ -105,12 +105,6 @@ class DiaryCubit extends Cubit<DiaryState> {
required PortionState portionState,
}) async {
if (portionState == PortionState.filled_diet || portionState == PortionState.eaten_from_diet) {
// await diaryRepository.deleteProductFromMeal(
// diaryId: diaryId,
// mealId: mealId,
// portionId: portionId,
// );
// todo delete product from diet
await diaryRepository.addPortionToMeal(
diaryId: diaryId,
mealId: mealId,

View File

@@ -26,12 +26,12 @@ import 'package:eatvio_app/core/theme/theme_helper.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';
import 'package:go_router/go_router.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:image_picker/image_picker.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
class ProfileScreen extends StatefulWidget {
final Author? author;
@@ -456,7 +456,9 @@ class _ProfileScreenState extends State<ProfileScreen> {
}
_education(ProfileStateLoaded state) {
if (state.profile.role != 'consultant' || state.profile.educationResource?.completedCourses == null) {
if (state.profile.role != 'consultant' ||
state.profile.educationResource?.completedCourses == null ||
state.profile.educationResource?.completedCourses?.length == 0) {
return const SizedBox.shrink();
}
return Padding(
@@ -911,15 +913,15 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Text('Посмотреть'),
),
if (widget.author == null)
PopupMenuItem(
value: 'replace',
child: Text('Заменить'),
),
PopupMenuItem(
value: 'replace',
child: Text('Заменить'),
),
if (widget.author == null)
PopupMenuItem(
value: 'delete',
child: Text('Удалить'),
),
PopupMenuItem(
value: 'delete',
child: Text('Удалить'),
),
],
child: Hero(
tag: state.profile.profilePhotoUrl,
@@ -1102,7 +1104,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
);
}
_charts() {
_charts() {
return Material(
color: Colors.white,
borderRadius: BorderRadius.circular(16),

View File

@@ -101,6 +101,10 @@ class _CityOfLivingScreenState extends State<CityOfLivingScreen> {
focusNode: focus,
autofocus: true,
hintText: 'Москва',
onChanged: (value) {
final registrationCubit = context.read<RegistrationCubit>();
registrationCubit.updateSheet(registrationCubit.state.sheet.copyWith(location: value));
},
textStyle: TextStyle(
fontSize: 16,
color: Colors.black,

View File

@@ -11,11 +11,11 @@ import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:flutter_portal/flutter_portal.dart';
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
void main() async {
Future<void> main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
await di.init();

View File

@@ -1,6 +1,6 @@
name: eatvio_app
description: A new Flutter project.
version: 1.0.8+23
version: 1.0.10+25
publish_to: "none"
environment:
@@ -13,22 +13,22 @@ dependencies:
flutter_localizations:
sdk: flutter
flutter_secure_storage: ^9.2.2
flutter_secure_storage: ^9.2.3
flutter_bloc: ^8.1.6
cached_network_image: ^3.4.1
flutter_svg: ^2.0.16
flutter_svg: ^2.0.17
equatable: ^2.0.7
freezed_annotation: ^2.4.4
json_annotation: ^4.9.0
validators: ^3.0.0
path_provider: ^2.1.5
carousel_slider_plus: ^7.1.0
flutter_form_builder: ^9.5.0
flutter_form_builder: ^10.0.0-dev.1
image_picker: ^1.1.2
flutter_typeahead: ^5.2.0
go_router: ^14.6.2
go_router: ^14.6.3
keyboard_dismisser: ^3.0.0
retrofit: ^4.4.1
retrofit: ^4.4.2
get_it: ^8.0.3
dio: ^5.7.0
dart_pusher_channels: ^1.2.3
@@ -39,29 +39,26 @@ dependencies:
badges: ^3.1.2
google_fonts: ^6.2.1
location: ^7.0.1
syncfusion_flutter_charts: ^28.1.33
syncfusion_flutter_gauges: ^28.1.33
syncfusion_flutter_charts: ^28.1.38
syncfusion_flutter_gauges: ^28.1.38
table_calendar: ^3.1.3
flutter_keyboard_visibility: ^6.0.0
share_plus: ^10.1.3
flutter_html: ^3.0.0-beta.2
file_picker:
git:
url: https://github.com/abdelaziz-mahdy/flutter_file_picker
ref: fix-flutter-3.27-compile-error
file_picker: ^8.1.7
audioplayers: ^6.1.0
intl: ^0.19.0
rive: ^0.13.20
mask_text_input_formatter: ^2.9.0
lottie: ^3.1.3
lottie: ^3.3.0
flutter_portal: ^1.1.4
fluttertoast: ^8.2.8
fluttertoast: ^8.2.10
flutter_rating_bar: ^4.0.1
flutter_image_compress: ^2.3.0
flutter_image_compress: ^2.4.0
image: ^4.3.0
flutter_native_splash: ^2.4.3
dotted_border: ^2.1.0
http: ^1.2.2
flutter_native_splash: ^2.4.4
dev_dependencies:
build_runner: ^2.4.14