Coding Guidelines - coi-dev/flutter-deltachat-core GitHub Wiki
We use the following sources as coding guidelines.
- For Swift code we use the official Swift guidelines https://swift.org/documentation/api-design-guidelines/
- For Java code we use the Google Java guidelines https://google.github.io/styleguide/javaguide.html
- For Dart code we use the official Dart guidelines https://www.dartlang.org/guides/language/effective-dart/documentation
Additionally we apply the following rules.
Dart
Naming
Create and destroy logic / state methods
- As Flutter uses the words build and create pretty extensively for UI handling, we should avoid those when creating methods which manage logic or states
- Create / setup methods should start with setup
- Tear down / destroy methods should start with tearDown
Utils
If generic functionality is needed please check first if a utility class already provides the required functions. If this is not the case a new utility class should be created or an existing one should get extended to avoid duplicated code.
File structure
- All files referring to a context (e.g. handlers) should be located in one package