Transaction History

Loading preview

Starting the Flutter app

A showcase of Flutter's transaction history functionality

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

ListView.separated puts a Divider between six _transactions. Each row works out isCredit by checking whether the amount string begins with +, coloring credits green and leaving debits on onSurface. Dates like Today and Mar 1 are display strings, so there is no grouping or paging.

Adapting it

  • Model amount as a signed number and derive both the sign and isCredit from the value.
  • Use DateTime for date and insert day headers, which separatorBuilder can do by comparing neighboring rows.
  • Attach a ScrollController to load older pages from your API instead of the const _transactions.