4 # homepage: https://flutter.dev
5 # tagline: UI Toolkit for mobile, web, and desktop
7 # Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.
11 # flutter create my_app
21 new_flutter_home="${HOME}/.local/opt/flutter-v${WEBI_VERSION}"
22 new_flutter="${HOME}/.local/opt/flutter-v${WEBI_VERSION}/bin/flutter"
24 # Test for existing version
26 cur_flutter="$(command -v flutter)"
28 if [ -n "$cur_flutter" ]; then
29 cur_ver=$(flutter --version | head -n 1 | cut -d' ' -f2)
30 if [ "$cur_ver" == "$(echo $WEBI_VERSION)" ]; then
31 echo "flutter v$WEBI_VERSION already installed at $cur_flutter"
33 elif [ "$cur_flutter" != "$new_flutter" ]; then
34 echo "WARN: possible conflict with flutter v$WEBI_VERSION at $cur_flutter"
42 pushd "${WEBI_TMP}" 2>&1 >/dev/null
43 echo Installing flutter v${WEBI_VERSION} as "$new_flutter"
45 # simpler for single-binary commands
46 #mv ./example*/bin/example "$HOME/.local/bin"
48 # best for packages and toolchains
49 rm -rf "$new_flutter_home"
50 if [ -n "$(command -v rsync 2>/dev/null | grep rsync)" ]; then
51 rsync -Krl ./flutter*/ "$new_flutter_home/" 2>/dev/null
53 cp -Hr ./flutter*/* "$new_flutter_home/" 2>/dev/null
54 cp -Hr ./flutter*/.* "$new_flutter_home/" 2>/dev/null
62 # TODO get better output from pathman / output the path to add as return to webi bootstrap
63 webi_path_add "$new_flutter_home/bin"
64 echo "Installed 'flutter'"