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 common_flutter_home="${HOME}/.local/opt/flutter"
22 new_flutter_home="${HOME}/.local/opt/flutter-v${WEBI_VERSION}"
23 new_flutter="${HOME}/.local/opt/flutter-v${WEBI_VERSION}/bin/flutter"
25 # Test for existing version
27 cur_flutter="$(command -v flutter)"
29 if [ -n "$cur_flutter" ]; then
30 cur_ver=$(flutter --version | head -n 1 | cut -d' ' -f2)
31 if [ "$cur_ver" == "$(echo $WEBI_VERSION)" ]; then
32 echo "flutter v$WEBI_VERSION already installed at $cur_flutter"
34 elif [ "$cur_flutter" != "$new_flutter" ]; then
35 echo "WARN: possible conflict with flutter v$WEBI_VERSION at $cur_flutter"
43 pushd "${WEBI_TMP}" 2>&1 >/dev/null
44 echo Installing flutter v${WEBI_VERSION} as "$new_flutter"
46 # simpler for single-binary commands
47 #mv ./example*/bin/example "$HOME/.local/bin"
49 # best for packages and toolchains
50 rm -rf "$new_flutter_home"
51 if [ -n "$(command -v rsync 2>/dev/null | grep rsync)" ]; then
52 rsync -Krl ./flutter*/ "$new_flutter_home/" 2>/dev/null
54 cp -Hr ./flutter*/* "$new_flutter_home/" 2>/dev/null
55 cp -Hr ./flutter*/.* "$new_flutter_home/" 2>/dev/null
64 # TODO get better output from pathman / output the path to add as return to webi bootstrap
65 webi_path_add "$new_flutter_home/bin"
66 echo "Installed 'flutter'"