forked from eatvio/eatvio_app
fix: diary loading
This commit is contained in:
@@ -20,6 +20,8 @@ import 'package:eatvio_app/features/diary/presentation/widgets/day_comment_widge
|
||||
import 'package:eatvio_app/features/diary/presentation/widgets/finish_day_button_widget.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/widgets/meal_widget.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/widgets/offline_banner_widget.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/widgets/glossary_sync_banner_widget.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/bloc/glossary_sync_cubit.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/widgets/wakeup_and_retire_widget.dart';
|
||||
import 'package:eatvio_app/generated/l10n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -74,6 +76,7 @@ class _DiaryScreenContentState extends State<DiaryScreenContent> {
|
||||
log(state.diary.id.toString());
|
||||
}
|
||||
if (state is DiaryStateError) {
|
||||
log('DiaryScreen ERROR: ${state.errorMessage}');
|
||||
return Scaffold(
|
||||
body: DataErrorWidget(onReload: () => context.read<DiaryCubit>().fetchDiaryV2(needLoading: false, diaryId: widget.diaryId)),
|
||||
);
|
||||
@@ -94,6 +97,19 @@ class _DiaryScreenContentState extends State<DiaryScreenContent> {
|
||||
children: [
|
||||
// Офлайн-баннер (скользит сверху при потере сети)
|
||||
const OfflineBannerWidget(),
|
||||
// Прогресс синхронизации глоссария продуктов
|
||||
Builder(
|
||||
builder: (context) {
|
||||
try {
|
||||
return BlocProvider.value(
|
||||
value: sl<GlossarySyncCubit>(),
|
||||
child: const GlossarySyncBannerWidget(),
|
||||
);
|
||||
} catch (_) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.only(bottom: 16, top: 8),
|
||||
|
||||
Reference in New Issue
Block a user