PasswordInput.dart 692 B

1234567891011121314151617181920212223242526272829
  1. import 'package:flutter/material.dart';
  2. class PasswordInput extends StatefulWidget {
  3. @override
  4. _PasswordInputState createState() => _PasswordInputState();
  5. }
  6. class _PasswordInputState extends State<PasswordInput> {
  7. String _password = '';
  8. @override
  9. Widget build(BuildContext context) {
  10. return Padding(
  11. padding: const EdgeInsets.all(16.0),
  12. child: TextField(
  13. obscureText: true,
  14. onChanged: (value) {
  15. setState(() {
  16. _password = value;
  17. });
  18. },
  19. decoration: InputDecoration(
  20. border: OutlineInputBorder(),
  21. labelText: 'Password',
  22. ),
  23. ),
  24. );
  25. }
  26. }