суббота, 15 марта 2025 г.

Flutter, Create App, Run App

Flutter, Create App, Run App

https://giga.chat/link/gcsLwhDIjp

------------------------------------------------------------

(base) PS D:\VC24> cd flutter

(base) PS D:\VC24\flutter> flutter create win_app_01

Creating project win_app_01...

Resolving dependencies in `win_app_01`... (1.9s)

Downloading packages...

Got dependencies in `win_app_01`.

Wrote 130 files.

All done!

You can find general documentation for Flutter at: https://docs.flutter.dev/

Detailed API documentation is available at: https://api.flutter.dev/

If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

---------------------------------------------------------------------

In order to run your application, type:

  $ cd win_app_01

  $ flutter run

Your application code is in win_app_01\lib\main.dart.

(base) PS D:\VC24\flutter> cd win_app_01

(base) PS D:\VC24\flutter\win_app_01> flutter run

Connected devices:

Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.20348.2402]

Chrome (web)      • chrome  • web-javascript • Google Chrome 133.0.6943.99

Edge (web)        • edge    • web-javascript • Microsoft Edge 133.0.3065.82

[1]: Windows (windows)

[2]: Chrome (chrome)

[3]: Edge (edge)

Please choose one (or "q" to quit): 1

Launching lib\main.dart on Windows in debug mode...

Building Windows application...                                    72.2s

√ Built build\windows\x64\runner\Debug\win_app_01.exe

Syncing files to device Windows...                                 398ms


Flutter run key commands.

r Hot reload.

R Hot restart.

h List all available interactive commands.

d Detach (terminate "flutter run" but leave application running).

c Clear the screen

q Quit (terminate the application on the device).


A Dart VM Service on Windows is available at: http://127.0.0.1:52169/dhKlKHBOzaw=/

The Flutter DevTools debugger and profiler on Windows is available at:

http://127.0.0.1:9100?uri=http://127.0.0.1:52169/dhKlKHBOzaw=/

Lost connection to device.

(base) PS D:\VC24\flutter\win_app_01>


Flutter, Install, powershell

https://docs.flutter.dev/get-started/install/windows/desktop

https://dartpad.dev/?id=bbd3f10c2593f0add04dd770318b33f7

https://giga.chat/link/gcsLwhDIjp

D:\Tools\flutter
Powershell:

Expand-Archive -Path flutter_windows_3.29.2-stable.zip -Destination d:\Tools\

Установка Flutter для Windows

  1. Установка Flutter SDK:
    • Скачай последнюю версию Flutter SDK с официального сайта:
    • https://flutter.dev/docs/get-started/install/windows.
    • Распакуй архив в удобное место, например, C:\src\flutter.
  2. Добавление пути к переменной окружения:
    • Открой панель управления Windows и перейди в раздел
    • "Система > Дополнительные параметры системы > Переменные среды".
    • Добавь путь к папке bin в Flutter SDK в переменную PATH.
    • Например, если Flutter установлен в C:\src\flutter, добавь C:\src\flutter\bin.
  3. Проверка установки:
    • Открой командную строку и введи команду flutter doctor.
    • Эта команда проверяет правильность установки
    • и наличия необходимых зависимостей.
    • Если возникнут ошибки, следуй инструкциям для их исправления.
  4. Установка плагинов для редактора:
    • Установи расширение Flutter и Dart для своего любимого редактора кода,
    • например, Visual Studio Code или Android Studio.

Настройка среды для разработки под Windows

  1. Установи Visual Studio с необходимыми компонентами:
    • Загрузи и установи последнюю версию Visual Studio Community Edition:
    • https://visualstudio.microsoft.com/downloads/.
    • Убедись, что выбраны следующие компоненты:
      • "Desktop development with C++" (для разработки нативных компонентов).
      • "Universal Windows Platform development" (для сборки UWP-приложений).
  2. Убедись, что установлена последняя версия Windows SDK:
    • В Visual Studio открой "Tools > Get Tools and Features" и убедись,
    • что установлены последние версии Windows SDK.
  3. Настройка Flutter для работы с Windows:
    • В командной строке выполните команду
    • flutter config --enable-windows-desktop.
    • Проверь статус поддержки Windows командой flutter devices.
    • Должен появиться список доступных устройств, включая Windows.

Создание нового проекта Flutter для Windows

  1. Создай новый проект Flutter:
    • В терминале выполни команду flutter create my_windows_app.
  2. Запуск приложения:
    • Перейди в директорию проекта: cd my_windows_app.
    • Запусти приложение командой flutter run -d windows.
  3. ---------------------------------------------------
  4. (base) PS C:\Users\Administrator> flutter doctor Building flutter tool... Running pub upgrade... Resolving dependencies... (1.6s) Downloading packages... (43.9s) Got dependencies. ╔════════════════════════════════════════════════════════════════════════════╗ ║ Welcome to Flutter! - https://flutter.dev ║ ║ ║ ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║ ║ statistics and basic crash reports. This data is used to help improve ║ ║ Flutter tools over time. ║ ║ ║ ║ Flutter tool analytics are not sent on the very first run. To disable ║ ║ reporting, type 'flutter config --no-analytics'. To display the current ║ ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out ║ ║ event will be sent, and then no further information will be sent by the ║ ║ Flutter tool. ║ ║ ║ ║ By downloading the Flutter SDK, you agree to the Google Terms of Service. ║ ║ The Google Privacy Policy describes how data is handled in this service. ║ ║ ║ ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and ║ ║ crash reports to Google. ║ ║ ║ ║ Read about data we send with crash reports: ║ ║ https://flutter.dev/to/crash-reporting ║ ║ ║ ║ See Google's privacy policy: ║ ║ https://policies.google.com/privacy ║ ║ ║ ║ To disable animations in this tool, use ║ ║ 'flutter config --no-cli-animations'. ║ ╚════════════════════════════════════════════════════════════════════════════╝ Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.20348.2402], locale en-US) [√] Windows Version (Windows 10, 21H2, 2009) [X] Android toolchain - develop for Android devices X Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/to/windows-android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location. [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.13.2) [!] Android Studio (not installed) [√] VS Code, 64-bit edition (version 1.97.2) [√] Connected device (3 available) [√] Network resources ! Doctor found issues in 2 categories. -------------------------------------------------------- (base) PS C:\Users\Administrator> flutter config --enable-windows_desktop Could not find an option named "--enable-windows_desktop". Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options. (base) PS C:\Users\Administrator> flutter config --enable-windows-desktop Setting "enable-windows-desktop" value to "true". You may need to restart any open editors for them to read new settings. (base) PS C:\Users\Administrator> flutter devices Found 3 connected devices: Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.20348.2402] Chrome (web) • chrome • web-javascript • Google Chrome 133.0.6943.99 Edge (web) • edge • web-javascript • Microsoft Edge 133.0.3065.82 Run "flutter emulators" to list and start any available device emulators. If you expected another device to be detected, please run "flutter doctor" to diagnose potential issues. You may also try increasing the time to wait for connected devices with the "--device-timeout" flag. Visit https://flutter.dev/setup/ for troubleshooting tips.
  5. -----------------------------------------------------------------------------------------------
  6. START
  7. ----------------------------------------------------------------------------------------------- (base) PS C:\Users\Administrator> flutter create my_windows_app Creating project my_windows_app... Resolving dependencies in `my_windows_app`... Downloading packages... Got dependencies in `my_windows_app`. Wrote 130 files. All done! You can find general documentation for Flutter at: https://docs.flutter.dev/ Detailed API documentation is available at: https://api.flutter.dev/ If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev In order to run your application, type: $ cd my_windows_app $ flutter run Your application code is in my_windows_app\lib\main.dart. (base) PS C:\Users\Administrator> cd my_windows_app (base) PS C:\Users\Administrator\my_windows_app> flutter run Connected devices: Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.20348.2402] Chrome (web) • chrome • web-javascript • Google Chrome 133.0.6943.99 Edge (web) • edge • web-javascript • Microsoft Edge 133.0.3065.82 [1]: Windows (windows) [2]: Chrome (chrome) [3]: Edge (edge) Please choose one (or "q" to quit): 1 Launching lib\main.dart on Windows in debug mode... Building Windows application... 72.8s √ Built build\windows\x64\runner\Debug\my_windows_app.exe Syncing files to device Windows... 157ms Flutter run key commands. r Hot reload. R Hot restart. h List all available interactive commands. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device). A Dart VM Service on Windows is available at: http://127.0.0.1:56669/jxyshH6Nb6g=/ The Flutter DevTools debugger and profiler on Windows is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:56669/jxyshH6Nb6g=/ Lost connection to device. (base) PS C:\Users\Administrator\my_windows_app> flutter run Connected devices: Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.20348.2402] Chrome (web) • chrome • web-javascript • Google Chrome 133.0.6943.99 Edge (web) • edge • web-javascript • Microsoft Edge 133.0.3065.82 [1]: Windows (windows) [2]: Chrome (chrome) [3]: Edge (edge) Please choose one (or "q" to quit): 3 Launching lib\main.dart on Edge in debug mode... Waiting for connection from debug service on Edge... 18.0s This app is linked to the debug service: ws://127.0.0.1:57044/QYfyaUBekNE=/ws Debug service listening on ws://127.0.0.1:57044/QYfyaUBekNE=/ws To hot restart changes while running, press "r" or "R". For a more detailed help message, press "h". To quit, press "q". A Dart VM Service on Edge is available at: http://127.0.0.1:57044/QYfyaUBekNE= The Flutter DevTools debugger and profiler on Edge is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:57044/QYfyaUBekNE= Application finished. (base) PS C:\Users\Administrator\my_windows_app>

Flutter, Create App, Run App

Flutter, Create App, Run App https://giga.chat/link/gcsLwhDIjp ------------------------------------------------------------ (base) PS D:\VC2...