pull/1640/head
Ellet 1 year ago
parent e4dcbac9cf
commit e7bddb1f3b
  1. 3
      CHANGELOG.md
  2. 140
      lib/src/widgets/toolbar/buttons/search/search_dialog.dart

@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## 9.1.1
* Fix bug [#1636](https://github.com/singerdmx/flutter-quill/issues/1636)
## 9.1.0 ## 9.1.0
* Fix the simple toolbar by add properties of `IconButton` and fix some buttons * Fix the simple toolbar by add properties of `IconButton` and fix some buttons

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../l10n/extensions/localizations.dart'; import '../../../../l10n/extensions/localizations.dart';
import '../../../../l10n/widgets/localizations.dart';
import '../../../../models/documents/document.dart'; import '../../../../models/documents/document.dart';
import '../../../../models/themes/quill_dialog_theme.dart'; import '../../../../models/themes/quill_dialog_theme.dart';
import '../../../quill/quill_controller.dart'; import '../../../quill/quill_controller.dart';
@ -116,78 +117,85 @@ class QuillToolbarSearchDialogState extends State<QuillToolbarSearchDialog> {
backgroundColor: widget.dialogTheme?.dialogBackgroundColor, backgroundColor: widget.dialogTheme?.dialogBackgroundColor,
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
insetPadding: EdgeInsets.zero, insetPadding: EdgeInsets.zero,
child: SizedBox( child: FlutterQuillLocalizationsWidget(
height: 45, child: Builder(
child: Row( builder: (context) {
children: [ return SizedBox(
Tooltip( height: 45,
message: context.loc.caseSensitivityAndWholeWordSearch, child: Row(
child: ToggleButtons( children: [
onPressed: (index) { Tooltip(
if (index == 0) { message: context.loc.caseSensitivityAndWholeWordSearch,
_changeCaseSensitivity(); child: ToggleButtons(
} else if (index == 1) { onPressed: (index) {
_changeWholeWord(); if (index == 0) {
} _changeCaseSensitivity();
}, } else if (index == 1) {
borderRadius: const BorderRadius.all(Radius.circular(2)), _changeWholeWord();
isSelected: [_caseSensitive, _wholeWord], }
children: const [ },
Text( borderRadius: const BorderRadius.all(Radius.circular(2)),
'\u0391\u03b1', isSelected: [_caseSensitive, _wholeWord],
style: TextStyle( children: const [
fontFamily: 'MaterialIcons', Text(
fontSize: 24, '\u0391\u03b1',
style: TextStyle(
fontFamily: 'MaterialIcons',
fontSize: 24,
),
),
Text(
'\u201c\u2026\u201d',
style: TextStyle(
fontFamily: 'MaterialIcons',
fontSize: 24,
),
),
],
), ),
), ),
Text( Expanded(
'\u201c\u2026\u201d', child: Padding(
style: TextStyle( padding: const EdgeInsets.only(bottom: 12, left: 5),
fontFamily: 'MaterialIcons', child: TextField(
fontSize: 24, style: widget.dialogTheme?.inputTextStyle,
decoration: InputDecoration(
isDense: true,
suffixText: (_offsets != null) ? matchShown : '',
suffixStyle: widget.dialogTheme?.labelTextStyle,
),
autofocus: true,
onChanged: _textChanged,
textInputAction: TextInputAction.done,
keyboardType: TextInputType.text,
onEditingComplete: _findText,
controller: _controller,
),
), ),
), ),
if (_offsets == null)
IconButton(
icon: const Icon(Icons.search),
tooltip: context.loc.findText,
onPressed: _findText,
),
if (_offsets != null)
IconButton(
icon: const Icon(Icons.keyboard_arrow_up),
tooltip: context.loc.moveToPreviousOccurrence,
onPressed:
(_offsets!.isNotEmpty) ? _moveToPrevious : null,
),
if (_offsets != null)
IconButton(
icon: const Icon(Icons.keyboard_arrow_down),
tooltip: context.loc.moveToNextOccurrence,
onPressed: (_offsets!.isNotEmpty) ? _moveToNext : null,
),
], ],
), ),
), );
Expanded( },
child: Padding(
padding: const EdgeInsets.only(bottom: 12, left: 5),
child: TextField(
style: widget.dialogTheme?.inputTextStyle,
decoration: InputDecoration(
isDense: true,
suffixText: (_offsets != null) ? matchShown : '',
suffixStyle: widget.dialogTheme?.labelTextStyle,
),
autofocus: true,
onChanged: _textChanged,
textInputAction: TextInputAction.done,
keyboardType: TextInputType.text,
onEditingComplete: _findText,
controller: _controller,
),
),
),
if (_offsets == null)
IconButton(
icon: const Icon(Icons.search),
tooltip: context.loc.findText,
onPressed: _findText,
),
if (_offsets != null)
IconButton(
icon: const Icon(Icons.keyboard_arrow_up),
tooltip: context.loc.moveToPreviousOccurrence,
onPressed: (_offsets!.isNotEmpty) ? _moveToPrevious : null,
),
if (_offsets != null)
IconButton(
icon: const Icon(Icons.keyboard_arrow_down),
tooltip: context.loc.moveToNextOccurrence,
onPressed: (_offsets!.isNotEmpty) ? _moveToNext : null,
),
],
), ),
), ),
); );

Loading…
Cancel
Save