Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: remove flutter overlay (#358)" #427

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 2 additions & 1 deletion lib/src/editor/editor_component/service/editor.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/flutter/overlay.dart';
import 'package:appflowy_editor/src/service/context_menu/built_in_context_menu_item.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide Overlay, OverlayEntry;
import 'package:provider/provider.dart';

// workaround for the issue:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide Overlay, OverlayEntry, OverlayState;

class EditorService {
// selection service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/flutter/overlay.dart';
import 'package:appflowy_editor/src/render/selection/cursor_widget.dart';
import 'package:appflowy_editor/src/render/selection/selection_widget.dart';
import 'package:appflowy_editor/src/service/selection/selection_gesture.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide Overlay, OverlayEntry;
import 'package:provider/provider.dart';

class DesktopSelectionServiceWidget extends StatefulWidget {
Expand Down Expand Up @@ -361,7 +362,7 @@ class _DesktopSelectionServiceWidgetState
);
_selectionAreas.add(overlay);

Overlay.of(context).insertAll(_selectionAreas);
Overlay.of(context)?.insertAll(_selectionAreas);
}

void _updateSelectionAreas(Selection selection) {
Expand Down Expand Up @@ -478,7 +479,7 @@ class _DesktopSelectionServiceWidgetState
}

final overlay = Overlay.of(context);
overlay.insertAll(
overlay?.insertAll(
_selectionAreas,
);
}
Expand Down Expand Up @@ -513,7 +514,7 @@ class _DesktopSelectionServiceWidgetState

_cursorAreas.add(cursorArea);
selectionRects.add(selectable.transformRectToGlobal(cursorRect));
Overlay.of(context).insertAll(_cursorAreas);
Overlay.of(context)?.insertAll(_cursorAreas);

_forceShowCursor();
}
Expand Down Expand Up @@ -563,7 +564,7 @@ class _DesktopSelectionServiceWidgetState
);

_contextMenuAreas.add(contextMenu);
Overlay.of(context).insert(contextMenu);
Overlay.of(context)?.insert(contextMenu);
}

Node? _getNodeInOffset(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:flutter/material.dart';

import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/flutter/overlay.dart';
import 'package:appflowy_editor/src/render/selection/mobile_selection_widget.dart';
import 'package:appflowy_editor/src/service/selection/mobile_selection_gesture.dart';
import 'package:flutter/material.dart' hide Overlay, OverlayEntry;

import 'package:appflowy_editor/src/render/selection/cursor_widget.dart';
import 'package:appflowy_editor/src/render/selection/selection_widget.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -367,7 +368,7 @@ class _MobileSelectionServiceWidgetState
);
_selectionAreas.add(overlay);

Overlay.of(context).insertAll(_selectionAreas);
Overlay.of(context)?.insertAll(_selectionAreas);
}

void _updateSelectionAreas(Selection selection) {
Expand Down Expand Up @@ -444,7 +445,8 @@ class _MobileSelectionServiceWidgetState
}
}

Overlay.of(context).insertAll(
final overlay = Overlay.of(context);
overlay?.insertAll(
_selectionAreas,
);
}
Expand Down Expand Up @@ -479,7 +481,7 @@ class _MobileSelectionServiceWidgetState

_cursorAreas.add(cursorArea);
selectionRects.add(selectable.transformRectToGlobal(cursorRect));
Overlay.of(context).insertAll(_cursorAreas);
Overlay.of(context)?.insertAll(_cursorAreas);

_forceShowCursor();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide Overlay, OverlayEntry;

import 'package:appflowy_editor/src/core/document/node.dart';
import 'package:appflowy_editor/src/core/location/position.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/editor/editor_component/service/selection/desktop_selection_service.dart';
import 'package:appflowy_editor/src/editor/editor_component/service/selection/mobile_selection_service.dart';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart' hide Overlay, OverlayEntry;

class SelectionServiceWidget extends StatefulWidget {
const SelectionServiceWidget({
Expand Down
16 changes: 0 additions & 16 deletions lib/src/editor/editor_component/service/toolbar_service.dart

This file was deleted.

Loading