Skip to content

Commit

Permalink
Fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxorum committed Apr 25, 2023
1 parent ee34a3b commit 61d935f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/domain/language_check_service.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:languagetool_textfield/domain/mistake.dart';

/// Base language check service.
/// A base language check service.
abstract class LanguageCheckService {
/// Creates a new instance of the [LanguageCheckService] class.
const LanguageCheckService();
Expand Down
4 changes: 2 additions & 2 deletions lib/domain/mistake.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class Mistake {
/// A position of the beginning of this mistake.
final int offset;

/// Length of this mistake after the offset.
/// A length of this mistake after the offset.
final int length;

/// A list of suggestions for replacing this mistake.
///
/// Sorted by probability.
final List<String> replacements;

/// Creates a new instance of the [Mistake] class
/// Creates a new instance of the [Mistake] class.
const Mistake({
required this.message,
required this.type,
Expand Down
6 changes: 3 additions & 3 deletions lib/implementations/debounce_lang_tool_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import 'package:languagetool_textfield/domain/language_check_service.dart';
import 'package:languagetool_textfield/domain/mistake.dart';
import 'package:throttling/throttling.dart';

/// Implementation of language check service with debouncing.
/// A language check service with debouncing.
class DebounceLangToolService extends LanguageCheckService {
/// Base language check service.
/// A base language check service.
final LanguageCheckService baseService;

/// A debouncing used to debounce the API calls.
final Debouncing debouncing;

/// Implementation of language check service with debouncing.
/// Creates a new instance of the [DebounceLangToolService] class.
DebounceLangToolService(
this.baseService,
Duration debouncingDuration,
Expand Down
6 changes: 3 additions & 3 deletions lib/implementations/lang_tool_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import 'package:language_tool/language_tool.dart';
import 'package:languagetool_textfield/domain/language_check_service.dart';
import 'package:languagetool_textfield/domain/mistake.dart';

/// Implementation of language check service with language tool service.
/// An implementation of language check service with language tool service.
class LangToolService extends LanguageCheckService {
/// Objects of this class are used to interact with LanguageTool API.
/// An instance of this class that is used to interact with LanguageTool API.
final LanguageTool languageTool;

/// Implementation of language check service with language tool service.
/// Creates a new instance of the [LangToolService].
const LangToolService(this.languageTool);

@override
Expand Down
7 changes: 4 additions & 3 deletions lib/implementations/throttling_lang_tool_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import 'package:languagetool_textfield/domain/language_check_service.dart';
import 'package:languagetool_textfield/domain/mistake.dart';
import 'package:throttling/throttling.dart';

/// Implementation of language check service with throttling.
/// A language check service with debouncing.
class ThrottlingLangToolService extends LanguageCheckService {
/// Base language check service.
/// A base language check service that is used to interact
/// with the language check API.
final LanguageCheckService baseService;

/// A throttling used to throttle the API calls.
final Throttling throttling;

/// Implementation of LanguageCheckService with throttling.
/// Creates a new instance of the [ThrottlingLangToolService] class.
ThrottlingLangToolService(
this.baseService,
Duration throttlingDuration,
Expand Down
10 changes: 5 additions & 5 deletions lib/presentation/language_tool_text_field.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import 'package:flutter/material.dart';
import 'package:languagetool_textfield/domain/language_check_service.dart';

/// Widget for checking grammar errors.
/// A TextField widget that checks the grammar using the given [langService]
class LanguageToolTextField extends StatefulWidget {
/// Service for checking errors.
/// A service for checking errors.
final LanguageCheckService langService;

/// The style to use for the text being edited.
/// A style to use for the text being edited.
final TextStyle style;

/// Decoration of widget
/// A decoration of this [TextField].
final InputDecoration decoration;

/// Will build custom errors based on state.
/// A builder function used to build errors.
final Widget Function()? mistakeBuilder;

/// Creates a widget that checks grammar errors.
Expand Down

0 comments on commit 61d935f

Please sign in to comment.