textfield improvements
This commit is contained in:
@@ -381,9 +381,8 @@ class SearchScreen extends HookConsumerWidget {
|
|||||||
focusNode: searchFocusNode,
|
focusNode: searchFocusNode,
|
||||||
maxLines: isEditMode ? 3 : 1,
|
maxLines: isEditMode ? 3 : 1,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
label: (activeBang != null)
|
label: const Text('Address / Search'),
|
||||||
? const Text('Search')
|
hint: const Text('Search or type URL'),
|
||||||
: const Text('Address / Search'),
|
|
||||||
unfocusOnTapOutside: false,
|
unfocusOnTapOutside: false,
|
||||||
onSubmitted: (value) async {
|
onSubmitted: (value) async {
|
||||||
if (value.isNotEmpty) {
|
if (value.isNotEmpty) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class SearchField extends HookConsumerWidget {
|
|||||||
final int? minLines;
|
final int? minLines;
|
||||||
final bool unfocusOnTapOutside;
|
final bool unfocusOnTapOutside;
|
||||||
final GlobalKey? textFieldKey;
|
final GlobalKey? textFieldKey;
|
||||||
|
final Widget? hint;
|
||||||
|
|
||||||
final BangData? activeBang;
|
final BangData? activeBang;
|
||||||
final bool showBangIcon;
|
final bool showBangIcon;
|
||||||
@@ -60,6 +61,7 @@ class SearchField extends HookConsumerWidget {
|
|||||||
this.showBangIcon = true,
|
this.showBangIcon = true,
|
||||||
this.autofocus = false,
|
this.autofocus = false,
|
||||||
this.textFieldKey,
|
this.textFieldKey,
|
||||||
|
this.hint,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -120,7 +122,7 @@ class SearchField extends HookConsumerWidget {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
label: label ?? const Text('Search'),
|
label: label ?? const Text('Search'),
|
||||||
// hintText: 'Ask anything...',
|
hint: hint,
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
suffixIcon: hasText
|
suffixIcon: hasText
|
||||||
? IconButton(
|
? IconButton(
|
||||||
|
|||||||
Reference in New Issue
Block a user