http://preview.themeforest.net/item/botanical-html5-ecommerce-template/full_screen_preview/24961852
https://stackblitz.com/edit/angular-mat-table-filter-example?file=src%2Fapp%2Fmat-table-filter%2Fmat-table-filter.component.html
https://morioh.com/p/eb59620c0e80
https://www.digitalocean.com/community/tutorials/angular-reactive-forms-custom-validator
https://stackblitz.com/edit/angular-child-parent-communication-example?file=src%2Fapp%2Fchild.component.html,src%2Fapp%2Fchild.component.ts
https://www.youtube.com/watch?v=5Hs1bB4jpyg
https://www.youtube.com/watch?v=Blxk3IOcUgM
https://i0.wp.com/www.onceuponachef.com/images/2017/07/Ratatouille-14.jpg?resize=850%2C638&ssl=1
static String ORDER_DETAILS = BASE_URL + "getorderdetails.php";
static String ORDER_ITEMS = BASE_URL + "getorderitems.php";
Register
import 'package:firstapp/resources/AppColors.dart';
import 'package:firstapp/resources/UrlResources.dart';
import 'package:firstapp/ui/auth/LoginScreen.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:form_field_validator/form_field_validator.dart';
import 'package:http/http.dart' as http;
class RegisterScreen extends StatefulWidget {
@override
State<RegisterScreen> createState() => _RegisterScreenState();
}
class _RegisterScreenState extends State<RegisterScreen> {
final formkey = GlobalKey<FormState>();
TextEditingController _name = TextEditingController();
TextEditingController _contact = TextEditingController();
TextEditingController _email = TextEditingController();
TextEditingController _password = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// title: Text('Registeration Activity'),
),
body: SingleChildScrollView(
child: Column(
children: [
Card(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Form(
key: formkey,
autovalidateMode: AutovalidateMode.always,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
alignment: Alignment.center,
child: CircleAvatar(
backgroundColor: AppColors.primarycol,
backgroundImage: AssetImage('img/plant.png'),
radius: 50.0,
)
),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | SizedBox(height: 20.0,),
Center(
child:
Text("Register Here",style: TextStyle(letterSpacing: 1.0, color: AppColors.primarycol,fontSize: 30.0,fontWeight: FontWeight.normal),),
),
SizedBox(height: 20.0,),
// Text("Name",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
TextFormField(
controller: _name,
keyboardType: TextInputType.text,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Name',
hintText: 'Enter Name'),
validator: (val)
{
if(val.length<=0)
{
return "Please Enter Name";
}
return null;
},
),
SizedBox(height: 20.0,),
// Text("Contatct Number",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
TextFormField(
controller: _contact,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Mobile Number',
hintText: 'Enter 10 digit contact number'),
validator: (val)
{
if(val.length<=0)
{
return "Please enter Mobile Number";
}
else if(val.length!=10)
{
return "please enter valid mobile number";
}
return null;
},
),
SizedBox(height: 20.0,),
// Text("Email ID",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
// TextField(
// controller: _email,
// keyboardType: TextInputType.emailAddress,
// decoration: InputDecoration(
// border: OutlineInputBorder(),
// labelText: 'Email ID',
// hintText: 'Enter Email Id')
//
// ),
TextFormField(
controller: _email,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Email ID',
hintText: 'Enter Email Id'),
validator: (val){
const pattern = r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$';
final regExp = RegExp(pattern);
if(val.length<=0)
{
return "Please Enter Email";
}
else if(!regExp.hasMatch(val))
{
return "Please Enter Valid Email ID";
}
return null;
},
),
SizedBox(height: 20.0,),
// Text("Password",style: TextStyle(color: Colors.black,fontSize: 15.0,fontWeight: FontWeight.bold),),
// TextField(
// controller: _password,
// keyboardType: TextInputType.text,
// obscureText: true,
// decoration: InputDecoration(
// border: OutlineInputBorder(),
// labelText: 'Password',
// hintText: 'Enter password')
//
// ),
TextFormField(
controller: _password,
keyboardType: TextInputType.text,
obscureText: true,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Password',
hintText: 'Enter password'),
validator: (val){
if(val.length<=0)
{
return "Please Enter Password";
}
else if(val.length<8)
{
return "Password Must be of minimum 8 characters";
}
return null;
},
),
SizedBox(height: 20.0),
GestureDetector(
onTap: () async{
if(formkey.currentState.validate())
{
var name = _name.text.toString();
var email = _email.text.toString();
var contact = _contact.text.toString();
var password = _password.text.toString();
Map<String,String> params={
"name":name,
"email":email,
"contact":contact,
"password":password
};
Uri url = Uri.parse(UrlResources.REGISTER);
var response = await http.post(url,body: params);
if(response.statusCode==200)
{
var body = response.body.toString();
if(body=="yes")
{
print("Register Successfully!");
Fluttertoast.showToast(
msg: "Register Successfully!",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.green,
textColor: Colors.white,
fontSize: 16.0);
Navigator.of(context).pop();
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => LoginScreen()));
}
else
{
print("Register Error");
}
}
}
// Uri url = Uri.parse("http://192.168.137.1/api/demo.php");
// var response = await http.get(url);
// if(response.statusCode==200)
// {
// var body = response.body.toString();
// print("Result : "+body);
// }
// else
// {
// print("API Error");
// }
//200 ok 400 api not found 500 server error
},
child: Container(
// width: MediaQuery.of(context).size.width,
height: 60.0,
// color: Colors.purple,
alignment: Alignment.center,
decoration: BoxDecoration(
// color: Colors.blue, borderRadius: BorderRadius.circular(20)
color: const Color(0xff145A32), borderRadius: BorderRadius.circular(20)
),
// height: 50,
// width: 250,
child: Text("Register",style: TextStyle(color: Colors.white)),
),
)
],
),
),
),
)
],
),
),
);
|
}
}
dotted_decoration:
Container(
width: 300,
height: 150,
decoration: DottedDecoration(
shape: Shape.box,
borderRadius: BorderRadius.circular(10),
),
<?php
header('Access-Control-Allow-Origin: *');
?>
SELECT i.,o.,p.* FROM items as i,product as p,orders as o WHERE i.orderid = o.orderid and i.productid=p.productid and i.orderid=33;
<?php
header('Access-Control-Allow-Origin: *');
?>
H6CrPdPQ