mirror of
https://github.com/Iconica-Development/flutter_input_library.git
synced 2025-05-18 17:03:45 +02:00
feat: add formatInputs parameter to FlutterFormInputPlainText and FlutterFormInputPassword
This commit is contained in:
parent
d0c0d49d66
commit
b9674d7ada
4 changed files with 14 additions and 2 deletions
|
@ -43,4 +43,8 @@
|
|||
* FlutterFormInputDateTime now also had the enabled parameter to provide to DateTimeInputField
|
||||
|
||||
## 2.5.0
|
||||
* Addition of the ScrollPicker input field.
|
||||
* Addition of the ScrollPicker input field.
|
||||
|
||||
## 2.5.1
|
||||
* Addition of `formatInputs` parameter to `FlutterFormInputPlainText` widget.
|
||||
* Addition of `formatInputs` parameter to `FlutterFormInputPassword` widget.
|
|
@ -3,6 +3,7 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
/// Generates a [TextFormField] for passwords. It requires a [FlutterFormInputController]
|
||||
/// as the [controller] parameter and an optional [Widget] as [label]
|
||||
|
@ -10,6 +11,7 @@ class FlutterFormInputPassword extends StatefulWidget {
|
|||
final Widget? label;
|
||||
final FocusNode? focusNode;
|
||||
final String? initialValue;
|
||||
final List<TextInputFormatter>? inputFormatters;
|
||||
final Function(String?)? onSaved;
|
||||
final String? Function(String?)? validator;
|
||||
final Function(String?)? onChanged;
|
||||
|
@ -21,6 +23,7 @@ class FlutterFormInputPassword extends StatefulWidget {
|
|||
this.label,
|
||||
this.focusNode,
|
||||
this.initialValue,
|
||||
this.inputFormatters,
|
||||
this.onSaved,
|
||||
this.validator,
|
||||
this.onChanged,
|
||||
|
@ -39,6 +42,7 @@ class _PasswordTextFieldState extends State<FlutterFormInputPassword> {
|
|||
Widget build(BuildContext context) {
|
||||
return TextFormField(
|
||||
initialValue: widget.initialValue,
|
||||
inputFormatters: widget.inputFormatters,
|
||||
obscureText: obscured,
|
||||
focusNode: widget.focusNode,
|
||||
onSaved: (value) => widget.onSaved?.call(value),
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class FlutterFormInputPlainText extends StatelessWidget {
|
||||
const FlutterFormInputPlainText({
|
||||
|
@ -22,6 +23,7 @@ class FlutterFormInputPlainText extends StatelessWidget {
|
|||
this.validator,
|
||||
this.onFieldSubmitted,
|
||||
this.style,
|
||||
this.formatInputs,
|
||||
this.enabled = true,
|
||||
}) : super(
|
||||
key: key,
|
||||
|
@ -42,6 +44,7 @@ class FlutterFormInputPlainText extends StatelessWidget {
|
|||
final Function(String?)? onChanged;
|
||||
final Function(String?)? onFieldSubmitted;
|
||||
final TextStyle? style;
|
||||
final List<TextInputFormatter>? formatInputs;
|
||||
final bool enabled;
|
||||
|
||||
@override
|
||||
|
@ -53,6 +56,7 @@ class FlutterFormInputPlainText extends StatelessWidget {
|
|||
|
||||
return TextFormField(
|
||||
style: style,
|
||||
inputFormatters: formatInputs,
|
||||
scrollPadding: scrollPadding ?? const EdgeInsets.all(20.0),
|
||||
initialValue: initialValue,
|
||||
focusNode: focusNode,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_input_library
|
||||
description: A new Flutter package project.
|
||||
version: 2.5.0
|
||||
version: 2.5.1
|
||||
repository: https://github.com/Iconica-Development/flutter_input_library
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Reference in a new issue