Flutter CLI

FlutterGen

ΠžΡ‚Π²Π΅Ρ‡Π°Π΅Ρ‚ Π·Π° ΠΊΠΎΠ΄ΠΎΠ³Π΅Π½Π΅Ρ€Π°Ρ†ΠΈΡŽ ΠΈ Ρ€Π°Π±ΠΎΡ‚Ρƒ с ассСтами Π² Flutter

link: https://pub.dev/packages/flutter_gen

Flutter Version Manager

Как для node β€” nvm, Ρ‚Π°ΠΊ для flutter β€” fvm:

fvm flutter ...

Create project

$ flutter create myapp
$ cd myapp

Devices

$ flutter devices
1 connected device:

Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 95.0.4638.69
$ ...

Run

МоТСм Π·Π°ΠΏΡƒΡΡ‚ΠΈΡ‚ΡŒ Ρ‡Π΅Ρ€Π΅Π· VS Code:

  • Command Palette: > Flutter: Run Project

  • Π§Π΅Ρ€Π΅Π· Debug and Run

Π§Π΅Ρ€Π΅Π· cmd Π² ΠΊΠΎΡ€Π½Π΅, Π³Π΄Π΅ Π»Π΅ΠΆΠΈΡ‚ pubspec.yaml:

$ flutter run [-d chrome] [--release]

Π—Π΄Π΅ΡΡŒ ΠΌΠΎΠΆΠ½ΠΎ Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ Π² VS Code Ρ‡Π΅Ρ€Π΅Π· ΠΊΠ°ΠΊΠΎΠ΅ устройство Π·Π°ΠΏΡƒΡΠΊΠ°Ρ‚ΡŒ

Если запускали Ρ‡Π΅Ρ€Π΅Π· консоль, ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ Π³ΠΎΡ€ΡΡ‡ΡƒΡŽ ΠΊΠ»Π°Π²ΠΈΡˆΡƒ r для пСрСзапуска прилоТСния ΠΈ отобраТСния ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ (Hot Reload).

Build

Π‘ ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ dart2js собираСм ΠΎΠ΄ΠΈΠ½ JS-Ρ„Π°ΠΉΠ» main.dart.js.

$ flutter build web

Format Code

  • Android Studio and IntelliJ IDEA: Right-click the code and select Reformat Code with dartfmt.

  • VS Code: Right-click and select Format Document.

  • Terminal: Run flutter format <filename>.

Add dependencies

ДобавляСм Π² pubspec.yaml зависимости ΠΈ запускаСм flutter pub get ΠΈΠ»ΠΈ ΠΆΠΌΠ΅ΠΌ Π² IDE Pub Get.

Last updated