Commit 75599bfa by Ramesh Babu Puvvadi

added UI Changes

parent 63e78c2e
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<application <application
android:label="vasthram" android:label="vasthram"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/appicon">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" 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":"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"}]}
"images" : [ \ No newline at end of file
{
"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"
}
}
...@@ -11,7 +11,7 @@ class Constants { ...@@ -11,7 +11,7 @@ class Constants {
late AlertDialog alert; 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;
} }
...@@ -154,10 +154,10 @@ class Constants { ...@@ -154,10 +154,10 @@ class Constants {
static LinearGradient getReturn() { static LinearGradient getReturn() {
const LinearGradient gradient = LinearGradient( const LinearGradient gradient = LinearGradient(
colors: [ colors: [
//Color(0xFF4da2dd), // Color(0xFF8c4756),
Color(0xFFaa39e6), Color(0xFF453348),
//Color(0xFFC2185B), Color(0xFF453348),
Color(0xFF7b32fe) //Color(0xFF7b32fe)
], ],
begin: Alignment.bottomLeft, begin: Alignment.bottomLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
......
...@@ -20,6 +20,7 @@ class _Home extends State<Home> { ...@@ -20,6 +20,7 @@ class _Home extends State<Home> {
late List<File> arraylist = []; late List<File> arraylist = [];
XFile? image; XFile? image;
bool isloading = false; bool isloading = false;
bool isVisible = true;
var bodycolor = ''; var bodycolor = '';
var bodydesigncolor = ''; var bodydesigncolor = '';
var bordercolor = ''; var bordercolor = '';
...@@ -34,6 +35,7 @@ class _Home extends State<Home> { ...@@ -34,6 +35,7 @@ class _Home extends State<Home> {
if (image != null) { if (image != null) {
setState(() { setState(() {
imagefile = File(image!.path); imagefile = File(image!.path);
isVisible = true;
}); });
} else { } else {
image = await _picker.pickImage(source: ImageSource.camera); image = await _picker.pickImage(source: ImageSource.camera);
...@@ -111,37 +113,318 @@ class _Home extends State<Home> { ...@@ -111,37 +113,318 @@ class _Home extends State<Home> {
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
const Padding(padding: EdgeInsets.only(left: 10, bottom: 30)), const Padding(padding: EdgeInsets.only(left: 10, bottom: 10)),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ 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( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ 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( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ 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( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ 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( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ 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 else
...@@ -168,10 +451,18 @@ class _Home extends State<Home> { ...@@ -168,10 +451,18 @@ class _Home extends State<Home> {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: const Text('VASTHRAM'), title: const Text(
'CAPTURE IMAGE',
style: Constants.fontStyle,
),
actions: [ actions: [
IconButton( 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 { onPressed: () async {
bool valid = await Constants.checkInternetConnectivity(); bool valid = await Constants.checkInternetConnectivity();
if (valid) { if (valid) {
...@@ -179,7 +470,8 @@ class _Home extends State<Home> { ...@@ -179,7 +470,8 @@ 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').showAlertDialog(context, true); Constants('Vasthram', 'Check your internet connection')
.showAlertDialog(context, true);
} }
}, },
), ),
...@@ -190,115 +482,127 @@ class _Home extends State<Home> { ...@@ -190,115 +482,127 @@ class _Home extends State<Home> {
), ),
), ),
), ),
body: SingleChildScrollView( body: Container(
child: Container( decoration: const BoxDecoration(
margin: const EdgeInsets.all(10.0), image: DecorationImage(
child: Column( image: AssetImage("assets/images/bg.png"),
mainAxisAlignment: MainAxisAlignment.start, fit: BoxFit.cover, // Adjust as needed
children: <Widget>[ ),
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceAround, child: SingleChildScrollView(
children: [ child: Container(
Column( margin: const EdgeInsets.all(10.0),
children: [ child: Column(
const Padding(padding: EdgeInsets.only(top: 5)), mainAxisAlignment: MainAxisAlignment.start,
const Text( children: <Widget>[
'Capture Image', Row(
style: TextStyle( mainAxisAlignment: MainAxisAlignment.spaceAround,
fontSize: 18, children: [
color: Colors.black, Column(
fontStyle: FontStyle.normal, children: [
fontWeight: FontWeight.bold, const Padding(padding: EdgeInsets.only(top: 5)),
), GestureDetector(
), onTap: () {
const Padding(padding: EdgeInsets.only(top: 15)), _getImage(0);
GestureDetector( },
onTap: () { child: SizedBox(
_getImage(0); width: MediaQuery.of(context).size.width * 0.94,
}, height: MediaQuery.of(context).size.height * 0.50,
child: SizedBox( child: imagefile != null
width: MediaQuery.of(context).size.width * 0.94, ? Image.file(
height: MediaQuery.of(context).size.height * 0.50, imagefile!,
child: imagefile != null fit: BoxFit.cover,
? Image.file( )
imagefile!, : Image.asset(
fit: BoxFit.cover, 'assets/images/captureimage.png',
) width: MediaQuery.of(context).size.width *
: Image.asset( 0.80,
'assets/images/camera.png', height: MediaQuery.of(context).size.height *
width: 0.60,
MediaQuery.of(context).size.width * 0.80, ),
height: ),
MediaQuery.of(context).size.height * 0.60,
),
), ),
), ],
], ),
),
],
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.25,
child: PageView(
controller: _pageController,
children: pages = [
buildPage1(
'Page 1'), // Replace with your content for the first object
buildPage2('Page 2'),
buildPage3(
'Page 3'), // Replace with your content for the second object
// Add more pages for other objects
], ],
), ),
), SizedBox(
ElevatedButton( height: MediaQuery.of(context).size.height * 0.35,
style: ElevatedButton.styleFrom( child: PageView(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10), controller: _pageController,
backgroundColor: const Color.fromARGB(255, 170, 57, 230), children: pages = [
minimumSize: const Size.fromHeight(50), buildPage1('Page 1'),
buildPage2('Page 2'),
buildPage3('Page 3'),
],
),
), ),
onPressed: () async { Visibility(
if (imagefile == null) { visible: isVisible,
Constants('Vasthram', 'Please Capture Image') child: ElevatedButton(
.showAlertDialog(context, true); style: ButtonStyle(
} else { shape: MaterialStateProperty.all<RoundedRectangleBorder>(
isloading = true; RoundedRectangleBorder(
bool isInternetConnected = borderRadius: BorderRadius.circular(
await Constants.checkInternetConnectivity(); 50.0), // Adjust the radius as needed
if (isInternetConnected) { ),
showDialog( ),
context: context, minimumSize: MaterialStateProperty.all<Size>(
builder: (context) { const Size(double.infinity, 50),
return const Center( ),
child: CircularProgressIndicator(), backgroundColor: MaterialStateProperty.all<Color>(
const Color.fromARGB(255, 126, 69,
85), // Adjust the background color as needed
),
),
onPressed: () async {
if (imagefile == null) {
Constants('Vasthram', 'Please Capture Image')
.showAlertDialog(context, true);
} else {
isloading = true;
bool isInternetConnected =
await Constants.checkInternetConnectivity();
if (isInternetConnected) {
showDialog(
context: context,
builder: (context) {
return const Center(
child: CircularProgressIndicator(),
);
},
); );
},
);
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); var upload =
setState(() { await RemoteData().uploadimage(imagefile!);
isloading = false; 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')
.showAlertDialog(context, true);
}
} }
},
Navigator.of(context).pop(); child: const Text(
} else { 'UPLOAD IMAGE',
Constants('Vasthram', 'Check your internet connection') style: Constants.buttonsfontStyle,
.showAlertDialog(context, true); ),
} ),
} ),
}, ],
child: const Text('Upload Image'), ),
),
],
), ),
), ),
), ),
...@@ -309,23 +613,21 @@ class _Home extends State<Home> { ...@@ -309,23 +613,21 @@ class _Home extends State<Home> {
setState(() { setState(() {
// Update variables based on jsonResponse // Update variables based on jsonResponse
status = jsonResponse['status']; status = jsonResponse['status'];
print(status); //print(status);
if (status == 'Success') { if (status == 'Success') {
print('One :$status'); //print('One :$status');
bodycolor = jsonResponse['body_color']; bodycolor = jsonResponse['body_color'];
print('One :$bodycolor'); //print('One :$bodycolor');
bodydesigncolor = jsonResponse['body_design_color']; bodydesigncolor = jsonResponse['body_design_color'];
print('One :$bodydesigncolor'); //print('One :$bodydesigncolor');
bordercolor = jsonResponse['border_color']; bordercolor = jsonResponse['border_color'];
print('One :$bordercolor'); //print('One :$bordercolor');
bordersize = jsonResponse['border_size']; bordersize = jsonResponse['border_size'];
print('One :$bordersize'); //print('One :$bordersize');
borderworkcolor = jsonResponse['border_work_color']; borderworkcolor = jsonResponse['border_work_color'];
print('One :$borderworkcolor'); //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');
bodycolor = ''; bodycolor = '';
bodydesigncolor = ''; bodydesigncolor = '';
......
...@@ -20,11 +20,9 @@ class RemoteData { ...@@ -20,11 +20,9 @@ class RemoteData {
? 'IOS' ? 'IOS'
: 'Unknown', : 'Unknown',
}; };
if (kDebugMode) { if (kDebugMode) {
print(body); print(body);
} }
var client = http.Client(); var client = http.Client();
var res = await client.post(Uri.parse(loginUrl), var res = await client.post(Uri.parse(loginUrl),
headers: {type: appjson}, body: json.encode(body)); headers: {type: appjson}, body: json.encode(body));
......
...@@ -38,7 +38,8 @@ class _SignUpState extends State<SignUp> { ...@@ -38,7 +38,8 @@ 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(context, MaterialPageRoute(builder: (context) => const Home())); Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => const Home()));
} }
} else { } else {
Navigator.pop(context); Navigator.pop(context);
...@@ -66,34 +67,82 @@ class _SignUpState extends State<SignUp> { ...@@ -66,34 +67,82 @@ class _SignUpState extends State<SignUp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(
title: const Text('Login '),
flexibleSpace: Container(
decoration: BoxDecoration(
gradient: Constants.getReturn(),
),
),
),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Container( 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( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox( const SizedBox(
height: 50, height: 150,
child: TextFormField( ),
cursorColor: const Color.fromARGB(255, 125, 50, 253),
keyboardType: TextInputType.number, Image.asset(
controller: _email, "assets/images/logo.png",
scrollPadding: const EdgeInsets.all(100.0), width: 250, // Adjust the width as needed
decoration: const InputDecoration( height: 125, // Adjust the height as needed
hintText: 'UserId', ),
border: OutlineInputBorder(), const SizedBox(
focusedBorder: OutlineInputBorder( height: 20,
borderSide: BorderSide( ),
color: Color.fromARGB(255, 125, 50, 253), // 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, 126, 69, 85),
keyboardType: TextInputType.number,
controller: _email,
scrollPadding: const EdgeInsets.all(100.0),
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,41 +151,92 @@ class _SignUpState extends State<SignUp> { ...@@ -102,41 +151,92 @@ class _SignUpState extends State<SignUp> {
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
SizedBox( Padding(
height: 50, padding: const EdgeInsets.only(
child: TextField( top: 0,
cursorColor: const Color.fromARGB(255, 125, 50, 253), left: 20.0,
obscureText: true, right: 20.0,
controller: _pass, bottom: 0), // Adjust padding as needed
decoration: const InputDecoration( child: SizedBox(
hintText: 'Password', height: 50,
border: OutlineInputBorder(), child: TextFormField(
focusedBorder: OutlineInputBorder( cursorColor: const Color.fromARGB(255, 126, 69, 85),
borderSide: BorderSide( obscureText: true,
color: Color.fromARGB(255, 125, 50, 253), controller: _pass,
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( const SizedBox(
height: 30, height: 80,
), ),
ElevatedButton( Padding(
onPressed: () async { padding: const EdgeInsets.only(
Constants.saveLoginCredentials( top: 0,
'', _email.text, '', '', '', true); left: 20.0,
Navigator.pushReplacement(context, right: 20.0,
MaterialPageRoute(builder: (context) => const Home())); bottom: 0), // Adjust padding as needed
}, child: ElevatedButton(
style: ButtonStyle( onPressed: () async {
backgroundColor: MaterialStateProperty.all<Color>( Constants.saveLoginCredentials(
const Color.fromARGB(255, 170, 57, 230)), '', _email.text, '', '', '', true);
), Navigator.pushReplacement(context,
child: const SizedBox( MaterialPageRoute(builder: (context) => const Home()));
height: 50, },
child: Center( style: ButtonStyle(
child: Text('Sign In'), 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
),
),
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',
style: Constants.buttonsfontStyle,
),
),
),
],
), ),
), ),
), ),
......
import 'dart:async'; import 'dart:async';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:vasthram/Home.dart'; import 'package:vasthram/Home.dart';
import 'package:vasthram/SignUp.dart'; import 'package:vasthram/SignUp.dart';
class UserPreferences { class UserPreferences {
static const String isLoggedInKey = 'isLoggedIn'; static const String isLoggedInKey = 'isLoggedIn';
static Future<SharedPreferences> getSharedPreferences() async { static Future<SharedPreferences> getSharedPreferences() async {
return await SharedPreferences.getInstance(); return await SharedPreferences.getInstance();
} }
...@@ -28,7 +26,6 @@ class SplashScreen extends StatefulWidget { ...@@ -28,7 +26,6 @@ class SplashScreen extends StatefulWidget {
class SplashScreenState extends State<SplashScreen> { class SplashScreenState extends State<SplashScreen> {
bool? isLoggedIn = false; bool? isLoggedIn = false;
void timeToShowSplashScreenOnScreen() async { void timeToShowSplashScreenOnScreen() async {
Timer(const Duration(seconds: 3), () async { Timer(const Duration(seconds: 3), () async {
if (!mounted) return; if (!mounted) return;
...@@ -45,14 +42,12 @@ class SplashScreenState extends State<SplashScreen> { ...@@ -45,14 +42,12 @@ class SplashScreenState extends State<SplashScreen> {
context, MaterialPageRoute(builder: (context) => const Home())); context, MaterialPageRoute(builder: (context) => const Home()));
} else { } else {
if (kDebugMode) { if (kDebugMode) {
print('else condition :$isLoggedIn'); //print('else condition :$isLoggedIn');
} }
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
MaterialPageRoute(builder: (context) => const SignUp()), MaterialPageRoute(builder: (context) => const SignUp()),
(Route<dynamic> route) => false, (Route<dynamic> route) => false);
);
// }
} }
}); });
} }
......
...@@ -63,7 +63,14 @@ flutter: ...@@ -63,7 +63,14 @@ flutter:
assets: assets:
- assets/images/camera.png - assets/images/camera.png
- assets/images/splash.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: # To add assets to your application, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
......
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