Skip to content

Commit 1a0dfa1

Browse files
committed
Add initial search button
1 parent d2b308d commit 1a0dfa1

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

lib/src/widgets/toolbar.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import 'toolbar/link_style_button.dart';
2222
import 'toolbar/quill_font_family_button.dart';
2323
import 'toolbar/quill_font_size_button.dart';
2424
import 'toolbar/quill_icon_button.dart';
25+
import 'toolbar/search_button.dart';
2526
import 'toolbar/select_alignment_button.dart';
2627
import 'toolbar/select_header_style_button.dart';
2728
import 'toolbar/toggle_check_list_button.dart';
@@ -110,6 +111,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
110111
bool showVideoButton = true,
111112
bool showCameraButton = true,
112113
bool showDirection = false,
114+
bool showSearchButton = true,
113115
OnImagePickCallback? onImagePickCallback,
114116
OnVideoPickCallback? onVideoPickCallback,
115117
MediaPickSettingSelector? mediaPickSettingSelector,
@@ -158,7 +160,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
158160
showHeaderStyle,
159161
showListNumbers || showListBullets || showListCheck || showCodeBlock,
160162
showQuote || showIndent,
161-
showLink
163+
showLink || showSearchButton
162164
];
163165

164166
//default font size values
@@ -494,6 +496,14 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
494496
iconTheme: iconTheme,
495497
dialogTheme: dialogTheme,
496498
),
499+
if (showSearchButton)
500+
SearchButton(
501+
icon: Icons.search,
502+
iconSize: toolbarIconSize,
503+
controller: controller,
504+
iconTheme: iconTheme,
505+
dialogTheme: dialogTheme,
506+
),
497507
if (customButtons.isNotEmpty)
498508
if (showDividers)
499509
VerticalDivider(
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import 'package:flutter/material.dart';
2+
3+
import '../../models/themes/quill_dialog_theme.dart';
4+
import '../../models/themes/quill_icon_theme.dart';
5+
import '../controller.dart';
6+
import '../toolbar.dart';
7+
8+
class SearchButton extends StatelessWidget {
9+
const SearchButton({
10+
required this.icon,
11+
required this.controller,
12+
this.iconSize = kDefaultIconSize,
13+
this.iconTheme,
14+
this.dialogTheme,
15+
Key? key,
16+
}) : super(key: key);
17+
18+
final IconData icon;
19+
final double iconSize;
20+
21+
final QuillController controller;
22+
23+
final QuillIconTheme? iconTheme;
24+
25+
final QuillDialogTheme? dialogTheme;
26+
27+
@override
28+
Widget build(BuildContext context) {
29+
// TODO: implement floating search bar
30+
return const SizedBox();
31+
}
32+
}

0 commit comments

Comments
 (0)