Przeglądaj źródła

chore: remove some unnecessary todos (#1785)

* chore: remove some unnecessary todos

* fix: the vertical padding for editor should be 28
Lucas.Xu 2 lat temu
rodzic
commit
d09574951b

+ 1 - 1
frontend/app_flowy/lib/plugins/document/editor_styles.dart

@@ -9,7 +9,7 @@ EditorStyle customEditorTheme(BuildContext context) {
       ? EditorStyle.dark
       : EditorStyle.light;
   editorStyle = editorStyle.copyWith(
-    padding: const EdgeInsets.symmetric(horizontal: 100),
+    padding: const EdgeInsets.symmetric(horizontal: 100, vertical: 28),
     textStyle: editorStyle.textStyle?.copyWith(
       fontFamily: 'poppins',
       fontSize: documentStyle.fontSize,

+ 0 - 1
frontend/app_flowy/lib/workspace/presentation/settings/widgets/settings_file_exporter_widget.dart

@@ -56,7 +56,6 @@ class _FileExporterWidgetState extends State<FileExporterWidget> {
         FlowyTextButton(
           LocaleKeys.button_OK.tr(),
           onPressed: () async {
-            // TODO: Export Data
             await getIt<FilePickerService>()
                 .getDirectoryPath()
                 .then((exportPath) {

+ 0 - 1
frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/emoji_picker.dart

@@ -2,4 +2,3 @@ export 'src/config.dart';
 export 'src/models/emoji_model.dart';
 export 'src/emoji_picker.dart';
 export 'src/emoji_picker_builder.dart';
-export 'src/emoji_button.dart';

+ 0 - 143
frontend/app_flowy/lib/workspace/presentation/widgets/emoji_picker/src/emoji_button.dart

@@ -1,143 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:app_flowy/workspace/presentation/widgets/emoji_picker/emoji_picker.dart';
-
-class FlowyEmojiStyleButton extends StatefulWidget {
-  // final Attribute attribute;
-  final String normalIcon;
-  // TODO: enable insert emoji in appflowy_editor
-  // final QuillController controller;
-  final String tooltipText;
-
-  const FlowyEmojiStyleButton({
-    // required this.attribute,
-    required this.normalIcon,
-    required this.tooltipText,
-    Key? key,
-  }) : super(key: key);
-
-  @override
-  EmojiStyleButtonState createState() => EmojiStyleButtonState();
-}
-
-class EmojiStyleButtonState extends State<FlowyEmojiStyleButton> {
-  // Style get _selectionStyle => widget.controller.getSelectionStyle();
-  final GlobalKey emojiButtonKey = GlobalKey();
-  OverlayEntry? _entry;
-  // final FocusNode _keyFocusNode = FocusNode();
-
-  @override
-  void initState() {
-    super.initState();
-    // _isToggled = _getIsToggled(_selectionStyle.attributes);
-    // widget.controller.addListener(_didChangeEditingValue);
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    // debugPrint(MediaQuery.of(context).size.width.toString());
-    // debugPrint(MediaQuery.of(context).size.height.toString());
-
-    // return ToolbarIconButton(
-    //   key: emojiButtonKey,
-    //   onPressed: _toggleAttribute,
-    //   width: widget.iconSize * kIconButtonFactor,
-    //   isToggled: _isToggled,
-    //   iconName: widget.normalIcon,
-    //   tooltipText: widget.tooltipText,
-    // );
-    return Container();
-  }
-
-  @override
-  void dispose() {
-    _entry?.remove();
-    super.dispose();
-  }
-
-  // void _toggleAttribute() {
-  //   if (_entry?.mounted ?? false) {
-  //     _entry?.remove();
-  //     _entry = null;
-  //     setState(() => _isToggled = false);
-  //   } else {
-  //     RenderBox box =
-  //         emojiButtonKey.currentContext?.findRenderObject() as RenderBox;
-  //     Offset position = box.localToGlobal(Offset.zero);
-
-  //     // final window = await getWindowInfo();
-
-  //     _entry = OverlayEntry(
-  //       builder: (BuildContext context) => BuildEmojiPickerView(
-  //         controller: widget.controller,
-  //         offset: position,
-  //       ),
-  //     );
-
-  //     Overlay.of(context)!.insert(_entry!);
-  //     setState(() => _isToggled = true);
-  //   }
-
-  // }
-}
-
-class BuildEmojiPickerView extends StatefulWidget {
-  const BuildEmojiPickerView({Key? key, this.offset}) : super(key: key);
-  final Offset? offset;
-
-  @override
-  State<BuildEmojiPickerView> createState() => _BuildEmojiPickerViewState();
-}
-
-class _BuildEmojiPickerViewState extends State<BuildEmojiPickerView> {
-  @override
-  Widget build(BuildContext context) {
-    return Stack(
-      children: [
-        Positioned(
-          top: widget.offset!.dy -
-              MediaQuery.of(context).size.height / 2.83 -
-              30,
-          left:
-              widget.offset!.dx - MediaQuery.of(context).size.width / 3.92 + 40,
-          child: Material(
-            borderRadius: BorderRadius.circular(8.0),
-            child: SizedBox(
-              height: MediaQuery.of(context).size.height / 2.83 + 20,
-              width: MediaQuery.of(context).size.width / 3.92,
-              child: ClipRRect(
-                borderRadius: BorderRadius.circular(8.0),
-                child: EmojiPicker(
-                  onEmojiSelected: (category, emoji) => insertEmoji(emoji),
-                  config: const Config(
-                    columns: 8,
-                    emojiSizeMax: 28,
-                    bgColor: Color(0xffF2F2F2),
-                    iconColor: Colors.grey,
-                    iconColorSelected: Color(0xff333333),
-                    indicatorColor: Color(0xff333333),
-                    progressIndicatorColor: Color(0xff333333),
-                    buttonMode: ButtonMode.CUPERTINO,
-                    initCategory: Category.RECENT,
-                  ),
-                ),
-              ),
-            ),
-          ),
-        ),
-      ],
-    );
-  }
-
-  void insertEmoji(Emoji emoji) {
-    // final baseOffset = widget.controller.selection.baseOffset;
-    // final extentOffset = widget.controller.selection.extentOffset;
-    // final replaceLen = extentOffset - baseOffset;
-    // final selection = widget.controller.selection.copyWith(
-    //   baseOffset: baseOffset + emoji.emoji.length,
-    //   extentOffset: baseOffset + emoji.emoji.length,
-    // );
-
-    // widget.controller
-    //     .replaceText(baseOffset, replaceLen, emoji.emoji, selection);
-  }
-}

+ 0 - 1
frontend/app_flowy/packages/appflowy_editor_plugins/lib/src/math_ equation/math_equation_node_widget.dart

@@ -7,7 +7,6 @@ import 'package:flutter_math_fork/flutter_math.dart';
 const String kMathEquationType = 'math_equation';
 const String kMathEquationAttr = 'math_equation';
 
-// TODO: l10n
 SelectionMenuItem mathEquationMenuItem = SelectionMenuItem(
   name: () => 'Math Equation',
   icon: (editorState, onSelected) => Icon(