mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-31 18:15:09 +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_backend/protobuf/flowy-user/protobuf.dart'; | ||||||
| import 'package:appflowy_result/appflowy_result.dart'; | import 'package:appflowy_result/appflowy_result.dart'; | ||||||
| import 'package:easy_localization/easy_localization.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/flowy_infra_ui.dart'; | ||||||
| import 'package:flowy_infra_ui/style_widget/snap_bar.dart'; | import 'package:flowy_infra_ui/style_widget/snap_bar.dart'; | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
| import 'package:flutter_bloc/flutter_bloc.dart'; | import 'package:flutter_bloc/flutter_bloc.dart'; | ||||||
| import 'package:go_router/go_router.dart'; | import 'package:go_router/go_router.dart'; | ||||||
| import 'package:image_picker/image_picker.dart'; | import 'package:image_picker/image_picker.dart'; | ||||||
| import 'package:flowy_infra/theme_extension.dart'; |  | ||||||
| 
 | 
 | ||||||
| class PageStyleCoverImage extends StatelessWidget { | class PageStyleCoverImage extends StatelessWidget { | ||||||
|   PageStyleCoverImage({ |   PageStyleCoverImage({ | ||||||
| @ -257,6 +257,9 @@ class PageStyleCoverImage extends StatelessWidget { | |||||||
| 
 | 
 | ||||||
|   void _showUnsplash(BuildContext context) { |   void _showUnsplash(BuildContext context) { | ||||||
|     final pageStyleBloc = context.read<DocumentPageStyleBloc>(); |     final pageStyleBloc = context.read<DocumentPageStyleBloc>(); | ||||||
|  |     final backgroundColor = AFThemeExtension.of(context).background; | ||||||
|  |     final maxHeight = MediaQuery.of(context).size.height * 0.6; | ||||||
|  | 
 | ||||||
|     context.pop(); |     context.pop(); | ||||||
| 
 | 
 | ||||||
|     showMobileBottomSheet( |     showMobileBottomSheet( | ||||||
| @ -267,7 +270,7 @@ class PageStyleCoverImage extends StatelessWidget { | |||||||
|       showHeader: true, |       showHeader: true, | ||||||
|       showRemoveButton: true, |       showRemoveButton: true, | ||||||
|       title: LocaleKeys.pageStyle_unsplash.tr(), |       title: LocaleKeys.pageStyle_unsplash.tr(), | ||||||
|       backgroundColor: AFThemeExtension.of(context).background, |       backgroundColor: backgroundColor, | ||||||
|       onRemove: () { |       onRemove: () { | ||||||
|         pageStyleBloc.add( |         pageStyleBloc.add( | ||||||
|           DocumentPageStyleEvent.updateCoverImage( |           DocumentPageStyleEvent.updateCoverImage( | ||||||
| @ -278,11 +281,11 @@ class PageStyleCoverImage extends StatelessWidget { | |||||||
|       builder: (_) { |       builder: (_) { | ||||||
|         return ConstrainedBox( |         return ConstrainedBox( | ||||||
|           constraints: BoxConstraints( |           constraints: BoxConstraints( | ||||||
|             maxHeight: MediaQuery.of(context).size.height * 0.6, |             maxHeight: maxHeight, | ||||||
|             minHeight: 80, |             minHeight: 80, | ||||||
|           ), |           ), | ||||||
|           child: BlocProvider.value( |           child: BlocProvider.value( | ||||||
|             value: context.read<DocumentPageStyleBloc>(), |             value: pageStyleBloc, | ||||||
|             child: Padding( |             child: Padding( | ||||||
|               padding: const EdgeInsets.symmetric(horizontal: 16.0), |               padding: const EdgeInsets.symmetric(horizontal: 16.0), | ||||||
|               child: UnsplashImageWidget( |               child: UnsplashImageWidget( | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Lucas.Xu
						Lucas.Xu