Skip to content

Commit d55f975

Browse files
committed
Changelog:
- Added key and onChanged to password text field in material.
1 parent 3396c86 commit d55f975

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/material/password_textfield.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import 'package:flutter/material.dart';
22

33
class PasswordTextField extends StatefulWidget {
4+
final Key key;
45
final TextEditingController controller;
56
final InputDecoration decoration;
67
final Function(String) validator;
78
final bool enabled;
89
final AutovalidateMode autovalidateMode;
910
final bool autocorrect;
11+
final void Function(String) onChanged;
1012

1113
PasswordTextField({
14+
this.key,
1215
this.controller,
1316
this.enabled,
1417
this.validator,
1518
this.autovalidateMode,
1619
this.autocorrect = true,
1720
this.decoration,
21+
this.onChanged,
1822
});
1923

2024
@override
@@ -39,13 +43,15 @@ class _PasswordTextFieldState extends State<PasswordTextField> {
3943
@override
4044
Widget build(BuildContext context) {
4145
return TextFormField(
46+
key: widget.key,
4247
controller: widget.controller,
4348
obscureText: _passwordHidden,
4449
validator: widget.validator,
4550
autovalidateMode: widget.autovalidateMode,
4651
autocorrect: widget.autocorrect,
4752
enabled: widget.enabled,
4853
decoration: _buildDecoration(),
54+
onChanged: widget.onChanged,
4955
);
5056
}
5157

0 commit comments

Comments
 (0)