This app is currently under development.
Item | Case & Naming |
---|---|
Files & Packages | lowercase_with_underscores |
Import Prefixes | lowercase_with_underscores |
Classes & Enums | UpperCamelCase |
Typedefs & Type Parameters | UpperCamelCase |
Other Identifiers | lowerCamelCase |
Constants | SCREAMING_CAPS |
Order your imports in the following order, separated with a blank line and sorted alphabetically within each section:
dart:
imports.package:
imports.- Relative imports.
import 'dart:async';
import 'dart:html';
import 'package:bar/bar.dart';
import 'package:foo/foo.dart';
import 'util.dart';
The new
keyword is optional in dart, so just don't use it.
var x = new Foo(); // bad
var y = Foo(); // good
import 'package:tazkrtak/util/foo.dart'; // bad
import '../util/foo.dart'; // good
Using trailing commas helps the automatic formatter to insert an appropriate amount of line breaks for Flutter-style code.
// bad
ButtonTheme(height: 56, child: Text('foo', style: TextStyle(fontSize: 20)));
^^^
// good
ButtonTheme(
height: 56,
child: Text(
'foo',
style: TextStyle(
fontSize: 20,
), ^
), ^
); ^