Skip to content

Commit

Permalink
chore: deprecate flutter_quill/extensions.dart (#2258)
Browse files Browse the repository at this point in the history
* chore: deprecate flutter_quill/extensions.dart

* chore: remove all usages of extensions.dart in flutter_quill
  • Loading branch information
EchoEllet authored Sep 21, 2024
1 parent 227bd88 commit 409d2d1
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion example/lib/screens/quill/my_quill_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:cached_network_image/cached_network_image.dart'
import 'package:desktop_drop/desktop_drop.dart' show DropTarget;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill/flutter_quill_internal.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
// ignore: implementation_imports
import 'package:flutter_quill_extensions/src/editor/image/widgets/image.dart'
Expand Down
2 changes: 1 addition & 1 deletion example/lib/screens/quill/my_quill_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:io' as io show File;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill/flutter_quill_internal.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:image_cropper/image_cropper.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/foundation.dart' show immutable;
import 'package:flutter/widgets.dart' show Alignment, BuildContext;
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill.dart' show Attribute, Node;
import 'package:flutter_quill/flutter_quill_internal.dart';

import 'element_shared_utils.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/cupertino.dart' show showCupertinoModalPopup;
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill.dart'
show ImageUrl, QuillController, StyleAttribute, getEmbedNode;
import 'package:flutter_quill/flutter_quill_internal.dart';
import 'package:flutter_quill/translations.dart';
import 'package:super_clipboard/super_clipboard.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io' show File;

import 'package:flutter/foundation.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill_internal.dart';

import '../image_embed_types.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill_internal.dart';
import 'package:flutter_quill/translations.dart';

import 'camera_types.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart' show isDesktopApp;
import 'package:flutter_quill/flutter_quill_internal.dart' show isDesktopApp;
import 'package:flutter_quill/translations.dart';

import '../../editor/image/image_embed_types.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart' show isDesktopApp;
import 'package:flutter_quill/flutter_quill_internal.dart' show isDesktopApp;
import 'package:flutter_quill/translations.dart';

import 'models/video.dart';
Expand Down
5 changes: 5 additions & 0 deletions lib/extensions.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@Deprecated(
'The extensions.dart file was primarily intended for flutter_quill_extensions '
'to expose certain internal APIs and should not be used directly, as it is subject to breaking changes.\n'
'The replacement is flutter_quill_internal.dart which is also for internal use only.',
)
library flutter_quill.extensions;

// This file contains exports that are meant to be used
Expand Down
21 changes: 21 additions & 0 deletions lib/flutter_quill_internal.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// WARNING: This file is for internal use for flutter_quill_extensions
// and other related packages. Breaking changes
// can be introduced in minor versions.

@experimental
library;

// This file contains exports that are meant to be used
// internally and are not part of the public API as
// breaking changes can happen.

import 'package:meta/meta.dart' show experimental;

export 'src/common/utils/platform.dart';
export 'src/common/utils/string.dart';
export 'src/common/utils/widgets.dart';
export 'src/document/nodes/leaf.dart';
export 'src/rules/delete.dart';
export 'src/rules/format.dart';
export 'src/rules/insert.dart';
export 'src/rules/rule.dart';
2 changes: 1 addition & 1 deletion lib/src/editor/embed/embed_editor_builder.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/widgets.dart';

import '../../../extensions.dart';
import '../../controller/quill_controller.dart';
import '../../document/nodes/leaf.dart' as leaf;
import '../../document/nodes/leaf.dart';

abstract class EmbedBuilder {
const EmbedBuilder();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/toolbar/buttons/clipboard_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import '../../../extensions.dart';
import '../../../flutter_quill.dart';
import '../../common/utils/widgets.dart';
import '../../editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';
import '../../l10n/extensions/localizations_ext.dart';
import '../base_button/base_value_button.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/toolbar/buttons/font_family_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';

import '../../../extensions.dart';
import '../../common/utils/widgets.dart';
import '../../document/attribute.dart';
import '../../l10n/extensions/localizations_ext.dart';
import '../base_button/base_value_button.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/toolbar/buttons/font_size_button.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

import '../../../extensions.dart';
import '../../common/utils/font.dart';
import '../../common/utils/widgets.dart';
import '../../document/attribute.dart';
import '../../l10n/extensions/localizations_ext.dart';
import '../base_button/base_value_button.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/toolbar/buttons/link_style2_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/link.dart';

import '../../../extensions.dart'
show UtilityWidgets, AutoFormatMultipleLinksRule;
import '../../common/utils/widgets.dart';
import '../../controller/quill_controller.dart';
import '../../editor/widgets/link.dart';
import '../../editor_toolbar_shared/quill_configurations_ext.dart';
import '../../l10n/extensions/localizations_ext.dart';
import '../../l10n/widgets/localizations.dart';
import '../../rules/insert.dart';
import '../base_button/base_value_button.dart';
import '../base_toolbar.dart';
import '../simple_toolbar_provider.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/src/toolbar/buttons/search/search_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import 'dart:async';

import 'package:flutter/material.dart';

import '../../../../extensions.dart';
import '../../../common/utils/platform.dart';
import '../../../controller/quill_controller.dart';
import '../../../document/document.dart';
import '../../../document/nodes/leaf.dart';
import '../../../l10n/extensions/localizations_ext.dart';
import '../../../l10n/widgets/localizations.dart';
import '../../theme/quill_dialog_theme.dart';
Expand Down

0 comments on commit 409d2d1

Please sign in to comment.