diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..11d127b9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,53 @@
+---
+name: "\U0001F41B Bug"
+about: Something is crashing or not working as intended
+labels: bug
+
+---
+
+## Environment
+
+**Package version:**
+
+
+ Flutter doctor
+
+
+```
+```
+
+
+
+
+ Code sample
+
+
+
+```dart
+```
+
+
+
+## Description
+
+**Expected behavior:**
+
+**Current behavior:**
+
+## Steps to reproduce
+
+1. This
+2. Than that
+3. Then
+
+## Images
+
+## Stacktrace/Logcat
diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md
new file mode 100644
index 00000000..b243d471
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation.md
@@ -0,0 +1,18 @@
+---
+name: "\U0001F4C3 Documentation Bug"
+about: You want to report something that is wrong or missing from the documentation.
+labels: documentation
+
+---
+
+### Describe the change you would like to see
+
+
+### How would the suggested change make the documentation more useful?
+
+
+### Additional context
+
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..a6b3c866
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,18 @@
+---
+name: "\U0001F680 Feature request"
+about: Suggest new feature or request for this project
+labels: enhancement
+
+---
+
+## Environment
+
+**Package version:**
+
+## Description
+
+**What you'd like to happen:**
+
+**Alternatives you've considered:**
+
+**Images:**
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
new file mode 100644
index 00000000..0e9a57f1
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -0,0 +1,14 @@
+---
+name: "\U0001F914 Questions and Help"
+about: You have a quetion or need help using this packages
+labels: question
+
+---
+
+## Environment
+
+**Package version:**
+
+## Describe your question
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0beb7c18..a731f1f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,10 @@
## Breaking changes
-- Remove `onWillPop` from `ReactiveForm` and `ReactiveFormBuilder` widgets.
+- Removed deprecated `onWillPop` from `ReactiveForm` and `ReactiveFormBuilder` widgets.
+It was replaced with the `PopScope` widget.
+- `Validators.number` allows now to define negative numbers and decimal numbers with the addition
+of two optional arguments `allowNegatives` and `allowedDecimals`.
## Features
diff --git a/README.md b/README.md
index 631cb8a0..b9eaa6a8 100644
--- a/README.md
+++ b/README.md
@@ -64,8 +64,8 @@ samples, guidance on mobile development, and a full API reference.
## Minimum Requirements
-- Dart SDK: >=3.0.0 <4.0.0
-- Flutter: >=3.10.0
+- Dart SDK: >=3.2.0 <4.0.0
+- Flutter: >=3.16.0
> For using **Reactive Forms** in projects below Flutter 2.8.0 please use the version <= 10.7.0 of
> **Reactive Forms**.
@@ -88,7 +88,7 @@ dependencies:
flutter:
sdk: flutter
- reactive_forms: ^16.1.1
+ reactive_forms: ^17.0.0
```
Then run the command `flutter packages get` on the console.
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index f852a55f..6a21e162 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -39,7 +39,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.reactive_forms_example"
- minSdkVersion 16
+ minSdkVersion flutter.minSdkVersion
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
diff --git a/example/lib/sample_screen.dart b/example/lib/sample_screen.dart
index 8aff4871..a168e88b 100644
--- a/example/lib/sample_screen.dart
+++ b/example/lib/sample_screen.dart
@@ -5,8 +5,7 @@ class SampleScreen extends StatelessWidget {
final Widget body;
final Widget? title;
- const SampleScreen({Key? key, required this.body, this.title})
- : super(key: key);
+ const SampleScreen({super.key, required this.body, this.title});
@override
Widget build(BuildContext context) {
diff --git a/example/lib/samples/add_dynamic_controls_sample.dart b/example/lib/samples/add_dynamic_controls_sample.dart
index fc34097e..48ed0aea 100644
--- a/example/lib/samples/add_dynamic_controls_sample.dart
+++ b/example/lib/samples/add_dynamic_controls_sample.dart
@@ -7,8 +7,8 @@ class ViewModelProvider extends InheritedWidget {
ViewModelProvider({
required this.viewModel,
- required Widget child,
- }) : super(child: child);
+ required super.child,
+ });
static NewContactViewModel? of(BuildContext context) =>
context.findAncestorWidgetOfExactType()?.viewModel;
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 9dcfa6c8..850092e5 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -18,34 +18,30 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
- sdk: ">=2.17.0 <3.0.0"
- flutter: ">=3.0.0"
+ sdk: ">=3.2.0 <4.0.0"
+ flutter: ">=3.16.0"
dependencies:
flutter:
sdk: flutter
- intl: ^0.18.0
+ intl: ^0.19.0
reactive_forms:
path: ../
#reactive_forms_widgets: ^0.3.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^1.0.5
+ cupertino_icons: ^1.0.6
#reactive_dropdown_search: ^0.9.0
#reactive_touch_spin: ^0.6.0
#reactive_segmented_control: ^0.4.0
#reactive_date_time_picker: ^0.4.0
dev_dependencies:
- lints: ^2.0.0
+ flutter_lints: ^3.0.2
flutter_test:
sdk: flutter
-dependency_overrides:
- reactive_forms:
- path: ../
-
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
diff --git a/lib/src/models/models.dart b/lib/src/models/models.dart
index 0040ea71..9d809f32 100644
--- a/lib/src/models/models.dart
+++ b/lib/src/models/models.dart
@@ -833,18 +833,12 @@ class FormControl extends AbstractControl {
///
FormControl({
T? value,
- List> validators = const [],
- List> asyncValidators = const [],
- int asyncValidatorsDebounceTime = 250,
- bool touched = false,
- bool disabled = false,
- }) : super(
- validators: validators,
- asyncValidators: asyncValidators,
- asyncValidatorsDebounceTime: asyncValidatorsDebounceTime,
- disabled: disabled,
- touched: touched,
- ) {
+ super.validators,
+ super.asyncValidators,
+ super.asyncValidatorsDebounceTime,
+ super.touched,
+ super.disabled,
+ }) {
if (value != null) {
this.value = value;
} else {
@@ -1039,16 +1033,11 @@ class FormControl extends AbstractControl {
/// that emits events each time you add or remove a control to the collection.
abstract class FormControlCollection extends AbstractControl {
FormControlCollection({
- List> validators = const [],
- List> asyncValidators = const [],
- int asyncValidatorsDebounceTime = 250,
- bool disabled = false,
- }) : super(
- validators: validators,
- asyncValidators: asyncValidators,
- asyncValidatorsDebounceTime: asyncValidatorsDebounceTime,
- disabled: disabled,
- );
+ super.validators,
+ super.asyncValidators,
+ super.asyncValidatorsDebounceTime,
+ super.disabled,
+ });
final _collectionChanges =
StreamController>>.broadcast();
@@ -1156,17 +1145,14 @@ class FormGroup extends FormControlCollection