Flutter Analysis and Practice: Hybrid Project Transformation

1.2.1 Project Background and Problems

Figure 1–12
  1. Building and Packaging: After Flutter is introduced to a native project, the project cannot be independently compiled or built due to its dependency on and coupling with Flutter. In the Flutter environment, a project starts to be built when you run the Flutter building command. The execution process includes the building of the native project. Developers need to configure the complete Flutter runtime environment to complete the entire process.
  2. Development Efficiency: The development efficiency is low when development needs to be made in a hybrid environment. Many businesses are developed by using native projects. However, due to the project structure changes, development cannot be made only in the native environment, and adaptation to the Flutter project structure causes unnecessary building for native development when Flutter is integrated. This reduces the development efficiency.

1.2.2 Transformation Objectives

  • Native projects can be independently compiled, built, and debugged to minimize the interference to developers. This decouples the packaging platform from the Flutter environment and processes.
  • When a native project is in the Flutter environment (as an iOS or Android subdirectory), whether it can be correctly developed is determined by whether it correctly depends on relevant libraries and files to execute Flutter functions, such as Dart code building, debugging, and hot reload.

1.2.3 Solution Formulation

1.2.3.1 Two Development Modes

Figure 1–13 ¨C Two Development Modes

1.2.3.2 Dependency Clarification

1.2.3.3 Dependency Policies

Figure 1–14

1.2.4 Implementation of Transformation

1.2.4.1 Directory Structure

1.2.4.2 Implementation of Remote Dependencies

Figure 1–15

Original Source:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com