Commit 75599bfa by Ramesh Babu Puvvadi

added UI Changes

parent 63e78c2e
......@@ -4,7 +4,7 @@
<application
android:label="vasthram"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/appicon">
<activity
android:name=".MainActivity"
android:exported="true"
......
assets/images/splash.png

42.6 KB | W: | H:

assets/images/splash.png

1.05 MB | W: | H:

assets/images/splash.png
assets/images/splash.png
assets/images/splash.png
assets/images/splash.png
  • 2-up
  • Swipe
  • Onion skin
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"idiom":"watch","filename":"172.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"86x86","expected-size":"172","role":"quickLook"},{"idiom":"watch","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"40x40","expected-size":"80","role":"appLauncher"},{"idiom":"watch","filename":"88.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"40mm","scale":"2x","size":"44x44","expected-size":"88","role":"appLauncher"},{"idiom":"watch","filename":"102.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"45x45","expected-size":"102","role":"appLauncher"},{"idiom":"watch","filename":"92.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"41mm","scale":"2x","size":"46x46","expected-size":"92","role":"appLauncher"},{"idiom":"watch","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"50x50","expected-size":"100","role":"appLauncher"},{"idiom":"watch","filename":"196.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"98x98","expected-size":"196","role":"quickLook"},{"idiom":"watch","filename":"216.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"44mm","scale":"2x","size":"108x108","expected-size":"216","role":"quickLook"},{"idiom":"watch","filename":"48.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"38mm","scale":"2x","size":"24x24","expected-size":"48","role":"notificationCenter"},{"idiom":"watch","filename":"55.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"42mm","scale":"2x","size":"27.5x27.5","expected-size":"55","role":"notificationCenter"},{"idiom":"watch","filename":"66.png","folder":"Assets.xcassets/AppIcon.appiconset/","subtype":"45mm","scale":"2x","size":"33x33","expected-size":"66","role":"notificationCenter"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"3x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch","role":"companionSettings","scale":"2x"},{"size":"1024x1024","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"watch-marketing","scale":"1x"},{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]}
\ No newline at end of file
......@@ -154,10 +154,10 @@ class Constants {
static LinearGradient getReturn() {
const LinearGradient gradient = LinearGradient(
colors: [
//Color(0xFF4da2dd),
Color(0xFFaa39e6),
//Color(0xFFC2185B),
Color(0xFF7b32fe)
// Color(0xFF8c4756),
Color(0xFF453348),
Color(0xFF453348),
//Color(0xFF7b32fe)
],
begin: Alignment.bottomLeft,
end: Alignment.bottomRight,
......
......@@ -20,6 +20,7 @@ class _Home extends State<Home> {
late List<File> arraylist = [];
XFile? image;
bool isloading = false;
bool isVisible = true;
var bodycolor = '';
var bodydesigncolor = '';
var bordercolor = '';
......@@ -34,6 +35,7 @@ class _Home extends State<Home> {
if (image != null) {
setState(() {
imagefile = File(image!.path);
isVisible = true;
});
} else {
image = await _picker.pickImage(source: ImageSource.camera);
......@@ -111,37 +113,318 @@ class _Home extends State<Home> {
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Padding(padding: EdgeInsets.only(left: 10, bottom: 30)),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 10)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Body Color: $bodycolor\n'),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 140, 71, 86),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: const Column(
children: [
Text(
'Body Color: ',
style: TextStyle(
fontSize: 16,
color: Colors.white,
),
),
],
),
),
),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 255, 255, 255),
borderRadius: BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: Column(
children: [
Text(
bodycolor,
style: const TextStyle(
fontSize: 16,
color: Color.fromARGB(
255,
140,
71,
86,
),
),
),
],
),
),
),
],
),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 10)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Body Design Color: $bodydesigncolor\n'),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 140, 71, 86),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: const Column(
children: [
Text(
'Body Design Color: ',
style: TextStyle(
fontSize: 16,
color: Colors.white,
),
),
],
),
),
),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 255, 255, 255),
borderRadius: BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: Column(
children: [
Text(
bodydesigncolor,
style: const TextStyle(
fontSize: 16,
color: Color.fromARGB(
255,
140,
71,
86,
),
),
),
],
),
),
),
],
),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 10)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Color: $bordercolor\n'),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 140, 71, 86),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: const Column(
children: [
Text(
'Border Color: ',
style: TextStyle(
fontSize: 16,
color: Colors.white,
),
),
],
),
),
),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 255, 255, 255),
borderRadius: BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: Column(
children: [
Text(
bordercolor,
style: const TextStyle(
fontSize: 16,
color: Color.fromARGB(
255,
140,
71,
86,
),
),
),
],
),
),
),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text('Body Design Color: $bodydesigncolor\n'),
// ],
// ),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 10)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Size: $bordersize\n'),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 140, 71, 86),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: const Column(
children: [
Text(
'Body Size: ',
style: TextStyle(
fontSize: 16,
color: Colors.white,
),
),
],
),
),
),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 255, 255, 255),
borderRadius: BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: Column(
children: [
Text(
bordersize,
style: const TextStyle(
fontSize: 16,
color: Color.fromARGB(
255,
140,
71,
86,
),
),
),
],
),
),
),
],
),
const Padding(padding: EdgeInsets.only(left: 10, bottom: 10)),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Border Work Color: $borderworkcolor\n'),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 140, 71, 86),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: const Column(
children: [
Text(
'Body Work Color: ',
style: TextStyle(
fontSize: 16,
color: Colors.white,
),
),
],
),
),
),
Expanded(
child: Container(
decoration: const BoxDecoration(
color: Color.fromARGB(255, 255, 255, 255),
borderRadius: BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
padding: const EdgeInsets.all(10),
child: Column(
children: [
Text(
borderworkcolor,
style: const TextStyle(
fontSize: 16,
color: Color.fromARGB(
255,
140,
71,
86,
),
),
),
],
),
),
),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text('Border Color: $bordercolor\n'),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text('Border Size: $bordersize\n'),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text('Border Work Color: $borderworkcolor\n'),
// ],
// ),
],
)
else
......@@ -168,10 +451,18 @@ class _Home extends State<Home> {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: const Text('VASTHRAM'),
title: const Text(
'CAPTURE IMAGE',
style: Constants.fontStyle,
),
actions: [
IconButton(
icon: const Icon(Icons.logout),
icon: Image.asset(
"assets/images/signout.png",
width: 24, // Adjust the width as needed
height: 24, // Adjust the height as needed
//color: Colors.grey, // Icon color
),
onPressed: () async {
bool valid = await Constants.checkInternetConnectivity();
if (valid) {
......@@ -179,7 +470,8 @@ 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);
}
},
),
......@@ -190,7 +482,14 @@ class _Home extends State<Home> {
),
),
),
body: SingleChildScrollView(
body: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bg.png"),
fit: BoxFit.cover, // Adjust as needed
),
),
child: SingleChildScrollView(
child: Container(
margin: const EdgeInsets.all(10.0),
child: Column(
......@@ -202,16 +501,6 @@ class _Home extends State<Home> {
Column(
children: [
const Padding(padding: EdgeInsets.only(top: 5)),
const Text(
'Capture Image',
style: TextStyle(
fontSize: 18,
color: Colors.black,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.bold,
),
),
const Padding(padding: EdgeInsets.only(top: 15)),
GestureDetector(
onTap: () {
_getImage(0);
......@@ -225,11 +514,11 @@ class _Home extends State<Home> {
fit: BoxFit.cover,
)
: Image.asset(
'assets/images/camera.png',
width:
MediaQuery.of(context).size.width * 0.80,
height:
MediaQuery.of(context).size.height * 0.60,
'assets/images/captureimage.png',
width: MediaQuery.of(context).size.width *
0.80,
height: MediaQuery.of(context).size.height *
0.60,
),
),
),
......@@ -238,24 +527,33 @@ class _Home extends State<Home> {
],
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.25,
height: MediaQuery.of(context).size.height * 0.35,
child: PageView(
controller: _pageController,
children: pages = [
buildPage1(
'Page 1'), // Replace with your content for the first object
buildPage1('Page 1'),
buildPage2('Page 2'),
buildPage3(
'Page 3'), // Replace with your content for the second object
// Add more pages for other objects
buildPage3('Page 3'),
],
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
backgroundColor: const Color.fromARGB(255, 170, 57, 230),
minimumSize: const Size.fromHeight(50),
Visibility(
visible: isVisible,
child: ElevatedButton(
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
50.0), // Adjust the radius as needed
),
),
minimumSize: MaterialStateProperty.all<Size>(
const Size(double.infinity, 50),
),
backgroundColor: MaterialStateProperty.all<Color>(
const Color.fromARGB(255, 126, 69,
85), // Adjust the background color as needed
),
),
onPressed: () async {
if (imagefile == null) {
......@@ -275,33 +573,39 @@ class _Home extends State<Home> {
},
);
var upload = await RemoteData().uploadimage(imagefile!);
var upload =
await RemoteData().uploadimage(imagefile!);
if (upload != null) {
setState(() {
isloading = true;
});
var jsonResponse = jsonDecode(upload);
await Future.delayed(const Duration(seconds: 2));
updateUI(jsonResponse);
setState(() {
isloading = false;
isVisible = false;
});
}
Navigator.of(context).pop();
} else {
Constants('Vasthram', 'Check your internet connection')
Constants(
'Vasthram', 'Check your internet connection')
.showAlertDialog(context, true);
}
}
},
child: const Text('Upload Image'),
child: const Text(
'UPLOAD IMAGE',
style: Constants.buttonsfontStyle,
),
),
),
],
),
),
),
),
);
}
......@@ -309,23 +613,21 @@ class _Home extends State<Home> {
setState(() {
// Update variables based on jsonResponse
status = jsonResponse['status'];
print(status);
//print(status);
if (status == 'Success') {
print('One :$status');
//print('One :$status');
bodycolor = jsonResponse['body_color'];
print('One :$bodycolor');
//print('One :$bodycolor');
bodydesigncolor = jsonResponse['body_design_color'];
print('One :$bodydesigncolor');
//print('One :$bodydesigncolor');
bordercolor = jsonResponse['border_color'];
print('One :$bordercolor');
//print('One :$bordercolor');
bordersize = jsonResponse['border_size'];
print('One :$bordersize');
//print('One :$bordersize');
borderworkcolor = jsonResponse['border_work_color'];
print('One :$borderworkcolor');
//print('One :$borderworkcolor');
} else {
print('Two :$status');
//print('Two :$status');
Constants.dialogMessage(context, 'Vasthram', 'Could not found image');
bodycolor = '';
bodydesigncolor = '';
......
......@@ -20,11 +20,9 @@ class RemoteData {
? 'IOS'
: 'Unknown',
};
if (kDebugMode) {
print(body);
}
var client = http.Client();
var res = await client.post(Uri.parse(loginUrl),
headers: {type: appjson}, body: json.encode(body));
......
......@@ -38,7 +38,8 @@ 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);
......@@ -66,34 +67,82 @@ class _SignUpState extends State<SignUp> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Login '),
flexibleSpace: Container(
decoration: BoxDecoration(
gradient: Constants.getReturn(),
),
),
),
resizeToAvoidBottomInset: false,
body: Container(
margin: const EdgeInsets.all(15.0),
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bg.png"),
fit: BoxFit.cover, // Adjust as needed
),
),
//margin: const EdgeInsets.all(25.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
const SizedBox(
height: 150,
),
Image.asset(
"assets/images/logo.png",
width: 250, // Adjust the width as needed
height: 125, // Adjust the height as needed
),
const SizedBox(
height: 20,
),
// image: DecorationImage(
// image: AssetImage("assets/images/bg.png"),
// fit: BoxFit.cover, // Adjust as needed
// ),
const Padding(
padding: EdgeInsets.only(
top: 40.0,
left: 20.0,
right: 20.0,
bottom: 0), // Adjust padding as needed
child: SizedBox(
height: 60,
child: Text(
'LOGIN',
style: Constants.buttonsfontStyle,
),
)),
Padding(
padding: const EdgeInsets.only(
top: 0,
left: 20.0,
right: 20.0,
bottom: 0), // Adjust padding as needed
child: SizedBox(
height: 50,
child: TextFormField(
cursorColor: const Color.fromARGB(255, 125, 50, 253),
cursorColor: const Color.fromARGB(255, 126, 69, 85),
keyboardType: TextInputType.number,
controller: _email,
scrollPadding: const EdgeInsets.all(100.0),
decoration: const InputDecoration(
hintText: 'UserId',
border: OutlineInputBorder(),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Color.fromARGB(255, 125, 50, 253),
decoration: InputDecoration(
contentPadding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
hintText: 'USER ID',
filled: true,
fillColor: const Color.fromARGB(255, 224, 226, 228),
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(50),
),
suffixIcon: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: IconButton(
onPressed: () {},
icon: Image.asset(
"assets/images/user.png",
width: 24, // Adjust the width as needed
height: 24, // Adjust the height as needed
//color: Colors.grey, // Icon color
),
),
),
),
),
......@@ -102,27 +151,53 @@ class _SignUpState extends State<SignUp> {
const SizedBox(
height: 20,
),
SizedBox(
Padding(
padding: const EdgeInsets.only(
top: 0,
left: 20.0,
right: 20.0,
bottom: 0), // Adjust padding as needed
child: SizedBox(
height: 50,
child: TextField(
cursorColor: const Color.fromARGB(255, 125, 50, 253),
child: TextFormField(
cursorColor: const Color.fromARGB(255, 126, 69, 85),
obscureText: true,
controller: _pass,
decoration: const InputDecoration(
hintText: 'Password',
border: OutlineInputBorder(),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Color.fromARGB(255, 125, 50, 253),
decoration: InputDecoration(
contentPadding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
hintText: 'PASSWORD',
filled: true,
fillColor: const Color.fromARGB(255, 224, 226, 228),
border: OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.circular(50)),
suffixIcon: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: IconButton(
onPressed: () {
// Add your icon button action here
},
icon: Image.asset(
"assets/images/password.png",
width: 24, // Adjust the width as needed
height: 24, // Adjust the height as needed
),
),
),
),
),
const SizedBox(
height: 30,
),
ElevatedButton(
),
const SizedBox(
height: 80,
),
Padding(
padding: const EdgeInsets.only(
top: 0,
left: 20.0,
right: 20.0,
bottom: 0), // Adjust padding as needed
child: ElevatedButton(
onPressed: () async {
Constants.saveLoginCredentials(
'', _email.text, '', '', '', true);
......@@ -130,13 +205,38 @@ class _SignUpState extends State<SignUp> {
MaterialPageRoute(builder: (context) => const Home()));
},
style: ButtonStyle(
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
50.0), // Adjust the radius as needed
),
),
minimumSize: MaterialStateProperty.all<Size>(
const Size(double.infinity, 50),
),
backgroundColor: MaterialStateProperty.all<Color>(
const Color.fromARGB(255, 170, 57, 230)),
const Color.fromARGB(255, 126, 69,
85), // Adjust the background color as needed
),
child: const SizedBox(
height: 50,
),
child: Row(
children: [
SizedBox(
child: Image.asset(
"assets/images/signin.png",
width: 48, // Adjust the width as needed
height: 48, // Adjust the height as needed
),
),
const Expanded(
child: Center(
child: Text('Sign In'),
child: Text(
'SIGN IN',
style: Constants.buttonsfontStyle,
),
),
),
],
),
),
),
......
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:vasthram/Home.dart';
import 'package:vasthram/SignUp.dart';
class UserPreferences {
static const String isLoggedInKey = 'isLoggedIn';
static Future<SharedPreferences> getSharedPreferences() async {
return await SharedPreferences.getInstance();
}
......@@ -28,7 +26,6 @@ class SplashScreen extends StatefulWidget {
class SplashScreenState extends State<SplashScreen> {
bool? isLoggedIn = false;
void timeToShowSplashScreenOnScreen() async {
Timer(const Duration(seconds: 3), () async {
if (!mounted) return;
......@@ -45,14 +42,12 @@ class SplashScreenState extends State<SplashScreen> {
context, MaterialPageRoute(builder: (context) => const Home()));
} else {
if (kDebugMode) {
print('else condition :$isLoggedIn');
//print('else condition :$isLoggedIn');
}
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => const SignUp()),
(Route<dynamic> route) => false,
);
// }
(Route<dynamic> route) => false);
}
});
}
......
......@@ -63,6 +63,13 @@ flutter:
assets:
- assets/images/camera.png
- assets/images/splash.png
- assets/images/bg.png
- assets/images/logo.png
- assets/images/user.png
- assets/images/signin.png
- assets/images/password.png
- assets/images/signout.png
- assets/images/captureimage.png
# To add assets to your application, add an assets section, like this:
# assets:
......
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