dart_ng_forms 0.2.3
dart_ng_forms: ^0.2.3 copied to clipboard
Reactive Forms architecture in Flutter inspired by Angular's FormGroup/FormControl pattern and integration with TextEditingController.
dart_ng_forms #
Reactive Forms architecture in Flutter, heavily inspired by Angular's FormGroup
/FormControl
pattern,
with a focus on type safety, reusability, and seamless integration with Flutter's TextEditingController
.
Features #
- βοΈ Strongly typed
FormControl<T, V>
andFormGroup<T>
system - π Two-way binding with
TextEditingController
- β Built-in validation support
- π¦ Reusable and composable control logic
- π Observability through
ChangeNotifier
Getting Started #
Add the dependency in your pubspec.yaml
:
dependencies:
dart_ng_forms: ^0.1.0
Import the package:
import 'package:dart_ng_forms/dart_ng_forms.dart';
Example #
final loginForm = LoginFormGroup({{
'email': FormControl.text(initialValue: ''),
'password': FormControl.text(initialValue: ''),
}});
if (loginForm.valid) {{
var data = loginForm.value;
}}
π§ Example #
You can find a complete working example in example/main.dart.
License #
This project is licensed under the MIT License - see the LICENSE file for details.