Partial implementation of spell_checker

pull/2118/head
CatHood0 8 months ago
parent 9169345b1f
commit b4c9d84fd4
  1. 2
      lib/flutter_quill.dart
  2. 4
      lib/src/editor/spellchecker/default_spellchecker_service.dart
  3. 13
      lib/src/editor/spellchecker/simple_spellchecker_impl.dart
  4. 10
      lib/src/editor/spellchecker/spellchecker_service.dart
  5. 1
      pubspec.yaml

@ -24,6 +24,8 @@ export 'src/editor/raw_editor/config/raw_editor_configurations.dart';
export 'src/editor/raw_editor/quill_single_child_scroll_view.dart';
export 'src/editor/raw_editor/raw_editor.dart';
export 'src/editor/raw_editor/raw_editor_state.dart';
export 'src/editor/spellchecker/spellchecker_service.dart';
export 'src/editor/spellchecker/spellchecker_service_provider.dart';
export 'src/editor/style_widgets/style_widgets.dart';
export 'src/editor/widgets/cursor.dart';
export 'src/editor/widgets/default_styles.dart';

@ -1,11 +1,11 @@
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'spellchecker_service.dart';
class DefaultSpellcheckerService extends SpellcheckerService{
DefaultSpellcheckerService() : super(language: 'en');
@override
List<SuggestionSpan>? getSuggestions(String text) {
List<TextSpan>? fetchSpellchecker(String text) {
return null;
}
}

@ -0,0 +1,13 @@
import 'package:flutter/material.dart';
import 'spellchecker_service.dart';
class SimpleSpellCheckerImpl extends SpellcheckerService {
SimpleSpellCheckerImpl({required super.language});
@override
List<TextSpan>? fetchSpellchecker(String text) {
return null;
}
}

@ -1,12 +1,8 @@
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
abstract class SpellcheckerService {
SpellcheckerService({
required this.language,
});
SpellcheckerService({required this.language});
final String language;
List<SuggestionSpan>? getSuggestions(String text);
List<TextSpan>? fetchSpellchecker(String text);
}

@ -45,6 +45,7 @@ dependencies:
# Dart Packages
intl: ^0.19.0
dart_quill_delta: ^10.0.0
simple_spell_checker: ^1.0.1
collection: ^1.17.0
quiver: ^3.2.1
equatable: ^2.0.5

Loading…
Cancel
Save