Назад към всички

Flutter

// Build reliable Flutter apps avoiding state loss, widget rebuild traps, and async pitfalls.

$ git log --oneline --stat
stars:1,933
forks:367
updated:March 4, 2026
SKILL.mdreadonly
SKILL.md Frontmatter
nameFlutter
slugflutter
version1.0.1
descriptionBuild reliable Flutter apps avoiding state loss, widget rebuild traps, and async pitfalls.
metadata[object Object]

Quick Reference

TopicFile
setState, state loss, keysstate.md
build method, context, GlobalKeywidgets.md
FutureBuilder, dispose, mountedasync.md
Context after pop, deep linkingnavigation.md
const, rebuilds, performanceperformance.md
Platform channels, null safetyplatform.md

Critical Rules

  • setState after dispose — check mounted before calling, crashes otherwise
  • Key missing on list items — reordering breaks state, always use keys
  • FutureBuilder rebuilds on parent rebuild — triggers future again, cache the Future
  • BuildContext after async gap — context may be invalid, check mounted first
  • const constructor — prevents rebuilds, use for static widgets
  • StatefulWidget recreated — key change or parent rebuild creates new state
  • GlobalKey expensive — don't use just to access state, pass callbacks instead
  • dispose incomplete — cancel timers, subscriptions, controllers
  • Navigator.pop with result — returns Future, don't ignore errors
  • ScrollController not disposed — memory leak
  • Image caching — use cached_network_image, default doesn't persist
  • PlatformException not caught — platform channel calls can throw