Skip to content

Commit

Permalink
Formatted the code and applied fixes before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mitryp committed May 29, 2023
1 parent b285fc5 commit 2d06fb9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions lib/core/dataclasses/language/language.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ class Language {
const Language({required this.name, required this.code});

/// Reads a [Language] from the given [json].
factory Language.fromJson(Map<String, dynamic> json) =>
Language(
factory Language.fromJson(Map<String, dynamic> json) => Language(
name: json['name'] as String,
code: json['code'] as String,
);

/// Creates a Map<String, dynamic> json from this [Language].
Map<String, dynamic> toJson() => {
'name': name,
'code': code,
};
'name': name,
'code': code,
};
}
1 change: 0 additions & 1 deletion lib/domain/language_check_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:languagetool_textfield/domain/api_request_service.dart';
import 'package:languagetool_textfield/domain/mistake.dart';

/// A base language check service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'dart:io';

import 'package:languagetool_textfield/core/dataclasses/language/supported_language.dart';
import 'package:languagetool_textfield/domain/api_request_service.dart';
import 'package:languagetool_textfield/domain/language_fetch_service.dart';

import '../../core/dataclasses/language/supported_language.dart';

/// A class that provide the functionality to fetch the supported language list
/// from the langtoolplus API and handles the errors occurred.
class LangFetchService implements LanguageFetchService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class DebounceLangToolService extends LanguageCheckService {
required bool isPicky,
}) async {
final value = await debouncing.debounce(() {
return baseService.findMistakes(text, checkLanguage: checkLanguage, isPicky: isPicky);
return baseService.findMistakes(text,
checkLanguage: checkLanguage, isPicky: isPicky,);
}) as List<Mistake>?;

return value ?? [];
Expand Down

0 comments on commit 2d06fb9

Please sign in to comment.