Flutter & Dart Conventions
General Principles
- Clean & Explicit: Write readable and maintainable Dart code.
- Safety First: Avoid
anytypes; prefer strict typing and sound null safety. - Consistency: Follow existing patterns in the codebase for widgets and state management.
Widget Guidelines
- Use
constconstructors whenever possible to improve performance. - Favor composition over inheritance.
- Large widget trees should be split into smaller, focused widgets.
- Prefer
StatelessWidgetunless internal state is absolutely necessary.
Localization
- Use the localized strings from the defined
l10nsetup. - Do not hardcode user-facing strings in widget trees.
Testing
- Ensure new features have corresponding unit or widget tests when applicable.
- Run tests regularly using
flutter test.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.