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.

Sentry mobile image

Mobile Vitals: A first step to Faster Apps

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read the guide

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay