Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Vasthram
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramesh Babu Puvvadi
Vasthram
Commits
63e78c2e
Commit
63e78c2e
authored
Oct 27, 2023
by
Ramesh Babu Puvvadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new changes
parent
ed221f4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
175 deletions
+94
-175
Constants.dart
lib/Constants.dart
+50
-81
Home.dart
lib/Home.dart
+43
-44
SignUp.dart
lib/SignUp.dart
+1
-50
No files found.
lib/Constants.dart
View file @
63e78c2e
...
...
@@ -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
,
...
...
lib/Home.dart
View file @
63e78c2e
...
...
@@ -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
body
design
color
=
''
;
var
bordercolor
=
''
;
var
bordersize
=
''
;
var
border
work
color
=
''
;
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
||
body
design
color
.
isNotEmpty
||
bordercolor
.
isNotEmpty
||
bordersize
.
isNotEmpty
||
border
work
color
.
isNotEmpty
)
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
const
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
2
0
)),
const
Padding
(
padding:
EdgeInsets
.
only
(
left:
10
,
bottom:
3
0
)),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
'Body Design Color:
$body
_design_
color
\n
'
),
Text
(
'Body Design Color:
$body
design
color
\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:
2
0
)),
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
3
0
)),
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
||
body
design
color
.
isNotEmpty
||
bordercolor
.
isNotEmpty
||
bordersize
.
isNotEmpty
||
border
work
color
.
isNotEmpty
)
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
const
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
2
0
)),
const
Padding
(
padding:
EdgeInsets
.
only
(
left:
10
,
bottom:
3
0
)),
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:
$body
design
color
\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:
$border
work
color
\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
'
);
body
design
color
=
jsonResponse
[
'body_design_color'
];
print
(
'One :
$body
design
color
'
);
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
'
);
border
work
color
=
jsonResponse
[
'border_work_color'
];
print
(
'One :
$border
work
color
'
);
}
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
=
''
;
body
design
color
=
''
;
bordercolor
=
''
;
bordersize
=
''
;
border
work
color
=
''
;
}
});
_pageController
.
jumpToPage
(
0
);
...
...
lib/SignUp.dart
View file @
63e78c2e
...
...
@@ -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
>(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment