splash screen and login completed

master
Sneha 12 months ago
parent be908d7dcb
commit cfbd6ce6e7

@ -0,0 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
<method v="2" />
</configuration>
</component>

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion 33
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
compileOptions { compileOptions {
@ -47,7 +47,7 @@ android {
applicationId "com.example.healthcare_delivery" applicationId "com.example.healthcare_delivery"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion minSdkVersion 28
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.7.10'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

@ -69,7 +69,7 @@ class _DashboardState extends State<Dashboard> {
Widget _dashBoard() { Widget _dashBoard() {
return Container( return Container(
color: screenBackgroundColor, color: primaryColor,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
@ -81,7 +81,7 @@ class _DashboardState extends State<Dashboard> {
//color: Colors.red, //color: Colors.red,
child: FittedBox( child: FittedBox(
child:Image( child:Image(
image: const AssetImage('images/appbgsuplier.png'), image: const AssetImage('images/mobilebg.png'),
), ),
fit: BoxFit.fill, fit: BoxFit.fill,
@ -115,8 +115,9 @@ class _DashboardState extends State<Dashboard> {
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.fromLTRB(30, 10,10,10), child: Image(image: AssetImage(
child: new SvgPicture.asset("assets/images/booking_request.svg") "images/seekopinion.png"),
),
), ),
Text('Booking Data',style: dashboardTextStyle(),), Text('Booking Data',style: dashboardTextStyle(),),

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:path/path.dart' as Path;
import 'package:healthcare_delivery/common/otpscreen.dart'; import 'package:healthcare_delivery/common/otpscreen.dart';
import 'package:healthcare_delivery/common/settings.dart'; import 'package:healthcare_delivery/common/settings.dart';
@ -69,14 +68,14 @@ class _LoginState extends State<Login> {
return WillPopScope( return WillPopScope(
onWillPop: () async => onWillPop(), onWillPop: () async => onWillPop(),
child: Scaffold( child: Scaffold(
backgroundColor: primaryColor,
body: Stack( body: Stack(
children: <Widget>[ children: <Widget>[
Container( /*Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage(image:AssetImage("images/backgroundimage.png"), fit: BoxFit.cover,), image: DecorationImage(image:AssetImage("images/backgroundimage.png"), fit: BoxFit.cover,),
), ),
), ),*/
GestureDetector( GestureDetector(
onTap: () { onTap: () {
FocusManager.instance.primaryFocus?.unfocus(); FocusManager.instance.primaryFocus?.unfocus();
@ -87,8 +86,8 @@ class _LoginState extends State<Login> {
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const SizedBox( SizedBox(
height: 15, height:MediaQuery.of(context).size.height * .05,
), ),
Container( Container(
//width: double.infinity, //width: double.infinity,
@ -96,29 +95,29 @@ class _LoginState extends State<Login> {
image: const AssetImage('images/logo.png'), image: const AssetImage('images/logo.png'),
height: MediaQuery.of(context).size.height * .25, height: MediaQuery.of(context).size.height * .25,
)), )),
const SizedBox( SizedBox(
height: 15, height:MediaQuery.of(context).size.height * .05,
), ),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(0),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: Colors.white,
controller: mobileNumberController, controller: mobileNumberController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
style: TextStyle(color: Colors.white),
decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'), decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'),
), ),
), ),
const SizedBox( SizedBox(
height: 15, height:MediaQuery.of(context).size.height * .02,
), ),
Container( Container(
width: 400, width:double.infinity,
height: 50, height: MediaQuery.of(context).size.height * .05,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: buttonColors, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async{ onPressed: () async{
@ -140,7 +139,7 @@ class _LoginState extends State<Login> {
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OtpScreen(phoneNumber:mobileNumberController.text)), builder: (context) => OtpScreen(myObject:mobileNumberController.text)),
); );
AppSettings.longSuccessToast("OTP sent Successfully"); AppSettings.longSuccessToast("OTP sent Successfully");
mobileNumberController.text=''; mobileNumberController.text='';

@ -1,13 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_delivery/common/dashboard.dart'; import 'package:healthcare_delivery/common/dashboard.dart';
import 'package:healthcare_delivery/common/login.dart';
import 'package:healthcare_delivery/common/settings.dart'; import 'package:healthcare_delivery/common/settings.dart';
class OtpScreen extends StatefulWidget { class OtpScreen extends StatefulWidget {
var myObject;
var phoneNumber; OtpScreen({this.myObject});
OtpScreen({
this.phoneNumber
});
@override @override
State<OtpScreen> createState() => _OtpScreenState(); State<OtpScreen> createState() => _OtpScreenState();
@ -21,7 +18,12 @@ class _OtpScreenState extends State<OtpScreen> {
final TextEditingController _fieldFour = TextEditingController(); final TextEditingController _fieldFour = TextEditingController();
final TextEditingController _fieldFive = TextEditingController(); final TextEditingController _fieldFive = TextEditingController();
final TextEditingController _fieldSix = TextEditingController(); final TextEditingController _fieldSix = TextEditingController();
TextEditingController phoneverificationCodeController = TextEditingController(); TextEditingController mobileNumberController = TextEditingController();
TextEditingController passwordController = TextEditingController();
bool isTextfieldVisible=true;
bool isOtpVisible=false;
bool isObscureText=true;
// This is the entered code // This is the entered code
// It will be displayed in a Text widget // It will be displayed in a Text widget
@ -29,16 +31,62 @@ class _OtpScreenState extends State<OtpScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: screenBackgroundColor,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Text('Phone Number Verification'), const Text('Phone Number Verification'),
Visibility(
visible: false,
child: Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: mobileNumberController,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.phone,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color:greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter MobileNumber',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),),
const SizedBox( const SizedBox(
height: 30, height: 30,
), ),
Visibility(
visible: false,
child: Container(
width: MediaQuery.of(context).size.width * .99,
height: 50,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: ()async {
},
child: const Text('Submit')),
),),
// Implement 4 input fields // Implement 4 input fields
Row( Visibility(
visible:true,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
OtpInput(_fieldOne, true), // auto focus OtpInput(_fieldOne, true), // auto focus
@ -48,11 +96,59 @@ class _OtpScreenState extends State<OtpScreen> {
OtpInput(_fieldFive, false), OtpInput(_fieldFive, false),
OtpInput(_fieldSix, false), OtpInput(_fieldSix, false),
], ],
),),
const SizedBox(
height: 30,
), ),
Visibility(
visible: false,
child: Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
obscureText: isObscureText,
controller: passwordController,
decoration: InputDecoration(
labelText: 'Password',
prefixIcon: const Icon(Icons.password, color: greyColor,),
labelStyle: const TextStyle(
color: greyColor, //<-- SEE HERE
),
border: const OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: textFieldStartColor),
),
suffixIcon: IconButton(
icon: Icon(
Icons.visibility_off_outlined,
color: isObscureText==true?greyColor:primaryColor,
),
onPressed: () {
print("show password");
setState(() {
isObscureText = !isObscureText;
});
},
),
),
),
),),
const SizedBox( const SizedBox(
height: 30, height: 30,
), ),
ElevatedButton( Visibility(
visible: true,
child: Container(
width: MediaQuery.of(context).size.width * .99,
height: 50,
child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: primaryColor, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
@ -67,7 +163,6 @@ class _OtpScreenState extends State<OtpScreen> {
_fieldSix.text; _fieldSix.text;
}); });
if (_otp!.length == 6) { if (_otp!.length == 6) {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
@ -76,48 +171,40 @@ class _OtpScreenState extends State<OtpScreen> {
if(isOnline){ if(isOnline){
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["phoneVerificationCode"] = _otp.toString(); payload["phoneVerificationCode"] = _otp.toString();
payload["phone"] = widget.phoneNumber.toString(); payload["phone"] = widget.myObject.toString();
bool signinStatus = await AppSettings.login(payload); bool phoneVerified = await AppSettings.login(payload);
try{ if(phoneVerified){
if (signinStatus) {
Navigator.of(context,rootNavigator: true).pop(); Navigator.of(context,rootNavigator: true).pop();
await Navigator.push( AppSettings.longSuccessToast(
"Phone verified successfully");
Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Dashboard()), MaterialPageRoute(
builder: (context) => Dashboard()),
); );
AppSettings.longSuccessToast("Logged in Successfully");
} else {
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Please enter valid details");
} }
} else{
catch(exception){
Navigator.of(context,rootNavigator: true).pop(); Navigator.of(context,rootNavigator: true).pop();
print(exception); AppSettings.longFailedToast(
"please enter valid pin");
} }
} }
else{ else{
Navigator.of(context,rootNavigator: true).pop(); Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Please Check internet"); AppSettings.longFailedToast(
"Please check your internet");
} }
} }
else{ else{
AppSettings.longFailedToast("Please enter valid details");
} }
}, },
child: const Text('Submit')), child: const Text('Submit')),
const SizedBox( )
height: 30,
),
// Display the entered OTP code
Text(
_otp ?? 'Please enter OTP',
style: const TextStyle(fontSize: 30),
) )
], ],
), ),
@ -142,7 +229,7 @@ class OtpInput extends StatelessWidget {
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: controller, controller: controller,
maxLength: 1, maxLength: 1,
cursorColor: primaryColor, cursorColor: Theme.of(context).primaryColor,
decoration: const InputDecoration( decoration: const InputDecoration(
filled: true, filled: true,
fillColor: Colors.white, fillColor: Colors.white,

@ -13,18 +13,21 @@ import 'package:healthcare_delivery/common/preloader.dart';
//const Color primaryColor = Color(0XFF0D4E84); //const Color primaryColor = Color(0XFF0D4E84);
const Color primaryColor = Color(0XFF4D317D); /*const Color primaryColor = Color(0XFF4D317D);*/
const Color greyColor = Color(0XFF8F8E8E); const Color greyColor = Color(0XFF8F8E8E);
const Color primaryColor = Color(0XFF68A85D);
const Color secondaryColor = Color(0XFFA0C899);
const Color buttonColors = Color(0XFFFFAC1C);
const Color textFieldStartColor = Colors.grey; const Color textFieldStartColor = Colors.grey;
//const Color screenBackgroundColor = Color(0XFFEAF6FF); //const Color screenBackgroundColor = Color(0XFFEAF6FF);
const Color screenBackgroundColor = Color(0XFFDCCBFA); const Color screenBackgroundColor = Color(0XFFDCCBFA);
const Color screenBackgroundColord = Colors.black12; const Color screenBackgroundColord = Colors.black12;
const Color dashboardbackground = Color(0XFFF5F5F5); const Color dashboardbackground = Color(0XFFF5F5F5);
Color AppBarGradient_1 = Color(0XFF4D317D); Color AppBarGradient_1 = primaryColor;
TextStyle PreloaderText() { TextStyle PreloaderText() {
return TextStyle(color:Color(0XFF4D317D)); return TextStyle(color:primaryColor);
} }
TextStyle labelTextStyle() { TextStyle labelTextStyle() {
@ -72,21 +75,21 @@ TextStyle serverIssueTextStyle() {
InputDecoration textFormFieldDecoration(IconData icon,var text){ InputDecoration textFormFieldDecoration(IconData icon,var text){
return InputDecoration( return InputDecoration(
filled: true, filled: true,
fillColor: Colors.white, fillColor: primaryColor,
prefixIcon: Icon( prefixIcon: Icon(
icon, icon,
color: greyColor, color: Colors.white,
), ),
border: OutlineInputBorder(borderSide: BorderSide(color: primaryColor)), border: OutlineInputBorder(borderSide: BorderSide(color: Colors.white)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: Colors.white),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: Colors.white),
), ),
labelText: text, labelText: text,
labelStyle: labelStyle:
TextStyle(color: primaryColor, fontWeight: FontWeight.bold //<-- SEE HERE TextStyle(color: Colors.white, fontWeight: FontWeight.bold //<-- SEE HERE
), ),
); );
} }
@ -123,7 +126,7 @@ class AppSettings {
late StreamSubscription<Position> positionStream; late StreamSubscription<Position> positionStream;
//api urls //api urls
static String host = 'http://35.207.198.4:3000/api/'; static String host = 'http://cloudh.in:4000/api/';
static String loginUrl = host + 'sendSms'; static String loginUrl = host + 'sendSms';
static String deliveryboyloginUrl = host + 'deliveryboylogin'; static String deliveryboyloginUrl = host + 'deliveryboylogin';
static String deliveryboybookingsUrl = host + 'getdeliveryboybookings'; static String deliveryboybookingsUrl = host + 'getdeliveryboybookings';

@ -68,7 +68,7 @@ class _SplashScreenState extends State<SplashScreen> {
children: <Widget>[ children: <Widget>[
Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage(image: AssetImage("images/final_splash_screen.png"), fit: BoxFit.cover,), image: DecorationImage(image: AssetImage("images/splash_screen_new.gif"), fit: BoxFit.cover,),
), ),
), ),

@ -30,8 +30,8 @@ dev_dependencies:
flutter_icons: flutter_icons:
image_path_ios: 'images/appiconn.png' image_path_ios: 'images/appicon.png'
image_path_android: 'images/appiconn.png' image_path_android: 'images/appicon.png'
android: true android: true
ios: true ios: true
remove_alpha_ios: true remove_alpha_ios: true

Loading…
Cancel
Save