Profile Preview

Loading preview

Starting the Flutter app

Public profile view with stats, posts grid, and 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

CustomScrollView with a 280px SliverAppBar whose gradient background hosts the avatar, name and handle, inside a FittedBox that shrinks them to fit large text. The rest is one SliverToBoxAdapter. The location line is a Wrap, and stats share the row through Expanded. _buildTabItem only imitates tabs, so Posts stays selected. Follow toggles _following. _buildContentGrid shows nine gradient tiles in a shrinkWrap grid that builds every item at once.

Adapting it

  • For long feeds, move the grid out to a SliverGrid so tiles load lazily.
  • Replace _buildTabItem with TabBar, or track the selected tab in state.
  • Take a user model, and theme the fixed greys in _buildStat and _buildDivider.