username field
This commit is contained in:
		@@ -29,7 +29,10 @@ class _LoginPageState extends State<LoginPage> {
 | 
			
		||||
        appBar: AppBar(title: const Text('Welcome')),
 | 
			
		||||
        // https://www.kindacode.com/article/flutter-show-hide-password-in-textfield-textformfield/
 | 
			
		||||
        // https://www.kindacode.com/article/flutter-filteringtextinputformatter/
 | 
			
		||||
        body: Padding(
 | 
			
		||||
        body: ListView(
 | 
			
		||||
          children: <Widget>[
 | 
			
		||||
            UsernameField(),
 | 
			
		||||
            Padding(
 | 
			
		||||
              padding: const EdgeInsets.all(10),
 | 
			
		||||
              child: Center(
 | 
			
		||||
                child: TextField(
 | 
			
		||||
@@ -37,8 +40,7 @@ class _LoginPageState extends State<LoginPage> {
 | 
			
		||||
                    decoration: InputDecoration(
 | 
			
		||||
                        hintText: 'Password',
 | 
			
		||||
                        border: OutlineInputBorder(
 | 
			
		||||
                      borderRadius: BorderRadius.circular(10)
 | 
			
		||||
                    ),
 | 
			
		||||
                            borderRadius: BorderRadius.circular(10)),
 | 
			
		||||
                        suffixIcon: IconButton(
 | 
			
		||||
                          icon: Icon(_isPasswordObscure
 | 
			
		||||
                              ? Icons.visibility
 | 
			
		||||
@@ -50,6 +52,26 @@ class _LoginPageState extends State<LoginPage> {
 | 
			
		||||
                          },
 | 
			
		||||
                        ))),
 | 
			
		||||
              ),
 | 
			
		||||
            )
 | 
			
		||||
          ],
 | 
			
		||||
        ));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class UsernameField extends StatelessWidget {
 | 
			
		||||
  const UsernameField({Key? key}) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Padding(
 | 
			
		||||
      padding: const EdgeInsets.all(10),
 | 
			
		||||
      child: Center(
 | 
			
		||||
        child: TextField(
 | 
			
		||||
            decoration: InputDecoration(
 | 
			
		||||
          hintText: 'Username',
 | 
			
		||||
          border: OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
 | 
			
		||||
        )),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user