Commit 63e78c2e by Ramesh Babu Puvvadi

added new changes

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