diff --git a/.github/workflows/example.yaml b/.github/workflows/example.yaml index f63577c..6d07c2d 100644 --- a/.github/workflows/example.yaml +++ b/.github/workflows/example.yaml @@ -19,7 +19,7 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 with: - flutter_channel: stable + flutter_version: 3.32.0 spell-check: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 89d533e..c5a1700 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,10 +15,10 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1 with: - dart_sdk: '3.5.0' # The minimum Dart SDK version supported by the package. - format_directories: 'lib test' + dart_sdk: 3.8.0 + format_directories: "lib test" check_ignore: true - report_on: 'lib,test' + report_on: "lib,test" no_example: true spell-check: @@ -31,23 +31,4 @@ jobs: modified_files_only: false pana: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4.1.1 - - - uses: subosito/flutter-action@v2 - with: - flutter-version: "3.24.0" #Forcing to 3.24.0 for right now as pana has an issue with Dart 3.6 https://github.com/dart-lang/dartdoc/issues/3947 - - - name: Install Dependencies - run: | - flutter packages get - flutter pub global activate pana - - - name: Verify Pub Score - run: | - PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p") - echo "score: $PANA_SCORE" - IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1] - if (( $SCORE < $TOTAL )); then echo "minimum score not met!"; exit 1; fi + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/pana.yml@v1 diff --git a/analysis_options.yaml b/analysis_options.yaml index c2f4cbb..9df80aa 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1 @@ -include: package:very_good_analysis/analysis_options.7.0.0.yaml +include: package:very_good_analysis/analysis_options.yaml diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index c59316b..ce42cd4 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.7.0.0.yaml +include: package:very_good_analysis/analysis_options.yaml linter: rules: public_member_api_docs: false diff --git a/example/lib/main.dart b/example/lib/main.dart index 4c50bb6..a5597ec 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -61,7 +61,7 @@ class _MyFormState extends State { try { await _submitForm(); _state = _state.copyWith(status: FormzSubmissionStatus.success); - } catch (_) { + } on Exception catch (_) { _state = _state.copyWith(status: FormzSubmissionStatus.failure); } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 7c14d34..efc13ac 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^7.0.0 + very_good_analysis: ^9.0.0 flutter: uses-material-design: true diff --git a/example/test/main_test.dart b/example/test/main_test.dart index c389ba0..33ebdc5 100644 --- a/example/test/main_test.dart +++ b/example/test/main_test.dart @@ -7,11 +7,9 @@ import 'package:mocktail/mocktail.dart'; class MockRandom extends Mock implements Random {} - final _seed = MockRandom(); void main() { - group('$MyApp', () { testWidgets('render example', (tester) async { await tester.pumpWidget(const MyApp()); @@ -20,9 +18,8 @@ void main() { }); group('$MyForm', () { - setUp(() { - when(()=> _seed.nextInt(any())).thenReturn(1); + when(() => _seed.nextInt(any())).thenReturn(1); }); testWidgets('submits valid values', (tester) async { @@ -113,7 +110,9 @@ void main() { await tester.pumpAndSettle(); expect( - find.text('''Password must be at least 8 characters and contain at least one letter and number'''), + find.text( + '''Password must be at least 8 characters and contain at least one letter and number''', + ), findsOneWidget, ); }); @@ -137,7 +136,9 @@ void main() { await tester.pumpAndSettle(); expect( - find.text('''Password must be at least 8 characters and contain at least one letter and number'''), + find.text( + '''Password must be at least 8 characters and contain at least one letter and number''', + ), findsOneWidget, ); }); diff --git a/lib/formz.dart b/lib/formz.dart index bb7d9b8..2639574 100644 --- a/lib/formz.dart +++ b/lib/formz.dart @@ -15,7 +15,7 @@ enum FormzSubmissionStatus { failure, /// The form submission has been canceled. - canceled + canceled, } /// Useful extensions on [FormzSubmissionStatus] diff --git a/pubspec.yaml b/pubspec.yaml index e3c523b..47f17c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,11 +8,11 @@ documentation: https://github.com/VeryGoodOpenSource/formz version: 0.8.0 environment: - sdk: ^3.5.0 + sdk: ^3.8.0 dependencies: meta: ^1.7.0 dev_dependencies: test: ^1.16.0 - very_good_analysis: ^7.0.0 + very_good_analysis: ^9.0.0 diff --git a/test/formz_test.dart b/test/formz_test.dart index f75730d..442fb8a 100644 --- a/test/formz_test.dart +++ b/test/formz_test.dart @@ -97,8 +97,7 @@ void main() { expect(NameInput.dirty(value: 'joe').error, isNull); }); - test( - 'error is NameInputError.empty ' + test('error is NameInputError.empty ' 'if super.dirty is used and input is invalid', () { expect(NameInput.dirty().error, NameInputError.empty); }); @@ -136,11 +135,12 @@ void main() { }); test( - 'isNotValid is true if super.dirty is used ' - 'and input is invalid', () { - expect(NameInput.dirty().isValid, isFalse); - expect(NameInput.dirty().isNotValid, isTrue); - }); + 'isNotValid is true if super.dirty is used and input is invalid', + () { + expect(NameInput.dirty().isValid, isFalse); + expect(NameInput.dirty().isNotValid, isTrue); + }, + ); test('hashCode is correct', () { final name = NameInput.pure();