Flutter some point in iOS

1. ios following dependent on Flutter

  • Flutter.framework:     Flutter engine等;
  • APP.framework: service code, the code generated by the dart. App.framework also contains kDartVmSnapshotData, kDartVmSnapshotInstructions, kDartIsolateSnapshotData, kDartIsolateSnapshotInstructions four parts;
  • Flutter Plugin: plugin-related;
  • flutter_assets: Flutter dependent static resources, such as fonts, pictures and so on.

2. iOS project is how to route the dart?

(1) ios initialization flutterVC

FlutterViewController* flutterViewController = [[FlutterViewController alloc] initWithProject:nil nibName:nil bundle:nil];
[flutterViewController setInitialRoute:@"myApp"];

main function (2) dart to get the project started by window.defaultRouteName route

void main() {
      runApp(_buildWidget());
}
Widget _buildWidget() {
     String route = window.defaultRouteName;
     ....
     return widget;
}

(3) Flutter.framework render the page

 3.  What is the role kernel_blob.bin document is? Why This file is needed to run the simulator, a real machine does not need to run this file?

  The service code is a product kernel_blob.bin  Dart bytecode The Kernel  , debug when debug, Dart code has changed, then there will be a corresponding change kernel_blob.bin. release mode (AOT mode), dart compiler will use Dart kernel bytecode is compiled into binary code is integrated arm.

   In other words, the simulator is running Debug mode (JIT mode), the source code is business requires two files, one is APP.framework a binary code in the App is kernel_blob.bin. The real machine operation is release mode (AOT mode), you can run directly in the App APP.framework binary code. So the simulator needs kernel_blob.bin file, the real machine does not need kernel_blob.bin file.

 4. Flutter project to build commonly used commands in iOS package

  4.1  flutter build

(1)flutter build ios

lipo -info .ios / Flutter / App.framework / APP view the results is armv7 arm64

Digression: pod package packing iOS framework command

pod package hummer_container.podspec.json --spec-sources='[email protected]:ifoundation-ios/Specs.git' --no-mangle --force

(2)flutter build ios --debug 

lipo -info .ios / Flutter / engine / Flutter.framework / Flutter view the results is x86_64 armv7 arm64 

(3) flutter build ios --simulator   

 lipo -info .ios / Flutter / App.framework / APP see the results on x86_64

  4.2 flutter packages

(1)flutter packages get

When you add a package in the first run (IntelliJ of 'the Get Packages Standard Package') flutter packages get, Flutter find the version of the package is stored in pubspec.lock. This ensures that if other developers that you or your team run flutter packages getback to get the same version of the package.

(2)flutter packages upgrade

Constraints highest available download version allowed according to pubspec.yaml version specified.

Guess you like

Origin www.cnblogs.com/Xylophone/p/12028291.html