fix: replacing custom textfield with themed TextFormField
This commit is contained in:
@@ -3,37 +3,6 @@ import 'package:flutter/material.dart';
|
||||
const smallGap = SizedBox(height: 20);
|
||||
const largeGap = SizedBox(height: 40);
|
||||
|
||||
Widget textFeildCustom(String hintText, TextEditingController ctlr) {
|
||||
return SizedBox(
|
||||
height: 70,
|
||||
width: 300,
|
||||
child: TextField(
|
||||
controller: ctlr,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
hintText: hintText,
|
||||
hintStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white,
|
||||
width: 2,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white,
|
||||
width: 2,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> displayTextInputDialog(
|
||||
BuildContext context,
|
||||
Function()? onTab,
|
||||
|
||||
@@ -49,13 +49,24 @@ class MyApp extends StatelessWidget {
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
labelStyle: const TextStyle(color: Colors.white),
|
||||
border: OutlineInputBorder(
|
||||
focusColor: Colors.green,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.white,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.green,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
textTheme: const TextTheme(
|
||||
bodyText1: TextStyle(color: Colors.white),
|
||||
|
||||
@@ -26,14 +26,16 @@ class _SignInPageState extends State<SignInPage> {
|
||||
children: [
|
||||
SvgPicture.asset("assets/supabase-dark.svg", width: 200),
|
||||
largeGap,
|
||||
textFeildCustom(
|
||||
"Email",
|
||||
_emailController,
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
decoration: const InputDecoration(label: Text('Email')),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
),
|
||||
smallGap,
|
||||
textFeildCustom(
|
||||
"Password",
|
||||
_passwordController,
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
decoration: const InputDecoration(label: Text('Password')),
|
||||
obscureText: true,
|
||||
),
|
||||
smallGap,
|
||||
loading
|
||||
|
||||
@@ -33,19 +33,21 @@ class _SignUpPageState extends State<SignUpPage> {
|
||||
label: Text('Full Name'),
|
||||
),
|
||||
),
|
||||
// textFeildCustom(
|
||||
// "Full Name",
|
||||
// _nameController,
|
||||
// ),
|
||||
smallGap,
|
||||
textFeildCustom(
|
||||
"Email",
|
||||
_emailController,
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
decoration: const InputDecoration(
|
||||
label: Text('Full Name'),
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
),
|
||||
smallGap,
|
||||
textFeildCustom(
|
||||
"Password",
|
||||
_passwordController,
|
||||
TextFormField(
|
||||
controller: _passwordController,
|
||||
decoration: const InputDecoration(
|
||||
label: Text('Password'),
|
||||
),
|
||||
obscureText: true,
|
||||
),
|
||||
smallGap,
|
||||
ElevatedButton(
|
||||
|
||||
Reference in New Issue
Block a user