Update search_dialog.dart

pull/1342/head
X Code 2 years ago committed by GitHub
parent 46b9278ab0
commit df57af93dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      lib/src/widgets/toolbar/search_dialog.dart

@ -23,8 +23,8 @@ class _SearchDialogState extends State<SearchDialog> {
late TextEditingController _controller; late TextEditingController _controller;
late List<int>? _offsets; late List<int>? _offsets;
late int _index; late int _index;
bool _case_sensitive = false; bool _caseSensitive = false;
bool _whole_word = false; bool _wholeWord = false;
@override @override
void initState() { void initState() {
@ -68,7 +68,7 @@ class _SearchDialogState extends State<SearchDialog> {
} }
}, },
borderRadius: const BorderRadius.all(Radius.circular(2)), borderRadius: const BorderRadius.all(Radius.circular(2)),
isSelected: [_case_sensitive, _whole_word], isSelected: [_caseSensitive, _wholeWord],
children: const [ children: const [
Text( Text(
'\u0391\u03b1', '\u0391\u03b1',
@ -136,8 +136,8 @@ class _SearchDialogState extends State<SearchDialog> {
setState(() { setState(() {
_offsets = widget.controller.document.search( _offsets = widget.controller.document.search(
_text, _text,
caseSensitive: _case_sensitive, caseSensitive: _caseSensitive,
wholeWord: _whole_word, wholeWord: _wholeWord,
); );
_index = 0; _index = 0;
}); });
@ -192,7 +192,7 @@ class _SearchDialogState extends State<SearchDialog> {
void _changeCaseSensitivity() { void _changeCaseSensitivity() {
setState(() { setState(() {
_case_sensitive = !_case_sensitive; _caseSensitive = !_caseSensitive;
_offsets = null; _offsets = null;
_index = 0; _index = 0;
}); });
@ -200,7 +200,7 @@ class _SearchDialogState extends State<SearchDialog> {
void _changeWholeWord() { void _changeWholeWord() {
setState(() { setState(() {
_whole_word = !_whole_word; _wholeWord = !_wholeWord;
_offsets = null; _offsets = null;
_index = 0; _index = 0;
}); });

Loading…
Cancel
Save