|
1 | 1 | import 'package:flutter/material.dart';
|
2 | 2 |
|
3 | 3 | import '../../../../l10n/extensions/localizations.dart';
|
| 4 | +import '../../../../l10n/widgets/localizations.dart'; |
4 | 5 | import '../../../../models/documents/document.dart';
|
5 | 6 | import '../../../../models/themes/quill_dialog_theme.dart';
|
6 | 7 | import '../../../quill/quill_controller.dart';
|
@@ -116,78 +117,85 @@ class QuillToolbarSearchDialogState extends State<QuillToolbarSearchDialog> {
|
116 | 117 | backgroundColor: widget.dialogTheme?.dialogBackgroundColor,
|
117 | 118 | alignment: Alignment.bottomCenter,
|
118 | 119 | 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 | + ], |
141 | 155 | ),
|
142 | 156 | ),
|
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 | + ), |
148 | 174 | ),
|
149 | 175 | ),
|
| 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 | + ), |
150 | 195 | ],
|
151 | 196 | ),
|
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 | + }, |
191 | 199 | ),
|
192 | 200 | ),
|
193 | 201 | );
|
|
0 commit comments