mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Re-wrap to 80 columns and use references for style guide links. Unofficially, this is more about triggering a build than cleaning up.
2.0 KiB
2.0 KiB
Contributing to the Flutter engine
See also: Flutter's code of conduct
Welcome
For an introduction to contributing to Flutter, see our contributor guide.
For specific instructions regarding building Flutter's engine, see Setting up the Engine development environment on our wiki. Those instructions are part of the broader onboarding instructions described in the contributing guide.
Style
The Flutter engine follows Google style for the languages it uses:
- C++
- Note: The Linux embedding generally follows idiomatic GObject-based C
style. Use of C++ is discouraged in that embedding to avoid creating hybrid
code that feels unfamiliar to either developers used to working with
GObjector C++ developers. For example, do not use STL collections orstd::string. Exceptions:- C-style casts are forbidden; use C++ casts.
- Use
nullptrrather thanNULL. - Avoid
#define; for internal constants usestatic constexprinstead.
- Note: The Linux embedding generally follows idiomatic GObject-based C
style. Use of C++ is discouraged in that embedding to avoid creating hybrid
code that feels unfamiliar to either developers used to working with
- Objective-C (including Objective-C++)
- Java
C/C++ and Objective-C/C++ files are formatted with clang-format, and GN files
with gn format.
Fuchsia Contributions from Googlers
Googlers contributing to Fuchsia should follow the additional steps at: go/flutter-fuchsia-pr-policy.