mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: dragging the Unsplash cover triggers an assertion error (#5404)
This commit is contained in:
parent
083be32fa6
commit
cb44a885a1
@ -20,13 +20,13 @@ import 'package:appflowy_backend/log.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
|
||||
import 'package:appflowy_result/appflowy_result.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/snap_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:flowy_infra/theme_extension.dart';
|
||||
|
||||
class PageStyleCoverImage extends StatelessWidget {
|
||||
PageStyleCoverImage({
|
||||
@ -257,6 +257,9 @@ class PageStyleCoverImage extends StatelessWidget {
|
||||
|
||||
void _showUnsplash(BuildContext context) {
|
||||
final pageStyleBloc = context.read<DocumentPageStyleBloc>();
|
||||
final backgroundColor = AFThemeExtension.of(context).background;
|
||||
final maxHeight = MediaQuery.of(context).size.height * 0.6;
|
||||
|
||||
context.pop();
|
||||
|
||||
showMobileBottomSheet(
|
||||
@ -267,7 +270,7 @@ class PageStyleCoverImage extends StatelessWidget {
|
||||
showHeader: true,
|
||||
showRemoveButton: true,
|
||||
title: LocaleKeys.pageStyle_unsplash.tr(),
|
||||
backgroundColor: AFThemeExtension.of(context).background,
|
||||
backgroundColor: backgroundColor,
|
||||
onRemove: () {
|
||||
pageStyleBloc.add(
|
||||
DocumentPageStyleEvent.updateCoverImage(
|
||||
@ -278,11 +281,11 @@ class PageStyleCoverImage extends StatelessWidget {
|
||||
builder: (_) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.of(context).size.height * 0.6,
|
||||
maxHeight: maxHeight,
|
||||
minHeight: 80,
|
||||
),
|
||||
child: BlocProvider.value(
|
||||
value: context.read<DocumentPageStyleBloc>(),
|
||||
value: pageStyleBloc,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: UnsplashImageWidget(
|
||||
|
Loading…
Reference in New Issue
Block a user