Skip to content

Commit e7bddb1

Browse files
author
Ellet
committed
1 parent e4dcbac commit e7bddb1

File tree

2 files changed

+77
-66
lines changed

2 files changed

+77
-66
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 9.1.1
6+
* Fix bug [#1636](https://github.com/singerdmx/flutter-quill/issues/1636)
7+
58
## 9.1.0
69
* Fix the simple toolbar by add properties of `IconButton` and fix some buttons
710

lib/src/widgets/toolbar/buttons/search/search_dialog.dart

Lines changed: 74 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/material.dart';
22

33
import '../../../../l10n/extensions/localizations.dart';
4+
import '../../../../l10n/widgets/localizations.dart';
45
import '../../../../models/documents/document.dart';
56
import '../../../../models/themes/quill_dialog_theme.dart';
67
import '../../../quill/quill_controller.dart';
@@ -116,78 +117,85 @@ class QuillToolbarSearchDialogState extends State<QuillToolbarSearchDialog> {
116117
backgroundColor: widget.dialogTheme?.dialogBackgroundColor,
117118
alignment: Alignment.bottomCenter,
118119
insetPadding: EdgeInsets.zero,
119-
child: SizedBox(
120-
height: 45,
121-
child: Row(
122-
children: [
123-
Tooltip(
124-
message: context.loc.caseSensitivityAndWholeWordSearch,
125-
child: ToggleButtons(
126-
onPressed: (index) {
127-
if (index == 0) {
128-
_changeCaseSensitivity();
129-
} else if (index == 1) {
130-
_changeWholeWord();
131-
}
132-
},
133-
borderRadius: const BorderRadius.all(Radius.circular(2)),
134-
isSelected: [_caseSensitive, _wholeWord],
135-
children: const [
136-
Text(
137-
'\u0391\u03b1',
138-
style: TextStyle(
139-
fontFamily: 'MaterialIcons',
140-
fontSize: 24,
120+
child: FlutterQuillLocalizationsWidget(
121+
child: Builder(
122+
builder: (context) {
123+
return SizedBox(
124+
height: 45,
125+
child: Row(
126+
children: [
127+
Tooltip(
128+
message: context.loc.caseSensitivityAndWholeWordSearch,
129+
child: ToggleButtons(
130+
onPressed: (index) {
131+
if (index == 0) {
132+
_changeCaseSensitivity();
133+
} else if (index == 1) {
134+
_changeWholeWord();
135+
}
136+
},
137+
borderRadius: const BorderRadius.all(Radius.circular(2)),
138+
isSelected: [_caseSensitive, _wholeWord],
139+
children: const [
140+
Text(
141+
'\u0391\u03b1',
142+
style: TextStyle(
143+
fontFamily: 'MaterialIcons',
144+
fontSize: 24,
145+
),
146+
),
147+
Text(
148+
'\u201c\u2026\u201d',
149+
style: TextStyle(
150+
fontFamily: 'MaterialIcons',
151+
fontSize: 24,
152+
),
153+
),
154+
],
141155
),
142156
),
143-
Text(
144-
'\u201c\u2026\u201d',
145-
style: TextStyle(
146-
fontFamily: 'MaterialIcons',
147-
fontSize: 24,
157+
Expanded(
158+
child: Padding(
159+
padding: const EdgeInsets.only(bottom: 12, left: 5),
160+
child: TextField(
161+
style: widget.dialogTheme?.inputTextStyle,
162+
decoration: InputDecoration(
163+
isDense: true,
164+
suffixText: (_offsets != null) ? matchShown : '',
165+
suffixStyle: widget.dialogTheme?.labelTextStyle,
166+
),
167+
autofocus: true,
168+
onChanged: _textChanged,
169+
textInputAction: TextInputAction.done,
170+
keyboardType: TextInputType.text,
171+
onEditingComplete: _findText,
172+
controller: _controller,
173+
),
148174
),
149175
),
176+
if (_offsets == null)
177+
IconButton(
178+
icon: const Icon(Icons.search),
179+
tooltip: context.loc.findText,
180+
onPressed: _findText,
181+
),
182+
if (_offsets != null)
183+
IconButton(
184+
icon: const Icon(Icons.keyboard_arrow_up),
185+
tooltip: context.loc.moveToPreviousOccurrence,
186+
onPressed:
187+
(_offsets!.isNotEmpty) ? _moveToPrevious : null,
188+
),
189+
if (_offsets != null)
190+
IconButton(
191+
icon: const Icon(Icons.keyboard_arrow_down),
192+
tooltip: context.loc.moveToNextOccurrence,
193+
onPressed: (_offsets!.isNotEmpty) ? _moveToNext : null,
194+
),
150195
],
151196
),
152-
),
153-
Expanded(
154-
child: Padding(
155-
padding: const EdgeInsets.only(bottom: 12, left: 5),
156-
child: TextField(
157-
style: widget.dialogTheme?.inputTextStyle,
158-
decoration: InputDecoration(
159-
isDense: true,
160-
suffixText: (_offsets != null) ? matchShown : '',
161-
suffixStyle: widget.dialogTheme?.labelTextStyle,
162-
),
163-
autofocus: true,
164-
onChanged: _textChanged,
165-
textInputAction: TextInputAction.done,
166-
keyboardType: TextInputType.text,
167-
onEditingComplete: _findText,
168-
controller: _controller,
169-
),
170-
),
171-
),
172-
if (_offsets == null)
173-
IconButton(
174-
icon: const Icon(Icons.search),
175-
tooltip: context.loc.findText,
176-
onPressed: _findText,
177-
),
178-
if (_offsets != null)
179-
IconButton(
180-
icon: const Icon(Icons.keyboard_arrow_up),
181-
tooltip: context.loc.moveToPreviousOccurrence,
182-
onPressed: (_offsets!.isNotEmpty) ? _moveToPrevious : null,
183-
),
184-
if (_offsets != null)
185-
IconButton(
186-
icon: const Icon(Icons.keyboard_arrow_down),
187-
tooltip: context.loc.moveToNextOccurrence,
188-
onPressed: (_offsets!.isNotEmpty) ? _moveToNext : null,
189-
),
190-
],
197+
);
198+
},
191199
),
192200
),
193201
);

0 commit comments

Comments
 (0)