mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-31 10:03:18 +00:00 
			
		
		
		
	fix: font shown in AA has _r as a suffix (#4482)
This commit is contained in:
		
							parent
							
								
									baa7c8d826
								
							
						
					
					
						commit
						c2fdfb6e89
					
				| @ -2,6 +2,7 @@ import 'package:appflowy/mobile/presentation/setting/font/font_picker_screen.dar | |||||||
| import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_toolbar_theme.dart'; | import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/_toolbar_theme.dart'; | ||||||
| import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart'; | import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart'; | ||||||
| import 'package:appflowy/plugins/document/presentation/more/cubit/document_appearance_cubit.dart'; | import 'package:appflowy/plugins/document/presentation/more/cubit/document_appearance_cubit.dart'; | ||||||
|  | import 'package:appflowy/util/google_font_family_extension.dart'; | ||||||
| import 'package:appflowy_editor/appflowy_editor.dart'; | import 'package:appflowy_editor/appflowy_editor.dart'; | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
| import 'package:go_router/go_router.dart'; | import 'package:go_router/go_router.dart'; | ||||||
| @ -27,8 +28,16 @@ class FontFamilyItem extends StatelessWidget { | |||||||
|     return MobileToolbarMenuItemWrapper( |     return MobileToolbarMenuItemWrapper( | ||||||
|       size: const Size(144, 52), |       size: const Size(144, 52), | ||||||
|       onTap: () async { |       onTap: () async { | ||||||
|         keepEditorFocusNotifier.increase(); |  | ||||||
|         final selection = editorState.selection; |         final selection = editorState.selection; | ||||||
|  |         // disable the floating toolbar | ||||||
|  |         editorState.updateSelectionWithReason( | ||||||
|  |           selection, | ||||||
|  |           extraInfo: { | ||||||
|  |             selectionExtraInfoDisableFloatingToolbar: true, | ||||||
|  |             selectionExtraInfoDisableMobileToolbarKey: true, | ||||||
|  |           }, | ||||||
|  |         ); | ||||||
|  | 
 | ||||||
|         final newFont = await context |         final newFont = await context | ||||||
|             .read<GoRouter>() |             .read<GoRouter>() | ||||||
|             .push<String>(FontPickerScreen.routeName); |             .push<String>(FontPickerScreen.routeName); | ||||||
| @ -45,11 +54,12 @@ class FontFamilyItem extends StatelessWidget { | |||||||
|             selection, |             selection, | ||||||
|             extraInfo: { |             extraInfo: { | ||||||
|               selectionExtraInfoDisableFloatingToolbar: true, |               selectionExtraInfoDisableFloatingToolbar: true, | ||||||
|  |               selectionExtraInfoDisableMobileToolbarKey: false, | ||||||
|             }, |             }, | ||||||
|           ); |           ); | ||||||
|         }); |         }); | ||||||
|       }, |       }, | ||||||
|       text: fontFamily ?? systemFonFamily, |       text: (fontFamily ?? systemFonFamily).parseFontFamilyName(), | ||||||
|       fontFamily: fontFamily ?? systemFonFamily, |       fontFamily: fontFamily ?? systemFonFamily, | ||||||
|       backgroundColor: theme.toolbarMenuItemBackgroundColor, |       backgroundColor: theme.toolbarMenuItemBackgroundColor, | ||||||
|       isSelected: false, |       isSelected: false, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Lucas.Xu
						Lucas.Xu