Learn about building a Flutter environment in the Flutter Chinese community

  1. Download the Dart SDK(currently available in 2.2.2). Try to download the Dart SDK directly to prevent errors if Dart and THE Flutter SDK versions are inconsistent.

  2. Configure the environment variables to ensure that the flutter dart command can find them. When the flutter command is run for the first time, it will automatically download the relevant dependencies, such as the Android SDK. , vaguely remember that there was a bad connection with Java SDK 12 and 8, and finally went to create a java8 alone), then run Flutter doctor,doctor? Diagnose flutter. If you have all the little checks, the environment is pretty much the same

  3. This should be done by making foreign download sites into domestic ones (Baidu knows how to do this) so that they can run the flutter Run.

    But there is a solution:Basically, Flutter requires a Gradle to package the Android code built into it, but this is a bit strange to me… So the root of the problem is to give him a Gradle. Stop! Stop! Download aGradle 5.6.2 -all. Zip(Version of your choice) Where can I find this flutter? Position configuration look here:

    The distribution Base directory is the gradle directory for your system

    Is this directory (my computer) C: \ Users \ lenovo \. Gradle \ wrapper \ dists \ gradle 5.6.2 – all nine st6wgf78h16so49nn74lgtbb \ \ lenovol Is the system directory under my Users, look for yours

Someone asked me no gradle 5.6.2 – all 9 st6wgf78h16so49nn74lgtbb \ \ the strange file directory!!!!!!

You have never had a flutter run failure, so go to the Flutter Run project and it will download Gradle. First create the directory name according to the Gradle version and then go to services.gradle.org Download, at that time is not moving, so zip file download failure, directory left, you put your downloaded ZIP file directly into, do not need to decompress, and then OJBK, you can enter the packaging link!

Adb_server connect 127.0.0.1:7555 (if you have not registered yourself, please configure the ADB_server environment)

  1. It’s up and running!
  2. Because Flutter is a packaged AOT version of APK, the debug and release versions have very different performance

Take a look at common project structures

| -- - | app - assets / / resources/images / | | - images, fonts icon | - jsons / / / / font json data | | - the lib / / | - API interface - common | - Global. Dart / / global variables, static class | | - event / / events of model - the model / / back-end json data directory | | - pages / / page - pagename / / | - each page directory Index. | - widgetName dart / / page. The dart / / page business component routing | - | - routers / / utils / / tools | | - widget / / system components -- the main. Dart / / Project portal | | - android / / android directory - ios / / ios directory | -- pubspec. Yaml / / project dependent (note that the indentationCopy the code

Take a look at common dependency packages

  # network requestDio: ^ 4.0.0# getX or use providerThe get: ^ 4.1.4# Local persistenceShared_preferences: ^ at 2.0.5# josn formattingJson_annotation: ^ 4.0.1# Official IOS Style IconCupertino_icons: ^ 1.0.2# resource lockSynchronized: ^ 3.0.0# Toast promptFluttertoast: ^ 8.0.3Obtain system permissionPermission_handler: ^ 6.1.1# Screen FitFlutter_screenutil: ^ 5.0.0 + 2Copy the code

Good Game