QC

Cách cài đặt flutter

 

Start building Flutter Android apps on Windows

Verify system requirements

#

To install and run Flutter, your Windows environment must meet the following hardware and software requirements.

Hardware requirements

#

Your Windows Flutter development environment must meet the following minimal hardware requirements.

RequirementMinimumRecommended
x86_64 CPU Cores48
Memory in GB816
Display resolution in pixelsWXGA (1366 x 768)FHD (1920 x 1080)
Free disk space in GB11.060.0

Software requirements

#

To write and compile Flutter code for Android, you must have the following version of Windows and the listed software packages.

Operating system

#

Flutter supports 64-bit version of Microsoft Windows 10 or later. These versions of Windows should include the required Windows PowerShell 5 or later.

Development tools

#

Download and install the Windows version of the following packages:

The developers of the preceding software provide support for those products. To troubleshoot installation issues, consult that product's documentation.

When you run the current version of flutter doctor, it might list a different version of one of these packages. If it does, install the version it recommends.

Configure a text editor or IDE

#

You can build apps with Flutter using any text editor or integrated development environment (IDE) combined with Flutter's command-line tools.

Using an IDE with a Flutter extension or plugin provides code completion, syntax highlighting, widget editing assists, debugging, and other features.

Popular options include:

Install the Flutter SDK

#

To install the Flutter SDK, you can use the VS Code Flutter extension or download and install the Flutter bundle yourself.

Download then install Flutter

#

To install Flutter, download the Flutter SDK bundle from its archive, move the bundle to where you want it stored, then extract the SDK.

  1. Download the following installation bundle to get the latest stable release of the Flutter SDK.

    flutter_windows_3.19.5-stable.zip

    For other release channels, and older builds, check out the SDK archive.

    The Flutter SDK should download to the Windows default download directory: %USERPROFILE%\Downloads.

    If you changed the location of the Downloads directory, replace this path with that path. To find your Downloads directory location, check out this Microsoft Community post.

  2. Create a folder where you can install Flutter.

    Consider creating a directory at %USERPROFILE% (C:\Users\{username}) or %LOCALAPPDATA% (C:\Users\{username}\AppData\Local).

  3. Extract the zip file into the directory you want to store the Flutter SDK.

    C:> Expand-Archive `
        –Path $env:USERPROFILE\Downloads\flutter_windows_3.19.5-stable.zip `
        -Destination $env:USERPROFILE\dev\

    When finished, the Flutter SDK should be in the C:\user\{username}\dev\flutter directory.

Update your Windows PATH variable

#



To run Flutter commands in PowerShell, add Flutter to the PATH environment variable. This section presumes that you installed the Flutter SDK in %USERPROFILE%\dev\flutter.

  1. Press Windows + Pause.

    If your keyboard lacks a Pause key, try Windows + Fn + B.

    The System > About dialog displays.

  2. Click Advanced System Settings > Advanced > Environment Variables...

    The Environment Variables dialog displays.

  3. In the User variables for (username) section, look for the Path entry.

    1. If the entry exists, double-click on it.

      The Edit Environment Variable dialog displays.

      1. Double-click in an empty row.

      2. Type %USERPROFILE%\dev\flutter\bin.

      3. Click the %USERPROFILE%\dev\flutter\bin entry.

      4. Click Move Up until the Flutter entry sits at the top of the list.

      5. Click OK three times.

    2. If the entry doesn't exist, click New....

      The Edit Environment Variable dialog displays.

      1. In the Variable Name box, type Path.

      2. In the Variable Value box, type %USERPROFILE%\dev\flutter\bin

      3. Click OK three times.

  4. To enable these changes, close and reopen any existing command prompts and PowerShell instances.

Configure Android development

#

Configure the Android toolchain in Android Studio

#



To create Android apps with Flutter, verify that the following Android components have been installed.

  • Android SDK Platform, API 34.0.0
  • Android SDK Command-line Tools
  • Android SDK Build-Tools
  • Android SDK Platform-Tools
  • Android Emulator

If you haven't installed these, or you don't know, continue with the following procedure.

Otherwise, you can skip to the next section.

  1. Launch Android Studio.

    The Welcome to Android Studio dialog displays.

  2. Follow the Android Studio Setup Wizard.

  3. Install the following components:

    • Android SDK Platform, API 34.0.0
    • Android SDK Command-line Tools
    • Android SDK Build-Tools
    • Android SDK Platform-Tools
    • Android Emulator

Configure your target Android device

#

Set up the Android emulator

#

helpHelp

To configure your Flutter app to run in an Android emulator, follow these steps to create and select an emulator.

  1. Enable VM acceleration on your development computer.

  2. Start Android Studio.

  3. Go to the Settings dialog to view the SDK Manager.

    1. If you have a project open, go to Tools > Device Manager.

    2. If the Welcome to Android Studio dialog displays, click the More Options icon that follows the Open button and click Device Manager from the dropdown menu.

  4. Click Virtual.

  5. Click Create Device.

    The Virtual Device Configuration dialog displays.

  6. Select either Phone or Tablet under Category.

  7. Select a device definition. You can browse or search for the device.

  8. Click Next.

  9. Click x86 Images.

  10. Click one system image for the Android version you want to emulate.

    1. If the desired image has a Download icon to the right of the Release Name, click it.

      The SDK Quickfix Installation dialog displays with a completion meter.

    2. When the download completes, click Finish.

  11. Click Next.

    The Virtual Device Configuration displays its Verify Configuration step.

  12. To rename the Android Virtual Device (AVD), change the value in the AVD Name box.

  13. Click Show Advanced Settings and scroll to Emulated Performance.

  14. From the Graphics dropdown menu, select Hardware - GLES 2.0.

    This enables hardware acceleration and improves rendering performance.

  15. Verify your AVD configuration. If it is correct, click Finish.

    To learn more about AVDs, check out Managing AVDs.

  16. In the Device Manager dialog, click the Run icon to the right of your desired AVD. The emulator starts up and displays the default canvas for your selected Android OS version and device.

Agree to Android licenses

#

helpHelp

Before you can use Flutter and after you install all prerequisites, agree to the licenses of the Android SDK platform.

  1. Open an elevated console window.

  2. Run the following command to enable signing licenses.

    C:> flutter doctor --android-licenses

    If you accepted the Android Studio licenses at another time, this command returns:

    [========================================] 100% Computing updates...
    All SDK package licenses accepted.

    You can skip the next step.

  3. Before agreeing to the terms of each license, read each with care.

Troubleshooting licensing issues

#
How to fix the error of finding Java install

Check your development setup

#



Run Flutter doctor

#

The flutter doctor command validates that all components of a complete Flutter development environment for Windows.

  1. Open PowerShell.

  2. To verify your installation of all the components, run the following command.

    C:> flutter doctor

As you chose to develop for , you do not need all components. If you followed this guide, the result of your command should resemble:

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.3, on Microsoft Windows 11 [Version 10.0.22621.3155], locale en)
[✓] Windows version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[!] Chrome - develop for the web
[!] Visual Studio - develop Windows apps
[✓] Android Studio (version 2023.1 (Hedgehog) or later)
[✓] VS Code (version 1.86)
[✓] Connected device (1 available)
[✓] Network resources


! Doctor found issues in 2 categories.

Troubleshoot Flutter doctor issues

#

When the flutter doctor command returns an error, it could be for Flutter, VS Code, , the connected device, or network resources.

If the flutter doctor command returns an error for any of these components, run it again with the verbose flag.

C:> flutter doctor -v

Check the output for other software you might need to install or further tasks to perform.

If you change the configuration of your Flutter SDK or its related components, run flutter doctor again to verify the installation.

Start developing on Windows apps with Flutter

#

Congratulations! Now that you have installed all prerequisites and the Flutter SDK, you should be able to start developing Flutter apps for on Windows.

Error No module Onnx opencv

 Error No module Onnx opencv Lệnh :  pip install onnx==1.9 Mã lỗi PS F:\opencv_e\2.video> & C:/Users/youtb/Anaconda3/envs/virtualenv/...