Remove unused code

This commit is contained in:
Moe Poi ~ 2022-05-16 08:37:50 +07:00
parent 3f7de2fa8f
commit 9ef010fcd9
2 changed files with 1 additions and 182 deletions

View file

@ -237,181 +237,4 @@ class LoginFormState extends State<LoginForm> {
),
);
}
}
/* Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: FormBuilder(
key: _formKey,
child: Column(
children: [
TextField(
style: TextStyle(
fontSize: 20,
fontStyle: FontStyle.italic,
color: Colors.white,
),
decoration: new InputDecoration(
hintText: "Enter your email",
labelText: "Email",
prefixIcon: Icon(Icons.email),
labelStyle: new TextStyle(
color: const Color(0xFFFFFFFF)),
border: new UnderlineInputBorder(
borderSide:
new BorderSide(color: Colors.red))),
),
makeInput(
label: "Password",
obscureText: true,
)
],
),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 35),
child: Container(
padding: const EdgeInsets.only(top: 3, left: 3),
child: MaterialButton(
minWidth: double.infinity,
height: 35,
onPressed: () async {
if (_formKey.currentState!.fields["Email"]!
.value ==
'' ||
_formKey.currentState!.fields["Password"]!
.value ==
'') {
showAlertDialog(context);
} else {
var statusCode = await loginPost(
email: _formKey
.currentState!.fields["Email"]!.value,
password: _formKey.currentState!
.fields["Password"]!.value);
if (statusCode == 200) {
} else {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const LoginError()));
}
}
},
color: const Color(0xff8B0000),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)),
child: const Text(
"Login",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 15,
),
),
),
),
),
const SizedBox(
height: 5,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text(
"Don't have an account ?? \nClick here to Sign Up !!",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 15),
),
],
)
],
),
],
),
),
),
),
),
);
}
*/
/* Widget makeInput({label, obscureText = false}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: const TextStyle(
fontSize: 12, fontWeight: FontWeight.bold, color: Colors.white),
),
const SizedBox(
height: 5,
),
FormBuilderTextField(
initialValue: "",
name: label,
obscureText: obscureText,
style: const TextStyle(color: Colors.white),
decoration: const InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 0, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.red,
),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white,
),
),
border:
OutlineInputBorder(borderSide: BorderSide(color: Colors.white)),
),
),
const SizedBox(
height: 10,
)
],
);
}
showAlertDialog(BuildContext context) {
Widget okButton = TextButton(
child: const Text("OK", style: TextStyle(color: Colors.red)),
onPressed: () {
Navigator.of(context, rootNavigator: true).pop();
},
);
AlertDialog alert = AlertDialog(
backgroundColor: const Color(0xff1b1c1e),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
title: const Text(
"Error",
style: TextStyle(color: Colors.white),
),
content: const Text(
"Make sure to fill all text fields",
style: TextStyle(color: Colors.white70),
),
actions: [
okButton,
],
);
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
*/
}

View file

@ -37,10 +37,6 @@ class ProductCard extends StatelessWidget {
borderRadius: BorderRadius.all(
Radius.circular(defaultBorderRadius)),
),
// child: Image.asset(
// image,
// height: 132,
// ),
child: CachedNetworkImage(
imageUrl: imageUrl,
placeholder: (context, url) =>