Skip to content

Commit

Permalink
Example app added LanguageToolTextField widget
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarski committed Apr 27, 2023
1 parent 9fa3c1d commit 182fc3d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion example/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:languagetool_textfield/languagetool_textfield.dart';

class App extends StatefulWidget {
const App({super.key});
Expand All @@ -8,8 +9,25 @@ class App extends StatefulWidget {
}

class _AppState extends State<App> {
static final LanguageTool _languageTool = LanguageTool();
final DebounceLangToolService _debouncedLangService;

_AppState()
: _debouncedLangService = DebounceLangToolService(
LangToolService(_languageTool),
const Duration(milliseconds: 500),
);
@override
Widget build(BuildContext context) {
return const Placeholder();
return Material(
child: LanguageToolTextField(
langService: _debouncedLangService,
style: const TextStyle(),
decoration: const InputDecoration(),
mistakeBuilder: () {
return Container();
},
),
);
}
}

0 comments on commit 182fc3d

Please sign in to comment.