2024-03-05 00:34:31 +01:00

1.7 KiB

Implementierung

Grundaufbau

Entwicklungsumgebung

Flutter Version Management

Zur Installation von Flutter und Dart empfiehlt sich ein Version Manager. Der bekannteste Version Manager ist FVM (Flutter Version Management), doch der neuere Manager Puro bietet viele Vorteile.

MacOS und Linux

curl -o- https://puro.dev/install.sh | PURO_VERSION="1.4.4" bash

Windows

Invoke-WebRequest -Uri "https://puro.dev/builds/1.4.4/windows-x64/puro.exe" -OutFile "$env:temp\puro.exe"; &"$env:temp\puro.exe" install-puro --promote

Puro Optimierungen:

  • parallel git clone and engine download
  • global cache for git history
  • global cache for engine versions

With other approaches, each Flutter repository is in its own folder, requiring you to download and store the git history, engine, and framework of each version:

Puro implements a technology similar to GitLab's object deduplication to avoid downloading the same git objects over and over again. It also uses symlinks to share the same engine version between multiple installations:

puro use -g stable
puro create bachelor_elinux 3.19.0
puro use bachelor_elinux

.puro.json:

{
  "env": "bachelor_elinux"
}

.vscode/settings.json

{
  "dart.flutterSdkPath": "/Users/fabian/.puro/envs/bachelor_elinux/flutter",
  "dart.sdkPath": "/Users/fabian/.puro/envs/bachelor_elinux/flutter/bin/cache/dart-sdk"
}
puro flutter --version
Flutter 3.19.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision bae5e49bc2 (6 days ago) • 2024-02-13 17:46:18 -0800
Engine • revision 04817c99c9
Tools • Dart 3.3.0 • DevTools 2.31.1

Setup von Raspberry Pi