diff --git a/lib/domain/language_check_service.dart b/lib/domain/language_check_service.dart index ef0db9f..16843d9 100644 --- a/lib/domain/language_check_service.dart +++ b/lib/domain/language_check_service.dart @@ -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(); diff --git a/lib/domain/mistake.dart b/lib/domain/mistake.dart index 4d15317..ecbd3a8 100644 --- a/lib/domain/mistake.dart +++ b/lib/domain/mistake.dart @@ -9,7 +9,7 @@ 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. @@ -17,7 +17,7 @@ class Mistake { /// Sorted by probability. final List 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, diff --git a/lib/implementations/debounce_lang_tool_service.dart b/lib/implementations/debounce_lang_tool_service.dart index d6ba1f8..ed14755 100644 --- a/lib/implementations/debounce_lang_tool_service.dart +++ b/lib/implementations/debounce_lang_tool_service.dart @@ -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, diff --git a/lib/implementations/lang_tool_service.dart b/lib/implementations/lang_tool_service.dart index c56a3f0..923b21c 100644 --- a/lib/implementations/lang_tool_service.dart +++ b/lib/implementations/lang_tool_service.dart @@ -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 diff --git a/lib/implementations/throttling_lang_tool_service.dart b/lib/implementations/throttling_lang_tool_service.dart index c4522b7..139358c 100644 --- a/lib/implementations/throttling_lang_tool_service.dart +++ b/lib/implementations/throttling_lang_tool_service.dart @@ -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, diff --git a/lib/presentation/language_tool_text_field.dart b/lib/presentation/language_tool_text_field.dart index 2e8fb08..0652baf 100644 --- a/lib/presentation/language_tool_text_field.dart +++ b/lib/presentation/language_tool_text_field.dart @@ -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.