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

@@ -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,