123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- import 'package:flutter/material.dart';
- import 'dart:developer' as logDev;
-
- class InputWidgetEmail extends StatelessWidget {
- final double topRight;
- final double bottomRight;
-
- InputWidgetEmail(this.topRight, this.bottomRight);
-
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: EdgeInsets.only(right: 40, bottom: 20),
- child: Container(
- width: MediaQuery.of(context).size.width - 40,
- child: Material(
- elevation: 10,
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- bottomRight: Radius.circular(bottomRight),
- topRight: Radius.circular(topRight))),
- child: Padding(
- padding: EdgeInsets.only(left: 25, right: 20, top: 10, bottom: 10),
- child: TextFormField(
- controller: emailController,
- keyboardType: TextInputType.emailAddress,
- textInputAction: TextInputAction.next,
- decoration: InputDecoration(
- border: InputBorder.none,
- prefixIcon: Icon(Icons.person),
- prefixIconConstraints: BoxConstraints(
- minWidth: 40,
- minHeight: 40,
- ),
- hintText: "username",
- hintStyle: TextStyle(color: Color(0xFFE1E1E1), fontSize: 16)),
- validator: (text) {
- if (text!.contains('@') && text.isNotEmpty) {
- return "Enter a valid email address!";
- } else if (text.isEmpty) {
- return "Email Required";
- }
- return null;
- },
- ),
- ),
- ),
- ),
- );
- }
- }
-
- class InputWidgetPassword extends StatelessWidget {
- final double topRight;
- final double bottomRight;
-
- InputWidgetPassword(this.topRight, this.bottomRight);
-
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: EdgeInsets.only(right: 40, bottom: 30),
- child: Container(
- width: MediaQuery.of(context).size.width - 40,
- child: Material(
- elevation: 10,
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- bottomRight: Radius.circular(bottomRight),
- topRight: Radius.circular(topRight))),
- child: Padding(
- padding: EdgeInsets.only(left: 25, right: 20, top: 10, bottom: 10),
- child: TextFormField(
- controller: passwordController,
- textInputAction: TextInputAction.done,
- obscureText: true,
- decoration: InputDecoration(
- border: InputBorder.none,
- prefixIcon: Icon(Icons.lock),
- prefixIconConstraints: BoxConstraints(
- minWidth: 40,
- minHeight: 40,
- ),
- hintText: "Password",
- hintStyle: TextStyle(color: Color(0xFFE1E1E1), fontSize: 16)),
- validator: (text) {
- if (text == null) {
- return "Password Required";
- }
- return null;
- },
- ),
- ),
- ),
- ),
- );
- }
- }
-
- TextEditingController emailController = TextEditingController();
- TextEditingController passwordController = TextEditingController();
-
- /*bool validate() {
- bool result = true;
- if (emailController.text.contains('@') && emailController.text.isNotEmpty) {
- emailController. "Enter a valid email address!";
- result = false;
- } else if (emailValue.isEmpty) {
- return "Email Required";
- }
-
- if (passwordController.text == null) {
- return "Password Required";
- }
-
- return
- null;
- }*/
|