Skip to content

Commit

Permalink
Rewrite without null assertion operator
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarski committed Apr 26, 2023
1 parent 5eacf21 commit a36e2f6
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions example/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,23 @@ class App extends StatefulWidget {
}

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

void _initializeLangService() {
_debouncedLangService = DebounceLangToolService(
LangToolService(_languageTool),
const Duration(milliseconds: 500),
);
}

@override
void initState() {
_initializeLangService();
super.initState();
}
_AppState()
: _debouncedLangService = DebounceLangToolService(
LangToolService(_languageTool),
const Duration(milliseconds: 500),
);

@override
Widget build(BuildContext context) {
return Material(
child: LanguageToolTextField(
langService: _debouncedLangService!,
langService: _debouncedLangService,
style: TextStyle(),
decoration: InputDecoration(),
mistakeBuilder: (){
mistakeBuilder: () {
return Container();
},
),
Expand Down

0 comments on commit a36e2f6

Please sign in to comment.