DEV Community

Cover image for Common mistakes in Flutter article series
Roman Ismagilov
Roman Ismagilov

Posted on

Common mistakes in Flutter article series

Part 1 — ListViews

  • Shrink wrapping ListView.builder or using NeverScrollableScrollPhysics.
  • Letting every item in the list determine height on its own.
  • Wrapping a ListView into a Padding widget.
  • Using wrong scroll physics for different platforms.
  • Adding keys to every list item and expecting that it will improve the scrolling performance.
  • Not using restorationId.

Part 2 — Images

  • Large image assets.
  • Not using WebP assets.
  • Using the Opacity widget when not needed.
  • Not precaching image assets.
  • Not caching network images.
  • Not optimizing SVG assets.

Part 3 — i18n

  • Using different string entries to make a single sentence by concatenating.
  • Ignoring plurals or writing some custom logic to handle it.
  • Manually formatting date and time, hardcoding names of months, days of week.
  • Concatenating currency and price strings.
  • Using fonts that support only Latin script.

Part 4 — OAuth

  • Using WebView to handle auth flow.
  • Storing access tokens in a non-secure storage.
  • Racing refreshing sessions when the refresh token is allowed to be used only once.
  • Bundling client secrets in the application.

Top comments (0)