This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

📒 [comments have prizes] “Welcome to the discussion in the comments section, the nuggets will draw 100 nuggets in the comments section after the end of diggnation project, see the event article for details of the lucky draw”!

📝 [Flutter] learning to form a record, [programmer essential knowledge]

📔 Today’s knowledge — Flutter operation project practice!

1. Create a project on the CLI

Before creating a flutter project, run the Flutter doctor command to check if there is a problem with your flutter environment.

There is no error ❌, which means that the flutter environment is OK. Use flutter create flutterDemo to create a flutter project.

According to the error message, there is something wrong with our project name.

FlutterDemo "is not a valid Dart package name

why ? Big question mark, this name has no problem ah, why not support it? We’re used to hump naming, but Dart doesn’t support hump naming! Since there is no support for hump naming, change the name!

New project succeeded

Just follow the instructions, CD first_flutterdemo open the project directory and flutter Run the project.

2. Run your first FLUTTER project

The first run was a little slow, so I checked the environment a little bit, and then it was a lot faster.

  • After the first run, there will be a prompt like this: There are some shortcuts to use during the run!

  • The interface running in the simulator is as follows:

  • flutterThe structure of the project file is as follows:

Directory inside android and iOS projects are available, a code, multi-terminal use 👍🏻!

3. Xcode opens the Flutter project

Because Flutter is cross-platform and contains both Android and iOS projects, we can double-click to open the iOS project. By default, the Swift project is generated.

Open the iOS project as follows:

Xcode runs the iOS project as follows:

By default, ios is a Swift project and Android is kotlin. You can also modify the created project language by using the flutter create –help command

Create an OC project with flutter create -i objc flutter_objcdemo.

Tip:

We don’t use Xcode to write flutter, and it doesn’t support DART.

4. New Android Studio projects

Android Studio new project

Android Studio creates a New Flutter project

Click ➕ to create a Flutter project and enter the following screen

Fill in the project name, project language, supported platform and so on! (I will not create a new project here, I will directly open the previous project!)

The directory results are the same as those in the folder, almost in the same order. We write the Dart code under the Lib folder.

You can drop down to select emulator running projects

Open the simulator open-a Simulatoer in the terminal. If there are multiple simulators, it will prompt you to select one to run the project, as shown below:

Select one of the simulators to run the FLUTTER project

5. Write in the back

Follow me, more content continues to output

📒 [comments have prizes] “Welcome to the discussion in the comments section, the nuggets will draw 100 nuggets in the comments section after the end of diggnation project, see the event article for details of the lucky draw”!

  • CSDN
  • The Denver nuggets
  • Jane’s book

🌹 if you like, give it a thumbs up 👍🌹

🌹 feel harvest, can come to a wave of collection + attention, so as not to find you next time I 😁🌹

🌹 welcome everyone to leave a message exchange, criticism and correction, forwarding please indicate the source, thank you for your support! 🌹