Skip to content

Commit 8f40bc6

Browse files
Merge pull request #104 from flutter-form-builder-ecosystem/add-fake-dart-to-tests
Add fake dart to tests
2 parents 4999b09 + bc10541 commit 8f40bc6

11 files changed

+1092
-908
lines changed

.fvmrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"flutter": "stable",
3+
"flavors": {
4+
"stable": "stable",
5+
"beta": "beta"
6+
}
7+
}

.github/workflows/base.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,17 @@ jobs:
2828
with:
2929
paths: "**/*.md"
3030

31+
- name: Get Flutter version by FVM
32+
uses: kuhnroyal/flutter-fvm-config-action@v2
33+
id: fvm-config-action
34+
with:
35+
path: '.fvmrc'
36+
flavor: 'stable'
37+
3138
- uses: subosito/flutter-action@v2
3239
with:
33-
channel: 'stable'
34-
# use the build-in cache from Subosito
40+
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
41+
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
3542
cache: true
3643

3744
- name: Install dependencies
@@ -52,7 +59,7 @@ jobs:
5259
run: dart analyze
5360

5461
- name: Run tests
55-
run: flutter test
62+
run: flutter test --coverage
5663

5764
- name: Check publish warnings
5865
run: dart pub publish --dry-run

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# The .vscode folder contains launch configuration and tasks you configure in
2020
# VS Code which you may wish to be included in version control, so this line
2121
# is commented out by default.
22-
#.vscode/
22+
.vscode/
2323

2424
# Flutter/Dart/Pub related
2525
**/doc/api/
@@ -76,4 +76,5 @@ pubspec.lock
7676
!**/ios/**/default.perspectivev3
7777

7878
# L10n files
79-
**/intl
79+
**/intl
80+
coverage/lcov.info

README.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,32 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
88
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/flutter-form-builder-ecosystem/form_builder_validators/base.yaml?branch=main&logo=github&style=for-the-badge)](https://github.com/flutter-form-builder-ecosystem/form_builder_validators/actions/workflows/base.yaml)
99
[![Codecov](https://img.shields.io/codecov/c/github/flutter-form-builder-ecosystem/form_builder_validators?logo=codecov&style=for-the-badge)](https://codecov.io/gh/flutter-form-builder-ecosystem/form_builder_validators/)
1010
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/flutter-form-builder-ecosystem/form_builder_validators?logo=codefactor&style=for-the-badge)](https://www.codefactor.io/repository/github/flutter-form-builder-ecosystem/form_builder_validators)
11+
1112
---
1213

13-
> ## Migrating from version 7 to 8
14-
>
15-
> To migrate from v7 to v8, remove `context` as a parameter to validator functions. For example, `FormBuilderValidators.required(context)` becomes `FormBuilderValidators.required()` without `context` passed in.
14+
## Call for Maintainers
15+
16+
> We are looking for maintainers to contribute to the development and maintenance of Flutter Form Builder Ecosystem. Is very important to keep the project alive and growing, so we need your help to keep it up to date and with new features. You can contribute in many ways, we describe some of them in [Support](#support) section.
1617
1718
## Contents
1819

1920
- [Features](#features)
2021
- [Validators](#validators)
21-
- [Supported languages](#supported-languages)
22+
- [Supported languages](#supported-languages)
2223
- [Use](#use)
23-
- [Setup](#setup)
24-
- [Basic use](#basic-use)
25-
- [Specific uses](#specific-uses)
26-
- [Composing multiple validators](#composing-multiple-validators)
27-
- [Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
24+
- [Setup](#setup)
25+
- [Basic use](#basic-use)
26+
- [Specific uses](#specific-uses)
27+
- [Composing multiple validators](#composing-multiple-validators)
28+
- [Modify the default error message in a specific language](#modify-the-default-error-message-in-a-specific-language)
29+
- [Migrations](#migrations)
30+
- [v7 to v8](#v7-to-v8)
2831
- [Support](#support)
29-
- [Contribute](#contribute)
30-
- [Add new supported language](#add-new-supported-language)
31-
- [Add new validator](#add-new-validator)
32-
- [Questions and answers](#questions-and-answers)
33-
- [Donations](#donations)
32+
- [Contribute](#contribute)
33+
- [Add new supported language](#add-new-supported-language)
34+
- [Add new validator](#add-new-validator)
35+
- [Questions and answers](#questions-and-answers)
36+
- [Donations](#donations)
3437
- [Roadmap](#roadmap)
3538
- [Ecosystem](#ecosystem)
3639
- [Thanks to](#thanks-to)
@@ -46,7 +49,7 @@ Also included is the `l10n` / `i18n` of error text messages to multiple language
4649
This package comes with several most common `FormFieldValidator`s such as required, numeric, mail,
4750
URL, min, max, minLength, maxLength, minWordsCount, maxWordsCount, IP, credit card, etc., with default `errorText` messages.
4851

49-
Available built-in helper validators:
52+
### Helper validators
5053

5154
- `FormBuilderValidators.compose()` - runs each validator against the value provided.
5255
- `FormBuilderValidators.conditional()` - conditionally runs a validator against the value provided.
@@ -57,7 +60,7 @@ Available built-in helper validators:
5760
- `FormBuilderValidators.skipWhen()` - runs the validator and skips the validation when a certain condition is met.
5861
- `FormBuilderValidators.defaultValue()` - runs the validator using the default value when the provided value is null.
5962

60-
Available built-in type validators include:
63+
### Type validators
6164

6265
- `FormBuilderValidators.equal()` - requires the field's value to be equal to the provided object.
6366
- `FormBuilderValidators.integer()` - requires the field's value to be an integer.
@@ -92,7 +95,7 @@ Available built-in type validators include:
9295
- `FormBuilderValidators.unique()` - requires the field's to be unique in the provided list.
9396
- `FormBuilderValidators.singleLine()` - requires the field's string to be a single line of text.
9497

95-
Available built-in use-case validators include:
98+
### Use-case validators
9699

97100
- `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
98101
- `FormBuilderValidators.creditCardExpirationDate()` - requires the field's value to be a valid credit card expiration date and can check if not expired yet.
@@ -116,7 +119,7 @@ Available built-in use-case validators include:
116119
- `FormBuilderValidators.bic()` - requires the field's to be an valid BIC.
117120
- `FormBuilderValidators.isbn()` - requires the field's to be an valid ISBN.
118121

119-
Available extension methods used for chaining validators:
122+
## Extension methods used for chaining validators
120123

121124
- `FormBuilderValidator.and()` - Combines the current validator with another validator using logical AND.
122125
- `FormBuilderValidator.or()` - Combines the current validator with another validator using logical OR.
@@ -256,6 +259,12 @@ TextFormField(
256259

257260
see [override_form_builder_localizations_en](example/lib/override_form_builder_localizations_en.dart) for more detail.
258261

262+
## Migrations
263+
264+
### v7 to v8
265+
266+
Remove `context` as a parameter to validator functions. For example, `FormBuilderValidators.required(context)` becomes `FormBuilderValidators.required()` without `context` passed in.
267+
259268
## Support
260269

261270
### Contribute

lib/form_builder_validators.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ export 'localization/intl/messages_uk.dart';
3232
export 'localization/intl/messages_zh.dart';
3333
export 'localization/l10n.dart';
3434
export 'src/form_builder_validators.dart';
35+
export 'src/form_field_validator_extensions.dart';

lib/src/form_builder_validators.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import 'package:flutter/material.dart';
2-
import '../form_builder_validators.dart';
1+
import 'package:flutter/widgets.dart';
32

3+
import '../form_builder_validators.dart';
44
import 'utils/helpers.dart';
55
import 'utils/validators.dart';
66

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
intl: ^0.19.0
2323

2424
dev_dependencies:
25+
faker_dart: ^0.2.2
2526
flutter_lints: ^4.0.0
2627
flutter_test:
2728
sdk: flutter

0 commit comments

Comments
 (0)