From 4403fef32e7f9ba6e20aa0bd22fdddcca0dbb42a Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 27 Sep 2024 14:02:25 -0400 Subject: [PATCH] Fix flutter format command It was removed in 3.12: https://github.com/flutter/flutter/pull/129360 --- .github/workflows/flutterfmt.sh | 2 +- README.md | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/flutterfmt.sh b/.github/workflows/flutterfmt.sh index 5dfddc8..a003ccb 100755 --- a/.github/workflows/flutterfmt.sh +++ b/.github/workflows/flutterfmt.sh @@ -3,7 +3,7 @@ DIRS="lib test" EXIT=0 for DIR in $DIRS; do - OUT="$(flutter format -l 120 --suppress-analytics "$DIR" | sed -e "s/^Formatted \(.*\)/::error file=$DIR\/\1::Not formatted/g")" + OUT="$(dart format -l 120 --suppress-analytics "$DIR" | sed -e "s/^Formatted \(.*\)/::error file=$DIR\/\1::Not formatted/g")" echo "$OUT" | grep "::error" && EXIT=1 done diff --git a/README.md b/README.md index f302413..ea89994 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,16 @@ If you are having issues with iOS pods, try blowing it all away! `cd ios && rm - # Formatting -`flutter format` can be used to format the code in `lib` and `test` but it's default is 80 char line limit, it's 2020 +`dart format` can be used to format the code in `lib` and `test`. We use a line-length of 120 characters. Use: ```sh -flutter format lib/ test/ -l 120 +dart format lib/ test/ -l 120 ``` +In Android Studio, set the line length using Preferences -> Editor -> Code Style -> Dart -> Line length, set it to 120. Enable auto-format with Preferences -> Languages & Frameworks -> Flutter -> Format code on save. + + # Release Update `version` in `pubspec.yaml` to reflect this release, then @@ -53,4 +56,4 @@ Upload the android bundle to the google play store https://play.google.com/apps/ ## iOS -In xcode, Release -> Archive then follow the directions to upload to the app store. If you have issues, https://flutter.dev/docs/deployment/ios#create-a-build-archive +In xcode, Release -> Archive then follow the directions to upload to the app store. If you have issues, https://flutter.dev/docs/deployment/ios#create-a-build-archive \ No newline at end of file