Dart Coding Conventions: Dart coding conventions are shared rules for naming, formatting and handling common language features. Consistent naming and formatting make unfamiliar code easier to review. Lifecycle rules help reviewers catch unsafe access to a widget context after asynchronous work. Use the formatter and analyser for mechanical checks, and document the lifecycle and error-handling decisions your team expects.
Definition source DeLaParra Services
Frequently asked questions about Dart Coding Conventions
What should you keep in mind with Dart Coding Conventions?
After awaiting work, check that a context is still mounted before using it.
What does an example of Dart Coding Conventions look like?
Use when writing or reviewing any Dart or Flutter code for craft - naming, null safety, pattern matching, records, error handling idioms, dartdoc comments, logging, assertion style in tests, widget-level code quality (const, keys, dispose, BuildContext across an await), and analysis_options lint setup. Triggers on "clean this up", "is this idiomatic?", a code review of Dart, or a new file that sets a precedent others will copy.