Flutter learning - Vscode to create projects

Table of contents

1. Create a project with Vscode

2. Supplementary five project types 

Application:

 Module module development,

Package development

Plugin plug-in development

Skeleton skeleton development


1. Create a project with Vscode

1. Shortcut key Ctrl+Shift+P to open the command panel and select a new item

2. Select the project type that needs to be developed Application application development (the description of these five project types will be supplemented below)

3. After selecting Application, the file directory will pop up, and select the folder address where the project is stored

4. Enter the project name and press Enter to create the project

 5. The project directory after creation

2. Supplementary five project types 

Application:

Application development, which is the most commonly used app development

android: Android native project code and configuration
ios: ios native code, configuration, resources, etc.
lib: dart/Flutter code
pubspec.yaml: project configuration file, including dart/flutter version information, version number, third-party libraries used, resource configuration, etc.
test: unit test code

 Module module development,

This method is often used to integrate the Flutter project into the Native project, and Native is the main body (host) of the project

Applicable scene

1. In existing native projects, use Flutter to develop and improve efficiency

2. There is an existing Flutter project, which is integrated into the old project in the form of a module

There is a problem:

1. When integrating multiple modules, you need to consider the use of Flutter Engine. Multiple Flutter Engines will have memory and memory cannot be shared. After Dart2.15, isolates in the Isolate group can share memory

2. Multiple Flutter Engines consume a lot of memory

3. When Native opens the Flutter page, because the Flutter Engine needs to be initialized, it takes time, causing page jump delay ("stuck")

Package development

Flutter package development

1. Native code cannot be used in the package

2. The pure Dart language can be used without relying on Flutter to develop Dart Package

Plugin plug-in development

1. Can be published to pub.dev

2. Plugin can contain native code

Skeleton skeleton development

This project mode has been supported since Flutter2.5, and provides a better project template for development. It is not the default Counter app. In the mode, you can see good implementations of routing, resources, multilingual, state management, folders, etc. method

Guess you like

Origin blog.csdn.net/zww986736788/article/details/131879007