Commit 63e78c2e by Ramesh Babu Puvvadi

added new changes

parent ed221f4f
......@@ -7,11 +7,11 @@ import 'package:crypto/crypto.dart';
class Constants {
var title;
var message;
late AlertDialog alert;
var color;
late AlertDialog alert;
Constants(String title, String message) {
this.title = title;
this.title = title;
this.message = message;
}
......@@ -20,28 +20,16 @@ class Constants {
}
static const TextStyle fontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 18,
fontWeight: FontWeight.normal,
);
fontFamily: 'Poppins', fontSize: 18, fontWeight: FontWeight.normal);
static const TextStyle headerfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
);
fontFamily: 'Poppins', fontSize: 16, fontWeight: FontWeight.w600);
static const TextStyle listHeaderfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
);
fontFamily: 'Poppins', fontSize: 16, fontWeight: FontWeight.w600);
static const TextStyle listHeaderoppfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
);
fontFamily: 'Poppins', fontSize: 14, fontWeight: FontWeight.normal);
static const TextStyle listHeadercolorfontStyle = TextStyle(
fontFamily: 'Poppins',
......@@ -56,17 +44,13 @@ class Constants {
color: Colors.green);
static const TextStyle headerlistitems = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
height: 1.2,
);
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
height: 1.2);
static const TextStyle headerlistitems1 = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.bold,
);
fontFamily: 'Poppins', fontSize: 14, fontWeight: FontWeight.bold);
static const TextStyle open = TextStyle(
fontFamily: 'Poppins',
......@@ -93,53 +77,46 @@ class Constants {
color: Color.fromARGB(255, 106, 36, 36));
static const TextStyle buttonsfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.white,
);
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.white);
static const TextStyle whitefontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.white,
);
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.white);
static const TextStyle footfallheaderfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
);
fontFamily: 'Poppins',
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white);
static const TextStyle footfallfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 12,
fontWeight: FontWeight.normal,
color: Colors.white,
);
fontFamily: 'Poppins',
fontSize: 12,
fontWeight: FontWeight.normal,
color: Colors.white);
static const TextStyle reviewbuttonsfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.black,
);
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.black);
static const TextStyle registerfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.green,
);
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.green);
static const TextStyle unregisterfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.red,
);
fontFamily: 'Poppins',
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.red);
static Future<void> showAlertDialog1(BuildContext context) async {
AlertDialog alert = const AlertDialog(
......@@ -149,14 +126,8 @@ class Constants {
],
),
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return alert;
},
);
await showDialog(
context: context, builder: (BuildContext context) => alert);
}
static showLoader(BuildContext ctx) {
......@@ -186,7 +157,7 @@ class Constants {
//Color(0xFF4da2dd),
Color(0xFFaa39e6),
//Color(0xFFC2185B),
Color(0xFF7b32fe),
Color(0xFF7b32fe)
],
begin: Alignment.bottomLeft,
end: Alignment.bottomRight,
......@@ -201,13 +172,13 @@ class Constants {
String storeName,
String accessLevel,
bool validate) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('userId', username);
prefs.setString('empId', empid);
prefs.setString('stores_list', storeslist);
prefs.setString('access', accessLevel);
//prefs.setString('storeName', storeName);
prefs.setBool('islogged', validate);
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('userId', username);
prefs.setString('empId', empid);
prefs.setString('stores_list', storeslist);
prefs.setString('access', accessLevel);
//prefs.setString('storeName', storeName);
prefs.setBool('islogged', validate);
}
Future<bool?> getLoggedIn() async {
......@@ -274,9 +245,7 @@ class Constants {
AlertDialog alert = AlertDialog(
title: Text(title),
content: Text(message),
actions: [
okButton,
],
actions: [okButton],
);
showDialog(
context: context,
......
......@@ -20,11 +20,11 @@ class _Home extends State<Home> {
late List<File> arraylist = [];
XFile? image;
bool isloading = false;
var body_color = '';
var body_design_color = '';
var border_color = '';
var border_size = '';
var border_work_color = '';
var bodycolor = '';
var bodydesigncolor = '';
var bordercolor = '';
var bordersize = '';
var borderworkcolor = '';
var status = '';
final PageController _pageController = PageController(initialPage: 0);
List<Widget> pages = [];
......@@ -52,25 +52,25 @@ class _Home extends State<Home> {
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
if (body_color.isNotEmpty ||
body_design_color.isNotEmpty ||
border_color.isNotEmpty ||
border_size.isNotEmpty ||
border_work_color.isNotEmpty)
if (bodycolor.isNotEmpty ||
bodydesigncolor.isNotEmpty ||
bordercolor.isNotEmpty ||
bordersize.isNotEmpty ||
borderworkcolor.isNotEmpty)
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Padding(padding: EdgeInsets.only(bottom: 20)),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 30)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Body Design Color: $body_design_color\n'),
Text('Body Design Color: $bodydesigncolor\n'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Color: $border_color\n'),
Text('Border Color: $bordercolor\n'),
],
),
],
......@@ -80,7 +80,7 @@ class _Home extends State<Home> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding: EdgeInsets.only(bottom: 20)),
Padding(padding: EdgeInsets.only(bottom: 30)),
Text('\n'),
Text('\n'),
],
......@@ -94,52 +94,52 @@ class _Home extends State<Home> {
Widget buildPage3(String title) {
return Container(
color: Color.fromARGB(255, 240, 200, 159),
color: const Color.fromARGB(255, 240, 200, 159),
);
}
Widget buildPage1(String title) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
if (body_color.isNotEmpty ||
body_design_color.isNotEmpty ||
border_color.isNotEmpty ||
border_size.isNotEmpty ||
border_work_color.isNotEmpty)
if (bodycolor.isNotEmpty ||
bodydesigncolor.isNotEmpty ||
bordercolor.isNotEmpty ||
bordersize.isNotEmpty ||
borderworkcolor.isNotEmpty)
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Padding(padding: EdgeInsets.only(bottom: 20)),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 30)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Body Color: $body_color\n'),
Text('Body Color: $bodycolor\n'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Body Design Color: $body_design_color\n'),
Text('Body Design Color: $bodydesigncolor\n'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Color: $border_color\n'),
Text('Border Color: $bordercolor\n'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Size: $border_size\n'),
Text('Border Size: $bordersize\n'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Work Color: $border_work_color\n'),
Text('Border Work Color: $borderworkcolor\n'),
],
),
],
......@@ -179,8 +179,7 @@ class _Home extends State<Home> {
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => const SignUp()));
} else {
Constants('Vasthram', 'Check your internet connection')
.showAlertDialog(context, true);
Constants('Vasthram', 'Check your internet connection').showAlertDialog(context, true);
}
},
),
......@@ -313,26 +312,26 @@ class _Home extends State<Home> {
print(status);
if (status == 'Success') {
print('One :$status');
body_color = jsonResponse['body_color'];
print('One :$body_color');
body_design_color = jsonResponse['body_design_color'];
print('One :$body_design_color');
border_color = jsonResponse['border_color'];
print('One :$border_color');
bodycolor = jsonResponse['body_color'];
print('One :$bodycolor');
bodydesigncolor = jsonResponse['body_design_color'];
print('One :$bodydesigncolor');
bordercolor = jsonResponse['border_color'];
print('One :$bordercolor');
border_size = jsonResponse['border_size'];
print('One :$border_size');
bordersize = jsonResponse['border_size'];
print('One :$bordersize');
border_work_color = jsonResponse['border_work_color'];
print('One :$border_work_color');
borderworkcolor = jsonResponse['border_work_color'];
print('One :$borderworkcolor');
} else {
print('Two :$status');
Constants.dialogMessage(context, 'Vasthram', 'Could not found image');
body_color = '';
body_design_color = '';
border_color = '';
border_size = '';
border_work_color = '';
bodycolor = '';
bodydesigncolor = '';
bordercolor = '';
bordersize = '';
borderworkcolor = '';
}
});
_pageController.jumpToPage(0);
......
......@@ -2,7 +2,6 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:vasthram/RemoteData.dart';
import 'package:vasthram/UserResponse.dart';
import 'Constants.dart';
import 'Home.dart';
......@@ -14,32 +13,6 @@ class SignUp extends StatefulWidget {
class _SignUpState extends State<SignUp> {
final TextEditingController _email = TextEditingController();
/* try {
LoginResponse res = await RemoteData()
.getLoginRequest(email, Constants.hashPassword(pass));
print(res.data.userAccessToken);
print(res.data.empId);
print(res.data.storeName);
if (res.success == 1) {
Navigator.pop(context);
Constants.saveLoginCredentials(
res.data.empId.toString(),
res.data.userAccessToken,
res.data.storeId.toString(),
res.data.storeName,
true);
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => const Home()));
//print(response.token);
// ignore: use_build_context_synchronously
//Navigator.push(context, MaterialPageRoute(builder: (context) => UsersList()));
} else {
Navigator.pop(context);
Constants('Login', 'Invalid Credentials').showAlertDialog(context);
}
} catch (e) {
print(e.toString());
} */
final TextEditingController _pass = TextEditingController();
String dropdownValue = 'Option 1';
bool item = true;
......@@ -65,8 +38,7 @@ class _SignUpState extends State<SignUp> {
Navigator.pop(context);
Constants.saveLoginCredentials(userResponse.empName, _email.text,
jsonStr, '', userResponse.level, true);
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => const Home()));
Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => const Home()));
}
} else {
Navigator.pop(context);
......@@ -134,7 +106,6 @@ class _SignUpState extends State<SignUp> {
height: 50,
child: TextField(
cursorColor: const Color.fromARGB(255, 125, 50, 253),
//showCursor: false,
obscureText: true,
controller: _pass,
decoration: const InputDecoration(
......@@ -144,7 +115,6 @@ class _SignUpState extends State<SignUp> {
borderSide: BorderSide(
color: Color.fromARGB(255, 125, 50, 253),
),
//borderRadius: BorderRadius.circular(5.0),
),
),
),
......@@ -158,25 +128,6 @@ class _SignUpState extends State<SignUp> {
'', _email.text, '', '', '', true);
Navigator.pushReplacement(context,
MaterialPageRoute(builder: (context) => const Home()));
// if (_email.text.isEmpty && _pass.text.isEmpty) {
// Constants('Login ', 'Enter userId and password')
// .showAlertDialog(context, false);
// } else if (_email.text.isEmpty) {
// Constants('Login ', 'Enter userId')
// .showAlertDialog(context, false);
// } else if (_pass.text.isEmpty) {
// Constants('Login ', 'Enter password')
// .showAlertDialog(context, false);
// } else {
// bool isInternetConnected =
// await Constants.checkInternetConnectivity();
// if (isInternetConnected) {
// login(_email.text, _pass.text);
// } else {
// Constants('Login', 'Check internet connection')
// .showAlertDialog(context, false);
// }
// }
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment