百度App Flutter技术探索 张迪

Razor

2019/07/03 发布于 技术 分类

安卓绿色联盟 

文字内容
2. A 8 e L a F A
3. 01
4. CONTENTS 01 02 Flutter 03 Flutter 04
5. Web
6. • Ø Ø Kotlin/Swift Ø • Ø Jetpack Compose/Swift UI Ø Ø Instant App
7. Web JS • React JS / San / Vue JS Hybrid • Phone Gap / Cordova / PWA • Ø Web Ø • Ø Ø JS Bridge Widget Native • React Native / Weex •
8. • Ø Ø Unity / Cocos • Ø Ø QT Flutter
9. Why Flutter
10. 02 Flutter
11. Flutter — • Ø Flutter (Flutter SDK Ø • Ø Dart Ø Flutter • Flutter Ø Dart Code Style Ø Dart Analyzer/Lint review )
12. Flutter Flutter • Ø Ø package+ • (git) Native (maven) jar/aar/.a/.framework Native … (git) Flutter (Pub) … Plugin/kernel binary Flutter
13. Flutter Dart Source lib Dart Package Dependcy Dart Front End Kernel binary lib pub get flutter packages get Dart Dart Kernel Binary(*.dill Ø Ø pubspec.yaml debug AOT release Kernel binary Transform 1 2 Dart VM AST Binary) .packages .packages => import package:xxx host pub cache path git project path
14. 03 Flutter
15. Flutter • Flutter • • Flutter • Ø Ø Ø Ø Ø Crash Flutter
16. Flutter • Flutter • Flutter Ø (SPA) FlutterView FlutterView 1 FlutterView FlutterView ü p FlutterView Engine p FlutterView Engine ü ü FlutterView 2 Graphic Buffer 1 FlutterView NativeView 1 Engine UI Task Runner (root isolate) IO Task Runner GPU Task Runner 1 1 Dart Heap
17. Dart Java/Kotlin OC/Swift JavaScript C/C++ • MethodChannel • DNI(Dart ( / ) ( / ) / UI / / C/C++ )
18. Flutter • Dart Flutter Flutter Ø Native Ø ü Dart API Dart API Interface ü Native API ü • Dart Ø Ø / DNS/HTTP Keep Alive… NA
19. Flutter • V.S. • • • Flutter Web • Dynamic For Android Ø SO Ø SO • Flutter Dynamic For iOS • • Dart JS
20. Dart2Dex OOP Bytecode V.S. CPU Instruction • • • Dart Source Dart Java IR Kernel(*.dill) Android ART Dart Bytecode IR Dex Dart Bytecode: https://github.com/dartlang/sdk/blob/master/pkg/vm/lib/bytecode/dbc.dart Dalvik Bytecode: https://source.android.com/devices/tech/dalvik/dalvikbytecode
21. Flutter • • isolate service process • ui process(es) touch event FlutterView Engine Dart VM frame buffer Cross Process FlutterView Engine Proxy
22. 04
23. Flutter on the way • • Flutter • • Flutter • • & • • • (Flutter Web …) IoT 5G