demo-flutter-hello-world

所属分类:开发工具
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2020-08-20 01:23:16
上 传 者sh-1993
说明:  Flutter Google UI工具包、Dart编程语言、Android Studio IDE和“Hello World”应用程序的演示,
(Demo of Flutter Google UI toolkit, Dart programming language, Android Studio IDE, and "Hello World" app,)

文件列表:
.metadata (305, 2020-08-19)
android/ (0, 2020-08-19)
android/app/ (0, 2020-08-19)
android/app/build.gradle (1783, 2020-08-19)
android/app/src/ (0, 2020-08-19)
android/app/src/debug/ (0, 2020-08-19)
android/app/src/debug/AndroidManifest.xml (344, 2020-08-19)
android/app/src/main/ (0, 2020-08-19)
android/app/src/main/AndroidManifest.xml (2606, 2020-08-19)
android/app/src/main/kotlin/ (0, 2020-08-19)
android/app/src/main/kotlin/com/ (0, 2020-08-19)
android/app/src/main/kotlin/com/example/ (0, 2020-08-19)
android/app/src/main/kotlin/com/example/demo_flutter_hello_world/ (0, 2020-08-19)
android/app/src/main/kotlin/com/example/demo_flutter_hello_world/MainActivity.kt (141, 2020-08-19)
android/app/src/main/res/ (0, 2020-08-19)
android/app/src/main/res/drawable/ (0, 2020-08-19)
android/app/src/main/res/drawable/launch_background.xml (434, 2020-08-19)
android/app/src/main/res/mipmap-hdpi/ (0, 2020-08-19)
android/app/src/main/res/mipmap-hdpi/ic_launcher.png (544, 2020-08-19)
android/app/src/main/res/mipmap-mdpi/ (0, 2020-08-19)
android/app/src/main/res/mipmap-mdpi/ic_launcher.png (442, 2020-08-19)
android/app/src/main/res/mipmap-xhdpi/ (0, 2020-08-19)
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (721, 2020-08-19)
android/app/src/main/res/mipmap-xxhdpi/ (0, 2020-08-19)
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (1031, 2020-08-19)
android/app/src/main/res/mipmap-xxxhdpi/ (0, 2020-08-19)
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (1443, 2020-08-19)
android/app/src/main/res/values/ (0, 2020-08-19)
android/app/src/main/res/values/styles.xml (951, 2020-08-19)
android/app/src/profile/ (0, 2020-08-19)
android/app/src/profile/AndroidManifest.xml (344, 2020-08-19)
android/build.gradle (582, 2020-08-19)
android/gradle.properties (104, 2020-08-19)
android/gradle/ (0, 2020-08-19)
android/gradle/wrapper/ (0, 2020-08-19)
android/gradle/wrapper/gradle-wrapper.properties (233, 2020-08-19)
android/settings.gradle (462, 2020-08-19)
... ...

# Demo Flutter "Hello World" Demonstrate: * Flutter Google UI toolkit * Dart programming language * Android Studio IDE * Simple "Hello World" application Contents: * [Preflight](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#preflight) * [Install Android Studio](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#install-android-studio) * [Install Intel HAXM](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#install-intel-haxm) * [Install Flutter](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#install-flutter) * [Install plugins for Flutter and Dart](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#install-plugins-for-flutter-and-dart) * [Create Flutter "Hello World" application](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#create-flutter-hello-world-application) * [Create the source code](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#create-the-source-code) * [Choose the SDK](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#choose-the-sdk) * [Update the SDK](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#update-the-sdk) * [Create an Android Virtual Device (AVD)](https://github.com/joelparkerhenderson/demo-flutter-hello-world/blob/master/#create-an-android-virtual-device-avd) ## Preflight ### Install Android Studio Install Android Studio Integrated Development Environment (IDE): ```sh brew cask install android-studio ``` ### Install Intel HAXM Install Intel Hardware Accelerated Execution Manager (HAXM) accelerator for Android Emulator: ```sh brew cask install intel-haxm ``` Verify the kernel extensions load HAXM: ```sh kextstat | grep com.intel.kext.intelhaxm ``` ### Install Flutter There are various ways to install Flutter on macOS, such as via file download, or via homebrew, or via git clone, etc. We prefer to install Flutter this way: * Install via git clone, because we prefer git over a Flutter website file download. * Clone the entire repo, because it includes upcoming versions that we want for testing. * Move it to the directory `/opt/flutter` because this is where we prefer software packages. ```sh git clone https://github.com/flutter/flutter.git sudo mv flutter /opt ``` Append the path: ```sh export PATH="$PATH:/opt/flutter/bin" ``` Typically you will add the path to your own shell configuration file such as `.zshrc`. Verify: ```sh flutter doctor ``` Output such as: ```sh Downloading Dart SDK... Building flutter tool... ``` Accept licenses: ```sh flutter doctor --android-licenses ``` Precache: ```sh flutter precache ``` ### Install plugins for Flutter and Dart Launch Android Studio. Choose "Plugins". Install the plugin "Flutter" and the plugin "Dart". ## Create Flutter "Hello World" application ### Create the source code Launch Android Studio. Create a new Flutter app. For this demo, we use these settings: * Project name: `demo_flutter_hello_world` * Flutter SDK path: `/opt/flutter` * Project location: `~/git/joelparkerhenderson/` * Description: Demonstrate Flutter "Hello World" application. * Package name: com.joelparkerhenderson.demoflutterhelloworld Android Studio should launch a typical source code editor. ### Choose the SDK Use menu "File" -> "Project Structure" -> "Project Settings" -> "Project". Select the SDK, which is set to [No SDK] by default. We choose "Android API 29 Platform". If there's nothing in the drop-down box, then select New, select Android SDK, navigate to your Android SDK location, then select the Android API Platform. ### Update the SDK Use menu "Tools" -> "SDK Manager". This opens Settings -> Appearance & Behavior -> System Settings -> Android SDK. Choose the tab "SDK Tools". Click the "Edit" link next to the "Android SDK Location" box. This opens a new dialog for SDK Components Setup. You should now see that "Android SDK - (installed)" has a tick in the checkbox, as do any SDK Platforms you have. Click on the button "Next" then your SDK will update. ### Create an Android Virtual Device (AVD) An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator. Use menu "Tools" -> "AVD Manager". We prefer to create a phone virtual device, so we choose "Phone". We prefer to create a "Pixel 3a" virtual device, because it's a decent typical phone. We prefer to use the newest stable operating system, which at the time of writing is "Q". Android Studio should now create the AVD Phone Pixel 3a with R operating system. ### Run the app Use menu "Run" -> "Run". You may see two options for "main.dart": one has a Dart icon, one has a Flutter icon. Choose the Flutter one. Android Studio should show the bottom status bar work in progress, such as: Running Gradle task 'assembleDebug'. This may take a while (e.g. 10 minutes) because Android Studio may need to download more software. Output: ``` Launching lib/main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... Built build/app/outputs/flutter-apk/app-debug.apk. Installing build/app/outputs/flutter-apk/app.apk... Waiting for Android SDK built for x86 to report its views... Debug service listening on ws://127.0.0.1:52415/5w3MSveafuk=/ws Syncing files to device Android SDK built for x86... ``` The emulator should launch the app, and should show the main page, titled "Flutter Demo Home Page".

近期下载者

相关文件


收藏者