0% found this document useful (0 votes)
2 views

Lap

joishoi

Uploaded by

doontata3
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lap

joishoi

Uploaded by

doontata3
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

import 'package:flutter/material.

dart';
import 'SignUp.dart';
import 'forgotpassword.dart';

void main() => runApp(const MyApp());


class MyApp extends StatelessWidget {

const MyApp ({Key? key}) : super(key: key);


static const String _title = 'login';

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: MyApp._title, ///

home: Scaffold(
appBar: AppBar(backgroundColor: const Color.fromARGB(255, 12, 107, 185),
title: const Text(MyApp._title,style: TextStyle(color: Color.fromARGB(255,
237, 236, 233)),)
),
body: MyStatefulWidget(),
),
);
}}
class MyStatefulWidget extends StatefulWidget {

@override

State<MyStatefulWidget> createState() => _MyStatefulWidgetState();


}

class _MyStatefulWidgetState extends State<MyStatefulWidget> {


TextEditingController nameController = TextEditingController();
TextEditingController passwordController = TextEditingController();
GlobalKey<FormState> state = GlobalKey();

@override
Widget build(BuildContext context) {
return
Form(
key: state,
child:
Container(margin: EdgeInsets.only(top: 180),
alignment: Alignment.bottomCenter,//////
// padding: EdgeInsets.only(top: 500),
child:
Padding(
padding: const EdgeInsets.all(10),
child: ListView(children: <Widget>[
Container(padding: const EdgeInsets.all(10),
child:
TextFormField(
// ignore: body_might_complete_normally_nullable
validator: (value) {
if(value!.isEmpty){
return "‫;"ال يمكن ترك هذا الحقل فارغا‬
}
},
controller: nameController,
decoration: const InputDecoration(
border: OutlineInputBorder(),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blueAccent,width: 2),
borderRadius: BorderRadius.all(Radius.circular(20)),
),
prefix: Icon(Icons.person),
labelText: 'User Name',
),

)
),
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
// ignore: body_might_complete_normally_nullable
validator: (value) {
if(value!.isEmpty){
return "‫;"ال يمكن ترك هذا الحقل فارغا‬
}
},
obscureText: true,
controller: passwordController,
decoration: const InputDecoration(
border: OutlineInputBorder(

),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blueAccent,width: 2),
borderRadius: BorderRadius.all(Radius.circular(20)),
),
prefix: Icon(Icons.key),
labelText: 'Password',
),
),
),
TextButton(onPressed: () {
Navigator.push(context, MaterialPageRoute(builder:
(context)=>Forgotpassword()));
// forget password screen
},

child: const Text('Forget Password',),


),
Container(
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton(
child: const Text('Login') ,
onPressed: (){
state.currentState!.validate();
},
),

),
Row(
// ignore: sort_child_properties_last
children: <Widget> [
const Text('Does not have account ?'),
TextButton(
child: const Text(
'Sign Up',
style: TextStyle(fontSize: 20),
),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context)
=>Signup()));
// NavigationBar.of(context).push(MaterialPageRoute(builder: (context)
=> Signup()));

},
)

],
mainAxisAlignment: MainAxisAlignment.center,

],),

)
,
),

);

You might also like