NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:social_app/constants/dimens.dart';
import 'package:social_app/ui/home/add_items.dart';
import 'package:social_app/ui/home/firebase_authrization.dart';
import 'package:social_app/ui/home/signin_screen.dart';
import 'package:social_app/utility/helper_utility.dart';
import 'package:social_app/utility/helper_widget.dart';
import 'package:social_app/utility/validator.dart';
import 'package:social_app/widgets/textfield_widget.dart';


class Login extends StatefulWidget {
@override
_LoginState createState() => _LoginState();
}

class _LoginState extends State<Login> {

bool checkValue = false;
bool newPassword = true;
Map map;

TextEditingController emailTextController ;
TextEditingController passwordTextController;
FocusNode _emailFocus ;
FocusNode _passwordFocus ;
bool valuefirst = false;
final _formKey = GlobalKey<FormState>();
AuthServices _authServices = new AuthServices();


@override
void initState() {
super.initState();
_passwordFocus = FocusNode();
_emailFocus = FocusNode();
emailTextController = TextEditingController();
passwordTextController = TextEditingController();

}

@override
void dispose() {
super.dispose();
emailTextController.dispose();
passwordTextController.dispose();
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(
left: margin_20, right: margin_20, top: margin_30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
IconButton(icon: Icon(Icons.arrow_back_ios,color: Colors.black,size: 25,),
onPressed: (){
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => SignIn()));
},),
Text(
"Don't have account ? Sign Up",
style: textStyleBold(color: Colors.green, fontsize: font_20),
),
],
),
_logoWidget(),
_form(),
_logInButton(),
],
),
),
),
),
);
}

_logoWidget() {
return Padding(
padding: const EdgeInsets.only(top: margin_40),
child: Center(
child: Container(
padding: EdgeInsets.all(margin_5),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey.shade300,
),
child: Container(
width: fullWidthScreen(context: context) * 0.28,
height: fullheightcreen(context: context) * 0.16,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSYwA1RGcvVR_MghuOzAw0-yXGP6iKTzianFA&usqp=CAU'),
fit: BoxFit.cover),
)),
),
),
);
}

_form() => Padding(
padding: const EdgeInsets.only(top: margin_50),
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_emailInputTextField(),
passwordInputTextField()
],
)),
);

_emailInputTextField() {
return TextFieldWidget(
hint: "Email Address",
textController: emailTextController,
focusNode: _emailFocus,
obsecure: false,
inputAction: TextInputAction.next,
validate: (String value) {
return EmailFormValidator.validate(value);
}
);
}

passwordInputTextField() {
return Padding(
padding: const EdgeInsets.only(top: margin_20),
child: TextFieldWidget(
hint: "Password",
textController: passwordTextController,
focusNode: _passwordFocus,
obsecure: true,
inputAction: TextInputAction.done,
validate:(String value){
return PasswordFormValidator.validate(value);
}
),
);
}

_logInButton() {
return InkWell(
child: Container(
margin: const EdgeInsets.only(top: margin_50),
width: fullWidthScreen(context: context) * 0.90,
height: fullheightcreen(context: context) * 0.064,
child: Center(
child: Text(
"Log In",
style: textStyle(color: Colors.white, fontsize: font_20),
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
gradient: LinearGradient(
colors: [Colors.blueAccent[200], Colors.green[400]],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
),
onTap: () {
if (_formKey.currentState.validate()) {
userlogin();
}
});
}

userlogin() {
var result;
_authServices
.logIn(email: emailTextController.text, password: passwordTextController.text)
.then((value) {
result = value;
debugPrint(result.email);
if (result != null) {
_authServices.currentUserDetails().then((value) {
if(value != null)
print("email address: $value");
toast(message: "Login successfully");
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => AddItems()));
});
} else
print("====================================Error creating user");
}).onError((error, stackTrace) {
print(error.toString());
});
}
}

     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.