fix(typo): fix typo ClipboardServiceProvider.instacne (#1983)

* fix(typo): deprecate ClipboardServiceProvider.instacne as it's a typo, add ClipboardServiceProvider.instance and update usages

* chore: update deprecation message of ClipboardServiceProvider.instacne
pull/1984/head
Ellet 9 months ago committed by GitHub
parent ce5eb86b10
commit 3acc44e2f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      flutter_quill_extensions/lib/flutter_quill_extensions.dart
  2. 6
      lib/src/services/clipboard/clipboard_service_provider.dart
  3. 4
      lib/src/widgets/quill/quill_controller.dart
  4. 2
      lib/src/widgets/raw_editor/raw_editor_state.dart
  5. 2
      lib/src/widgets/toolbar/buttons/clipboard_button.dart

@ -42,7 +42,7 @@ export 'utils/utils.dart';
class FlutterQuillExtensions {
const FlutterQuillExtensions._();
/// Override default implementation of [ClipboardServiceProvider.instacne]
/// Override default implementation of [ClipboardServiceProvider.instance]
/// to allow `flutter_quill` package to use `super_clipboard` plugin
/// to support rich text features, gif and images.
static void useSuperClipboardPlugin() {

@ -7,7 +7,11 @@ import 'default_clipboard_service.dart';
class ClipboardServiceProvider {
const ClipboardServiceProvider._();
static ClipboardService _instance = DefaultClipboardService();
static ClipboardService get instacne => _instance;
static ClipboardService get instance => _instance;
@Deprecated('instacne is a typo, use instance instead.')
static ClipboardService get instacne => instance;
static void setInstance(ClipboardService service) {
_instance = service;

@ -568,7 +568,7 @@ class QuillController extends ChangeNotifier {
/// Return true if can paste using HTML
Future<bool> _pasteHTML() async {
final clipboardService = ClipboardServiceProvider.instacne;
final clipboardService = ClipboardServiceProvider.instance;
Future<String?> getHTML() async {
if (await clipboardService.canProvideHtmlTextFromFile()) {
@ -594,7 +594,7 @@ class QuillController extends ChangeNotifier {
/// Return true if can paste using Markdown
Future<bool> _pasteMarkdown() async {
final clipboardService = ClipboardServiceProvider.instacne;
final clipboardService = ClipboardServiceProvider.instance;
Future<String?> getMarkdown() async {
if (await clipboardService.canProvideMarkdownTextFromFile()) {

@ -184,7 +184,7 @@ class QuillRawEditorState extends EditorState
return;
}
final clipboardService = ClipboardServiceProvider.instacne;
final clipboardService = ClipboardServiceProvider.instance;
final onImagePaste = widget.configurations.onImagePaste;
if (onImagePaste != null) {

@ -27,7 +27,7 @@ class ClipboardMonitor {
}
Future<void> _update(void Function() listener) async {
final clipboardService = ClipboardServiceProvider.instacne;
final clipboardService = ClipboardServiceProvider.instance;
if (await clipboardService.canPaste()) {
_canPaste = true;
listener();

Loading…
Cancel
Save