User Search

Loading preview

Starting the Flutter app

Search with real-time filtering, Follow buttons

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

How it works

Filtering happens inside build: _query is compared case-insensitively against the const _users, and an empty query returns everything. Each keystroke’s setState recomputes filtered, which is fine for five names. There’s no empty-results message. Follow toggles the name in _following, which relabels that row, and survives filtering.

Adapting it

  • Swap the local .where for a debounced API call as user counts grow.
  • Key _following by user ID, and save changes to your API.
  • Show a message when filtered is empty.