rodydavis / floating_search_bar

Floating Search Bar like Gmail for Flutter
https://rodydavis.github.io/floating_search_bar/
MIT License
32 stars 27 forks source link

[feature request] FloatingSearchBar - TextInputAction Search #4

Open gleesonger opened 5 years ago

gleesonger commented 5 years ago

The text input action for the FloatingSearchBar should be set to search or be configurable. See updated code below.

File: floating_search_bar.dart

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      drawer: drawer,
      endDrawer: endDrawer,
      body: CustomScrollView(
        slivers: <Widget>[
          SliverFloatingBar(
            leading: leading,
            floating: true,
            title: title ??
                TextField(
                  textInputAction: TextInputAction.search,    <---------------- Line added
                  controller: controller,
                  decoration: decoration ??
                      InputDecoration.collapsed(
                        hintText: "Search...",
                      ),
                  autofocus: false,
                  onChanged: onChanged,
                  onTap: onTap,
                ),
            trailing: trailing,
          ),
          SliverList(
            delegate: _childDelagate,
          ),
        ],
      ),
    );
  }
github-actions[bot] commented 4 years ago

This issue has been closed due to inactivity.