Brew Flutter
- Register your app on App Store Connect
Homebrew on Linux. The Homebrew package manager may be used on Linux and Windows Subsystem for Linux (WSL).Homebrew was formerly referred to as Linuxbrew when running on Linux or WSL. Welcome to Introduction to Flutter Development with Dart - created in collaboration with the Google Flutter team. The course contains the first 10 hours of the Complete Flutter Development Bootcamp and will teach you all the fundamentals of Flutter development to get you started.
This guide provides a step-by-step walkthrough of releasing aFlutter app to the App Store and TestFlight.
Preliminaries
Before beginning the process of releasing your app,ensure that it meetsApple’s App Review Guidelines.
In order to publish your app to the App Store,you must first enroll in theApple Developer Program.You can read more about the variousmembership options in Apple’sChoosing a Membership guide.
Register your app on App Store Connect
Manage your app’s life cycle onApp Store Connect (formerly iTunes Connect).You define your app name and description, add screenshots,set pricing, and manage releases to the App Store and TestFlight.
Registering your app involves two steps: registering a uniqueBundle ID, and creating an application record on App Store Connect.
For a detailed overview of App Store Connect, see theApp Store Connect guide.
Register a Bundle ID
Every iOS application is associated with a Bundle ID,a unique identifier registered with Apple.To register a Bundle ID for your app, follow these steps:
- Open the App IDs page of your developer account.
- Click + to create a new Bundle ID.
- Enter an app name, select Explicit App ID, and enter an ID.
- Select the services your app uses, then click Continue.
- On the next page, confirm the details and click Registerto register your Bundle ID.
Create an application record on App Store Connect
Register your app on App Store Connect:
- Open App Store Connect in your browser.
- On the App Store Connect landing page, click My Apps.
- Click + in the top-left corner of the My Apps page,then select New App.
- Fill in your app details in the form that appears.In the Platforms section, ensure that iOS is checked.Since Flutter does not currently support tvOS,leave that checkbox unchecked. Click Create.
- Navigate to the application details for your app and selectApp Information from the sidebar.
- In the General Information section, select the Bundle IDyou registered in the preceding step.
For a detailed overview,see Add an app to your account.
Review Xcode project settings
This step covers reviewing the most important settingsin the Xcode workspace.For detailed procedures and descriptions, seePrepare for app distribution.
Navigate to your target’s settings in Xcode:
- In Xcode, open
Runner.xcworkspace
in your app’sios
folder. - To view your app’s settings, select the Runner project in the Xcodeproject navigator. Then, in the main view sidebar, select the Runnertarget.
- Select the General tab.
Verify the most important settings.
In the Identity section:
Display Name
- The display name of your app.
Bundle Identifier
- The App ID you registered on App Store Connect.
In the Signing & Capabilities section:
Automatically manage signing
- Whether Xcode should automatically manage app signingand provisioning. This is set
true
by default, which shouldbe sufficient for most apps. For more complex scenarios,see the Code Signing Guide. Team
- Select the team associated with your registered Apple Developeraccount. If required, select Add Account…,then update this setting.
In the Build Settings section:
iOS Deployment Target
- The minimum iOS version that your app supports.Flutter supports iOS 8.0 and later. If your app includesObjective-C or Swift code that makes use of APIs thatwere unavailable in iOS 8, update this setting appropriately.
The General tab of your project settings should resemblethe following:
For a detailed overview of app signing, seeCreate, export, and delete signing certificates.
Updating the app’s deployment version
If you changed Deployment Target
in your Xcode project,open ios/Flutter/AppframeworkInfo.plist
in your Flutter appand update the MinimumOSVersion
value to match.
Updating the app’s version number
The default version number of the app is 1.0.0
.To update it, navigate to the pubspec.yaml
fileand update the following line:
version: 1.0.0+1
The version number is three numbers separated by dots,such as 1.0.0
in the example above, followed by an optionalbuild number such as 1
in the example above, separated by a +
.
Both the version and the build number may be overridden in Flutter’sbuild by specifying --build-name
and --build-number
,respectively.
In iOS, build-name
uses CFBundleShortVersionString
while build-number
uses CFBundleVersion
.Read more about iOS versioning at Core Foundation Keyson the Apple Developer’s site.
Add an app icon
When a new Flutter app is created, a placeholder icon set is created.This step covers replacing these placeholder icons with yourapp’s icons:
- Review the iOS App Icon guidelines.
- In the Xcode project navigator, select
Assets.xcassets
in theRunner
folder. Update the placeholder icons with your own app icons. - Verify the icon has been replaced by running your app using
flutter run
.
Create a build archive
This step covers creating a build archive and uploadingyour build to App Store Connect.
During development, you’ve been building, debugging, and testingwith debug builds. When you’re ready to ship your app to userson the App Store or TestFlight, you need to prepare a release build.At this point, you might consider obfuscating your Dart codeto make it more difficult to reverse engineer. Obfuscatingyour code involves adding a couple flags to your build command.
In Xcode, configure the app version and build:
- In Xcode, open
Runner.xcworkspace
in your app’sios
folder. - Select Runner in the Xcode project navigator, then select theRunner target in the settings view sidebar.
- In the Identity section, update the Version to the user-facingversion number you wish to publish.
- In the Identity section, update the Build identifier to a uniquebuild number used to track this build on App Store Connect.Each upload requires a unique build number.
Finally, create a build archive and upload it to App Store Connect:
Run
flutter build ipa
to produce a build archive.Note: On versions of Flutter where
flutter build ipa
is unavailable, open Xcode and select Product > Archive. In the sidebar of the Xcode Organizer window, select your iOS app, then select the build archive you just produced.Open
build/ios/archive/MyApp.xcarchive
in Xcode.Click the Validate App button. If any issues are reported,address them and produce another build. You can reuse the samebuild ID until you upload an archive.
After the archive has been successfully validated, clickDistribute App. You can follow the status of your build in theActivities tab of your app’s details page onApp Store Connect.
Note: When you export your app at the end of Distribute App, Xcode will create a directory containing an IPA of your app and an
ExportOptions.plist
file. You can create new IPAs with the same options without launching Xcode by runningflutter build ipa --export-options-plist=path/to/ExportOptions.plist
. Seexcodebuild -h
for details about the keys in this property list.
You should receive an email within 30 minutes notifying you thatyour build has been validated and is available to release to testerson TestFlight. At this point you can choose whether to releaseon TestFlight, or go ahead and release your app to the App Store.
For more details, seeUpload an app to App Store Connect.
Release your app on TestFlight
TestFlight allows developers to push their appsto internal and external testers. This optional stepcovers releasing your build on TestFlight.
- Navigate to the TestFlight tab of your app’s applicationdetails page on App Store Connect.
- Select Internal Testing in the sidebar.
- Select the build to publish to testers, then click Save.
- Add the email addresses of any internal testers.You can add additional internal users in the Users and Rolespage of App Store Connect,available from the dropdown menu at the top of the page.
For more details, see Distribute an app using TestFlight.
Release your app to the App Store
When you’re ready to release your app to the world,follow these steps to submit your app for review andrelease to the App Store:
- Select Pricing and Availability from the sidebar of your app’sapplication details page onApp Store Connect and complete therequired information.
- Select the status from the sidebar. If this is the firstrelease of this app, its status is1.0 Prepare for Submission. Complete all required fields.
- Click Submit for Review.
Apple notifies you when their app review process is complete.Your app is released according to the instructions youspecified in the Version Release section.
For more details, seeDistribute an app through the App Store.
Troubleshooting
The Distribute your app guide provides adetailed overview of the process of releasing an app to the App Store.
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
Inspired by SwiftGen.
Motivation #
Using asset path string directly is not safe.
❌ Bad
What would happen if you made a typo?
⭕️ Good
We want to use it safely.
Installation #
Homebrew #
Works with MacOS and Linux.
Pub Global #
Works with MacOS, Linux and Windows.
You might need to set up your path.
As a part of build_runner #
- Add build_runner and FlutterGen to your package's pubspec.yaml file:
- Install FlutterGen
- Use FlutterGen
Usage #
Run fluttergen
after the configuration pubspec.yaml
.
Configuration file #
FlutterGen generates dart files based on the key flutter
and flutter_gen
of pubspec.yaml
.
Default configuration can be found here.
Available Parsers #
Assets #
Just follow the doc Adding assets and images#Specifying assets to specify assets, then FlutterGen will generate related dart files.
No other specific configuration is required.
Ignore duplicated.
These configurations will generate assets.gen.dart
under the lib/gen/
directory by default.
Usage Example
FlutterGen generates Image class if the asset is Flutter supported image format.
Example results of assets/images/chip.jpg
:
Assets.images.chip
is an implementation ofAssetImage class
.Assets.images.chip.image(...)
returnsImage class
.Assets.images.chip.path
just returns the path string.
If you are using SVG images with flutter_svg you can use the integration feature.
Available Integrations
Packages | File extension | Setting | Usage |
---|---|---|---|
flutter_svg | .svg | flutter_svg: true | Assets.images.icons.paint.svg() |
flare_flutter | .flr | flare_flutter: true | Assets.flare.penguin.flare() |
<br/>
In other cases, the asset is generated as String class.
FlutterGen also support generating other style of Assets
class:
The root directory will be omitted if it is either assets
or asset
.
Example of code generated by FlutterGen
Fonts #
Just follow the doc Use a custom font to specify fonts, then FlutterGen will generate related dart files.
No other specific configuration is required.
Ignore duplicated.
These configurations will generate fonts.gen.dart
under the lib/gen/
directory by default.
Usage Example
Example of code generated by FlutterGen
Brew Flutter Instructions
Colors #
Brew Install Flutter
FlutterGen supports generating colors from XML format files.
Ignore duplicated.
FlutterGen can generate a Color class based on the name
attribute and the color hex value.If the element has the attribute type
, then a specially color will be generated.
Currently supported special color types:
Noticed that there is no official material color generation algorithm. The implementation is based on the mcg project.
These configurations will generate colors.gen.dart
under the lib/gen/
directory by default.
Usage Example
Example of code generated by FlutterGen
Default Configuration #
The following are the default settings.The options you set in pubspec.yaml
will override the corresponding default options.
Credits #
The material color generation implementation is based on mcg and TinyColor.
Issues #
Please file FlutterGen specific issues, bugs, or feature requests in our issue tracker.
Plugin issues that are not specific to FlutterGen can be filed in the Flutter issue tracker.
Contributing #
We are looking for co-developers.
If you wish to contribute a change to any of the existing plugins in this repo,please review our contribution guideand open a pull request.