| .github/workflows | ||
| android | ||
| fonts | ||
| images | ||
| ios | ||
| lib | ||
| nebula | ||
| test/models | ||
| .git-blame-ignore-revs | ||
| .gitignore | ||
| .metadata | ||
| .swiftformatignore | ||
| analysis_options.yaml | ||
| CHANGELOG.md | ||
| ensure-mobile-nebula.sh | ||
| env.sh.example | ||
| gen-artifacts.sh | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
| RELEASE.md | ||
| swift-format.sh | ||
Mobile Nebula
Setting up dev environment
Install all of the following things:
xcode- use the version specified byxcode_selectin/ios/fastlane/Fastfileandroid-studioflutter3.44.6gomobile- Flutter Android Studio Extension
Ensure your path is set up correctly to execute flutter
Run flutter doctor and fix everything it complains before proceeding
NOTE on iOS, always open Runner.xcworkspace and NOT the Runner.xccodeproj
Before first compile
- Copy
env.sh.exampleand set it up for your machine - Ensure you have run
gomobile init - In Android Studio, make sure you have the current ndk installed by going to Tools -> SDK Manager, go to the SDK Tools tab, check the
Show package detailsbox, expand the NDK section and select28.2.13676358version. - Ensure you have downloaded an ndk via android studio, this is likely not the default one and you need to check the
Show package detailsbox to select the correct version. The correct version comes from the error when you try and compile - Make sure you have
geminstalled withsudo gem install - If on MacOS arm,
sudo gem install ffi -- --enable-libffi-alloc
After a fresh checkout, run ./ensure-mobile-nebula.sh once before building for iOS. Swift package resolution needs MobileNebula.xcframework to exist before the pre-build action that maintains it gets a chance to run. After that, Xcode keeps it fresh automatically, rebuilding only when the Go code in nebula/ changes. If an iOS build ever complains the framework is stale or missing, run the script again by hand.
Formatting
dart format can be used to format the code in lib and test. We use a line-length of 120 characters.
Use:
dart format lib/ test/ -l 120
In Android Studio, set the line length using Preferences -> Editor -> Code Style -> Dart -> Line length, set it to 120. Enable auto-format with Preferences -> Languages & Frameworks -> Flutter -> Format code on save.
./swift-format.sh can be used to format Swift code in the repo.
Once swift-format supports ignoring directories (https://github.com/swiftlang/swift-format/issues/870), we can move to a method of running it more like what https://calebhearth.com/swift-format-github-action describes.