Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 4 additions & 23 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: package:very_good_analysis/analysis_options.7.0.0.yaml
include: package:very_good_analysis/analysis_options.yaml
2 changes: 1 addition & 1 deletion example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _MyFormState extends State<MyForm> {
try {
await _submitForm();
_state = _state.copyWith(status: FormzSubmissionStatus.success);
} catch (_) {
} on Exception catch (_) {
_state = _state.copyWith(status: FormzSubmissionStatus.failure);
}

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 7 additions & 6 deletions example/test/main_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
);
});
Expand All @@ -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,
);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/formz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum FormzSubmissionStatus {
failure,

/// The form submission has been canceled.
canceled
canceled,
}

/// Useful extensions on [FormzSubmissionStatus]
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions test/formz_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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();
Expand Down