From 3b2c5e294fa9fa9aea4d8c66887eec36ee073077 Mon Sep 17 00:00:00 2001 From: Jacques Date: Wed, 7 Feb 2024 16:13:35 +0100 Subject: [PATCH] feat: Add controller to password --- CHANGELOG.md | 3 +++ lib/src/inputs/text/password.dart | 3 +++ pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5e2bf..a5687c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,3 +66,6 @@ ## 3.0.0 * Updated the FlutterFormInputSwitch to FlutterFormInputBool. This now includes a parameter to either show a checkbox or switch + +## 3.1.0 +* `FlutterFormInputPassword` now has the controller parameter to set the `TextEditingController` of the `TextFormField` diff --git a/lib/src/inputs/text/password.dart b/lib/src/inputs/text/password.dart index 36f1414..836db0e 100644 --- a/lib/src/inputs/text/password.dart +++ b/lib/src/inputs/text/password.dart @@ -22,6 +22,7 @@ class FlutterFormInputPassword extends StatefulWidget { this.onFieldSubmitted, this.enabled = true, this.decoration, + this.controller, }); final Widget? label; final FocusNode? focusNode; @@ -34,6 +35,7 @@ class FlutterFormInputPassword extends StatefulWidget { final Function(String?)? onFieldSubmitted; final bool enabled; final InputDecoration? decoration; + final TextEditingController? controller; @override State createState() => _PasswordTextFieldState(); @@ -57,6 +59,7 @@ class _PasswordTextFieldState extends State { InputDecoration(suffixIcon: suffixIcon); return TextFormField( + controller: widget.controller, style: widget.style, initialValue: widget.initialValue, inputFormatters: widget.inputFormatters, diff --git a/pubspec.yaml b/pubspec.yaml index 7286c19..6a9a780 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_input_library description: A new Flutter package project. -version: 3.0.0 +version: 3.1.0 repository: https://github.com/Iconica-Development/flutter_input_library environment: