mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: launch review improvements (#5263)
* fix: recent views fix * fix: text button font color * fix: sidebar scrollbar inset * fix: account settings launch review * fix: open + menu on mobile provider issue * fix: code review * fix: push view improvement
This commit is contained in:
@ -11,10 +11,7 @@ import 'package:flowy_infra/theme_extension.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
|
||||
class SettingButton extends StatefulWidget {
|
||||
const SettingButton({
|
||||
super.key,
|
||||
required this.databaseController,
|
||||
});
|
||||
const SettingButton({super.key, required this.databaseController});
|
||||
|
||||
final DatabaseController databaseController;
|
||||
|
||||
@ -44,9 +41,8 @@ class _SettingButtonState extends State<SettingButton> {
|
||||
radius: Corners.s4Border,
|
||||
onPressed: _popoverController.show,
|
||||
),
|
||||
popupBuilder: (BuildContext context) => DatabaseSettingsList(
|
||||
databaseController: widget.databaseController,
|
||||
),
|
||||
popupBuilder: (_) =>
|
||||
DatabaseSettingsList(databaseController: widget.databaseController),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -325,24 +325,20 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
|
||||
final editorState = widget.editorState;
|
||||
|
||||
if (PlatformExtension.isMobile) {
|
||||
return BlocProvider.value(
|
||||
value: documentBloc,
|
||||
child: AppFlowyMobileToolbar(
|
||||
toolbarHeight: 42.0,
|
||||
return AppFlowyMobileToolbar(
|
||||
toolbarHeight: 42.0,
|
||||
editorState: editorState,
|
||||
toolbarItemsBuilder: (sel) => buildMobileToolbarItems(editorState, sel),
|
||||
child: MobileFloatingToolbar(
|
||||
editorState: editorState,
|
||||
toolbarItemsBuilder: (selection) =>
|
||||
buildMobileToolbarItems(editorState, selection),
|
||||
child: MobileFloatingToolbar(
|
||||
editorScrollController: editorScrollController,
|
||||
toolbarBuilder: (_, anchor, closeToolbar) =>
|
||||
CustomMobileFloatingToolbar(
|
||||
editorState: editorState,
|
||||
editorScrollController: editorScrollController,
|
||||
toolbarBuilder: (_, anchor, closeToolbar) =>
|
||||
CustomMobileFloatingToolbar(
|
||||
editorState: editorState,
|
||||
anchor: anchor,
|
||||
closeToolbar: closeToolbar,
|
||||
),
|
||||
child: editor,
|
||||
anchor: anchor,
|
||||
closeToolbar: closeToolbar,
|
||||
),
|
||||
child: editor,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:appflowy/plugins/base/emoji/emoji_picker_screen.dart';
|
||||
import 'package:appflowy/plugins/base/icon/icon_picker.dart';
|
||||
import 'package:appflowy/workspace/presentation/settings/widgets/emoji_picker/emoji_picker.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class EmojiPickerButton extends StatelessWidget {
|
||||
@ -41,7 +42,7 @@ class EmojiPickerButton extends StatelessWidget {
|
||||
),
|
||||
offset: offset,
|
||||
direction: direction ?? PopoverDirection.rightWithTopAligned,
|
||||
popupBuilder: (context) => Container(
|
||||
popupBuilder: (_) => Container(
|
||||
width: emojiPickerSize.width,
|
||||
height: emojiPickerSize.height,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
@ -54,7 +55,7 @@ class EmojiPickerButton extends StatelessWidget {
|
||||
? FlowyButton(
|
||||
useIntrinsicWidth: true,
|
||||
text: defaultIcon!,
|
||||
onTap: () => popoverController.show(),
|
||||
onTap: popoverController.show,
|
||||
)
|
||||
: FlowyTextButton(
|
||||
emoji,
|
||||
@ -64,37 +65,29 @@ class EmojiPickerButton extends StatelessWidget {
|
||||
constraints: const BoxConstraints(minWidth: 35.0),
|
||||
fillColor: Colors.transparent,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
onPressed: () {
|
||||
popoverController.show();
|
||||
},
|
||||
onPressed: popoverController.show,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return FlowyTextButton(
|
||||
emoji,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: emojiSize,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(minWidth: 35.0),
|
||||
fillColor: Colors.transparent,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
onPressed: () async {
|
||||
final result = await context.push<EmojiPickerResult>(
|
||||
Uri(
|
||||
path: MobileEmojiPickerScreen.routeName,
|
||||
queryParameters: {
|
||||
MobileEmojiPickerScreen.pageTitle: title,
|
||||
},
|
||||
).toString(),
|
||||
);
|
||||
if (result != null) {
|
||||
onSubmitted(
|
||||
result.emoji,
|
||||
null,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
return FlowyTextButton(
|
||||
emoji,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: emojiSize,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(minWidth: 35.0),
|
||||
fillColor: Colors.transparent,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
onPressed: () async {
|
||||
final result = await context.push<EmojiPickerResult>(
|
||||
Uri(
|
||||
path: MobileEmojiPickerScreen.routeName,
|
||||
queryParameters: {MobileEmojiPickerScreen.pageTitle: title},
|
||||
).toString(),
|
||||
);
|
||||
if (result != null) {
|
||||
onSubmitted(result.emoji, null);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ class MobileCodeLanguagePickerScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: FlowyAppBar(
|
||||
titleText: LocaleKeys.titleBar_language.tr(),
|
||||
),
|
||||
appBar: FlowyAppBar(titleText: LocaleKeys.titleBar_language.tr()),
|
||||
body: SafeArea(
|
||||
child: ListView.separated(
|
||||
separatorBuilder: (_, __) => const Divider(),
|
||||
itemCount: defaultCodeBlockSupportedLanguages.length,
|
||||
itemBuilder: (context, index) {
|
||||
final language = defaultCodeBlockSupportedLanguages[index];
|
||||
return SizedBox(
|
||||
@ -35,8 +35,6 @@ class MobileCodeLanguagePickerScreen extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, __) => const Divider(),
|
||||
itemCount: defaultCodeBlockSupportedLanguages.length,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -1,3 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/workspace/presentation/settings/widgets/settings_appearance/font_family_setting.dart';
|
||||
@ -6,7 +8,6 @@ import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
|
||||
import 'package:appflowy_popover/appflowy_popover.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
final customizeFontToolbarItem = ToolbarItem(
|
||||
id: 'editor.font',
|
||||
@ -34,9 +35,8 @@ final customizeFontToolbarItem = ToolbarItem(
|
||||
Log.error('Failed to set font family: $e');
|
||||
}
|
||||
},
|
||||
onResetFont: () async => editorState.formatDelta(selection, {
|
||||
AppFlowyRichTextKeys.fontFamily: null,
|
||||
}),
|
||||
onResetFont: () async => editorState
|
||||
.formatDelta(selection, {AppFlowyRichTextKeys.fontFamily: null}),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4.0),
|
||||
child: FlowyTooltip(
|
||||
|
@ -6,7 +6,6 @@ import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/type_option_menu_item.dart';
|
||||
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
|
||||
import 'package:appflowy/plugins/document/application/document_bloc.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/image_placeholder.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mention_block.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart';
|
||||
@ -14,11 +13,12 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mo
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_item/mobile_add_block_toolbar_item.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/aa_menu/_toolbar_theme.dart';
|
||||
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
|
||||
import 'package:appflowy/startup/startup.dart';
|
||||
import 'package:appflowy/startup/tasks/app_widget.dart';
|
||||
import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
final addBlockToolbarItem = AppFlowyMobileToolbarItem(
|
||||
@ -45,7 +45,6 @@ final addBlockToolbarItem = AppFlowyMobileToolbarItem(
|
||||
keepEditorFocusNotifier.increase();
|
||||
final didAddBlock = await showAddBlockMenu(
|
||||
AppGlobals.rootNavKey.currentContext!,
|
||||
documentBloc: context.read<DocumentBloc>(),
|
||||
editorState: editorState,
|
||||
selection: selection!,
|
||||
);
|
||||
@ -60,33 +59,25 @@ final addBlockToolbarItem = AppFlowyMobileToolbarItem(
|
||||
|
||||
Future<bool?> showAddBlockMenu(
|
||||
BuildContext context, {
|
||||
required DocumentBloc documentBloc,
|
||||
required EditorState editorState,
|
||||
required Selection selection,
|
||||
}) async {
|
||||
final theme = ToolbarColorExtension.of(context);
|
||||
return showMobileBottomSheet<bool>(
|
||||
context,
|
||||
showHeader: true,
|
||||
showDragHandle: true,
|
||||
showCloseButton: true,
|
||||
title: LocaleKeys.button_add.tr(),
|
||||
barrierColor: Colors.transparent,
|
||||
backgroundColor: theme.toolbarMenuBackgroundColor,
|
||||
elevation: 20,
|
||||
enableDraggableScrollable: true,
|
||||
builder: (_) => Padding(
|
||||
padding: EdgeInsets.all(16 * context.scale),
|
||||
child: BlocProvider.value(
|
||||
value: documentBloc,
|
||||
child: _AddBlockMenu(
|
||||
selection: selection,
|
||||
editorState: editorState,
|
||||
),
|
||||
}) async =>
|
||||
showMobileBottomSheet<bool>(
|
||||
context,
|
||||
showHeader: true,
|
||||
showDragHandle: true,
|
||||
showCloseButton: true,
|
||||
title: LocaleKeys.button_add.tr(),
|
||||
barrierColor: Colors.transparent,
|
||||
backgroundColor:
|
||||
ToolbarColorExtension.of(context).toolbarMenuBackgroundColor,
|
||||
elevation: 20,
|
||||
enableDraggableScrollable: true,
|
||||
builder: (_) => Padding(
|
||||
padding: EdgeInsets.all(16 * context.scale),
|
||||
child: _AddBlockMenu(selection: selection, editorState: editorState),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
class _AddBlockMenu extends StatelessWidget {
|
||||
const _AddBlockMenu({
|
||||
@ -99,12 +90,9 @@ class _AddBlockMenu extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider.value(
|
||||
value: context.read<DocumentBloc>(),
|
||||
child: TypeOptionMenu<String>(
|
||||
values: buildTypeOptionMenuItemValues(context),
|
||||
scaleFactor: context.scale,
|
||||
),
|
||||
return TypeOptionMenu<String>(
|
||||
values: buildTypeOptionMenuItemValues(context),
|
||||
scaleFactor: context.scale,
|
||||
);
|
||||
}
|
||||
|
||||
@ -226,7 +214,7 @@ class _AddBlockMenu extends StatelessWidget {
|
||||
onTap: (_, __) async {
|
||||
AppGlobals.rootNavKey.currentContext?.pop(true);
|
||||
|
||||
final currentViewId = context.read<DocumentBloc>().documentId;
|
||||
final currentViewId = getIt<MenuSharedState>().latestOpenView?.id;
|
||||
final viewId = await showPageSelectorSheet(
|
||||
context,
|
||||
currentViewId: currentViewId,
|
||||
|
Reference in New Issue
Block a user