mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This patch adds some sensible defaults to xcode_backend.sh and documents how to build hello_services for iOS using Xcode.
Example of using FlutterView in an iOS app.
This project demonstrates how to embed Flutter within an iOS application and build the iOS and Flutter components with Xcode.
Configure
Create an ios/Flutter/Generated.xcconfig file with this entry:
FLUTTER_ROOT=[absolute path to the Flutter SDK]
There are a number of other parameters you can control with this file:
FLUTTER_APPLICATION_PATH: The path that contains yourpubspec.yamlfile relative to yourxcodeprojfile.FLUTTER_TARGET: The path to yourmain.dartrelative to yourpubspec.yaml. Defaults tolib/main.dart.FLUTTER_FRAMEWORK_DIR: The absolute path to the directory that containsFlutter.framework. Defaults to theios-releaseversion ofFlutter.frameworkin thebin/cachedirectory of the Flutter SDK.
Build
Once you've configured your project, you can open ios/HelloServices.xcodeproj
in Xcode and build the project as usual.