login process completed

dev
Sneha 1 year ago
parent 0ef8bb2b85
commit 0b06433efd

@ -34,9 +34,17 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.arminta.healthcare_user"
applicationId "com.arminta.healthcare_pharmacy"
// 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.
minSdkVersion 28
@ -57,3 +65,7 @@ android {
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arminta.healthcare_user">
package="com.arminta.healthcare_pharmacy">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arminta.healthcare_user">
package="com.arminta.healthcare_pharmacy">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
@ -12,7 +12,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<application
android:label="HealthPharma"
android:label="healthcare_pharmacy"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity

@ -0,0 +1,6 @@
package com.arminta.healthcare_pharmacy
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arminta.healthcare_user">
package="com.arminta.healthcare_pharmacy">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

@ -1,17 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:healthcare_user/emergency.dart';
import 'package:healthcare_user/invitations.dart';
import 'package:healthcare_user/medicines.dart';
import 'package:healthcare_user/prescriptions.dart';
import 'package:healthcare_user/reports.dart';
import 'package:healthcare_user/seekopinion.dart';
import 'package:healthcare_user/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'dart:ui' as ui;
import 'login.dart';
import 'seekopinion.dart';
import 'settings.dart';
class Dashboard extends StatefulWidget {
const Dashboard({super.key});
@ -68,7 +62,7 @@ class _DashboardState extends State<Dashboard> {
builder: (context) => const SeekOpinion()),
);
}
else if(ind==1){
/*else if(ind==1){
Navigator.push(
context,
MaterialPageRoute(
@ -102,7 +96,7 @@ class _DashboardState extends State<Dashboard> {
MaterialPageRoute(
builder: (context) => const Emergency()),
);
}
}*/
}

@ -1,19 +0,0 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
class Emergency extends StatefulWidget {
const Emergency({Key? key}) : super(key: key);
@override
State<Emergency> createState() => _EmergencyState();
}
class _EmergencyState extends State<Emergency> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Emergency'),
body: Container(),
);
}
}

@ -3,12 +3,12 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_webservice/places.dart';
import 'package:provider/provider.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/providers/place_provider.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/providers/search_provider.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/components/prediction_tile.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/components/rounded_frame.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/controllers/autocomplete_search_controller.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/providers/place_provider.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/providers/search_provider.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/components/prediction_tile.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/components/rounded_frame.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/controllers/autocomplete_search_controller.dart';
class AutoCompleteSearch extends StatefulWidget {
const AutoCompleteSearch(

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/components/rounded_frame.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/components/rounded_frame.dart';
class FloatingCard extends StatelessWidget {
const FloatingCard({

@ -1,5 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/autocomplete_search.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/autocomplete_search.dart';
class SearchBarController extends ChangeNotifier {
late AutoCompleteSearchState _autoCompleteSearch;

@ -10,9 +10,9 @@ import 'package:google_maps_webservice/places.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/providers/place_provider.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/components/animated_pin.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/providers/place_provider.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/components/animated_pin.dart';
typedef SelectedPlaceWidgetBuilder = Widget Function(
BuildContext context,

@ -10,11 +10,11 @@ import 'package:http/http.dart';
import 'package:provider/provider.dart';
import 'package:uuid/uuid.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/providers/place_provider.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/autocomplete_search.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/controllers/autocomplete_search_controller.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/src/google_map_place_picker.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/providers/place_provider.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/autocomplete_search.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/controllers/autocomplete_search_controller.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/src/google_map_place_picker.dart';
typedef IntroModalWidgetBuilder = Widget Function(
BuildContext context,

@ -1,19 +0,0 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
class Invitations extends StatefulWidget {
const Invitations({Key? key}) : super(key: key);
@override
State<Invitations> createState() => _InvitationsState();
}
class _InvitationsState extends State<Invitations> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Invitations'),
body: Container(),
);
}
}

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_user/dashboard.dart';
import 'package:healthcare_user/settings.dart';
import 'package:healthcare_user/signup.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:healthcare_pharmacy/signup.dart';
import 'package:path/path.dart' as Path;
class Login extends StatefulWidget {

@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/dashboard.dart';
import 'package:healthcare_user/splash_screen.dart';
import 'package:sizer/sizer.dart';
import 'package:flutter/services.dart';
import 'splash_screen.dart';
void main () async {
// Set default home.
@ -13,7 +12,7 @@ void main () async {
runApp(Sizer(
builder: (context, orientation, deviceType) {
return MaterialApp(
title: 'Health Care',
title: 'Pharmacy',
theme: ThemeData.light(),
home:_defaultHome,
debugShowCheckedModeBanner: false,

@ -1,19 +0,0 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
class Medicines extends StatefulWidget {
const Medicines({Key? key}) : super(key: key);
@override
State<Medicines> createState() => _MedicinesState();
}
class _MedicinesState extends State<Medicines> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Medicines'),
body: Container(),
);
}
}

@ -0,0 +1,239 @@
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/login.dart';
import 'package:healthcare_pharmacy/settings.dart';
class OtpScreen extends StatefulWidget {
var myObject;
OtpScreen({this.myObject});
@override
State<OtpScreen> createState() => _OtpScreenState();
}
class _OtpScreenState extends State<OtpScreen> {
final TextEditingController _fieldOne = TextEditingController();
final TextEditingController _fieldTwo = TextEditingController();
final TextEditingController _fieldThree = TextEditingController();
final TextEditingController _fieldFour = TextEditingController();
final TextEditingController _fieldFive = TextEditingController();
final TextEditingController _fieldSix = TextEditingController();
TextEditingController mobileNumberController = TextEditingController();
TextEditingController passwordController = TextEditingController();
bool isTextfieldVisible=true;
bool isOtpVisible=false;
bool isObscureText=true;
// This is the entered code
// It will be displayed in a Text widget
String? _otp;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
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(
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
Visibility(
visible:true,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
OtpInput(_fieldOne, true), // auto focus
OtpInput(_fieldTwo, false),
OtpInput(_fieldThree, false),
OtpInput(_fieldFour, false),
OtpInput(_fieldFive, 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(
height: 30,
),
Visibility(
visible: true,
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 {
setState(() {
_otp = _fieldOne.text +
_fieldTwo.text +
_fieldThree.text +
_fieldFour.text+
_fieldFive.text +
_fieldSix.text;
});
if (_otp!.length == 6) {
AppSettings.preLoaderDialog(context);
bool isOnline = await AppSettings.internetConnectivity();
if(isOnline){
var payload = new Map<String, dynamic>();
payload["phoneVerificationCode"] = _otp.toString();
payload["phone"] = widget.myObject.toString();
bool phoneVerified = await AppSettings.phoneVerification(payload);
if(phoneVerified){
Navigator.of(context,rootNavigator: true).pop();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Login()),
);
}
else{
Navigator.of(context,rootNavigator: true).pop();
}
}
else{
Navigator.of(context,rootNavigator: true).pop();
}
}
else{
}
},
child: const Text('Submit')),
)
)
],
),
);
}
}
// Create an input widget that takes only one digit
class OtpInput extends StatelessWidget {
final TextEditingController controller;
final bool autoFocus;
const OtpInput(this.controller, this.autoFocus, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: 60,
width: 50,
child: TextField(
autofocus: autoFocus,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
controller: controller,
maxLength: 1,
cursorColor: Theme.of(context).primaryColor,
decoration: const InputDecoration(
border: OutlineInputBorder(),
counterText: '',
hintStyle: TextStyle(color: Colors.black, fontSize: 20.0)),
onChanged: (value) {
if (value.length == 1) {
FocusScope.of(context).nextFocus();
}
},
),
);
}
}

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
import 'package:healthcare_pharmacy/settings.dart';
class Dialogs {
static Future<void> showLoadingDialog(BuildContext context, GlobalKey key) async {

@ -1,19 +0,0 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
class Prescriptions extends StatefulWidget {
const Prescriptions({Key? key}) : super(key: key);
@override
State<Prescriptions> createState() => _PrescriptionsState();
}
class _PrescriptionsState extends State<Prescriptions> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Prescriptions'),
body: Container(),
);
}
}

@ -1,19 +0,0 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
class Reports extends StatefulWidget {
const Reports({Key? key}) : super(key: key);
@override
State<Reports> createState() => _ReportsState();
}
class _ReportsState extends State<Reports> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Reports'),
body: Container(),
);
}
}

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/settings.dart';
class SeekOpinion extends StatefulWidget {
const SeekOpinion({Key? key}) : super(key: key);
@ -11,9 +11,6 @@ class SeekOpinion extends StatefulWidget {
class _SeekOpinionState extends State<SeekOpinion> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Seek Opinion'),
body: Container(),
);
return const Placeholder();
}
}

@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:healthcare_user/preloader.dart';
import 'package:healthcare_pharmacy/preloader.dart';
import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart';
import 'package:intl/intl.dart';
@ -136,6 +136,8 @@ class AppSettings {
static String resetTokenUrl = host + 'reset_token';
static String forgotPasswordUrl = host + 'forgotpassword';
static String resetPasswordUrl = host + 'resetpassword';
static String sendSmsUrl = host + 'sendSms';
static String phoneVerificationUrl = host + 'pharmacyphone';
@ -285,7 +287,7 @@ class AppSettings {
if (response.statusCode == 200) {
try {
var _response = json.decode(response.body);
healthpharmaIdsign = _response['armintahealthdata']['PharmacyId'];
healthpharmaIdsign = _response['armintahealthdata']['pharmacyId'];
print(_response);
return true;
} catch (e) {
@ -297,6 +299,28 @@ class AppSettings {
}
}
static Future<bool> sendSms(payload) async{
var response=await http.post(Uri.parse(sendSmsUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'});
if(response.statusCode==200){
return true;
}
else{
return false;
}
}
static Future<bool> phoneVerification(payload) async{
var response=await http.post(Uri.parse(phoneVerificationUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'});
if(response.statusCode==200){
return true;
}
else{
return false;
}
}
static Future<bool> verifyPhn(payload) async {
var response = await http.post(Uri.parse(verifyPhnUrl),
body: json.encode(payload),

@ -1,8 +1,9 @@
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_user/keys.dart';
import 'package:healthcare_user/settings.dart';
import 'package:healthcare_pharmacy/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_pharmacy/keys.dart';
import 'package:healthcare_pharmacy/otpscreen.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'login.dart';
import 'package:geolocator/geolocator.dart';
import 'package:geocoding/geocoding.dart';
@ -228,7 +229,7 @@ class _SignUpState extends State<SignUp> {
),
), //mobile
/* const SizedBox(
const SizedBox(
height: 5,
),
Container(
@ -256,7 +257,7 @@ class _SignUpState extends State<SignUp> {
),
),
),
),*/
),
const SizedBox(
height: 5,
),
@ -483,27 +484,25 @@ class _SignUpState extends State<SignUp> {
onPressed: () async {
if (nameController.text != '' &&
passwordController.text != '' &&
mobileNumberController.text != '') {
mobileNumberController.text != ''&&
emailController.text != '') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["username"] = nameController.text.toString();
payload["pharmacyname"] = nameController.text.toString();
payload["password"] =
passwordController.text.toString();
payload["phone"] =
mobileNumberController.text.toString();
payload["firstName"] = ''; payload["emails"] = [
payload["emails"] = [
{"email": emailController.text.toString()}
];
payload["lastName"] = '';
payload["address1"] = userAddressCapturingController.text;
payload["address2"] = address2;
payload["pharmacy_address"] = userAddressCapturingController.text;
payload["city"] = city;
payload["state"] = state;
payload["zip"] = zip;
payload["country"] = country;
payload["notes"] = '';
payload["description"] = '';
payload["latitude"] = lat;
payload["longitude"] = lng;
payload["fcmId"] = AppSettings.fcmId;
@ -512,34 +511,24 @@ class _SignUpState extends State<SignUp> {
try {
if (signUpStatus) {
var phoneVerifyPayload = new Map<String, dynamic>();
phoneVerifyPayload["phoneVerificationCode"] =
"11111";
phoneVerifyPayload["phone"] =
mobileNumberController.text.toString();
bool verifyPhnStatus =
await AppSettings.verifyPhn(phoneVerifyPayload);
var smsPayload = new Map<String, dynamic>();
smsPayload["mobileNumbers"] = mobileNumberController.text.toString();
bool sendSms = await AppSettings.sendSms(smsPayload);
if (verifyPhnStatus) {
if(sendSms){
Navigator.of(context, rootNavigator: true).pop();
/*AppSettings.longSuccessToast(
"User SignUp Successfully");*/
showUserSignUSuccessDialog();
/* await Navigator.push(
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Login()),
);*/
} else {
builder: (context) => OtpScreen(myObject: mobileNumberController.text.toString(),)),
);
}
else{
Navigator.of(context, rootNavigator: true).pop();
/*AppSettings.longFailedToast(
"Phone verification failed");*/
}
}
else {
Navigator.of(context, rootNavigator: true).pop();

@ -1,11 +1,10 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_user/settings.dart';
import 'package:healthcare_user/signup.dart';
import 'dashboard.dart';
import 'settings.dart';
import 'signup.dart';
void main() async{
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);

@ -1,4 +1,4 @@
name: healthcare_user
name: healthcare_pharmacy
description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

@ -8,8 +8,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:healthcare_user/main.dart';
import 'package:healthcare_user/splash_screen.dart';
import 'package:healthcare_pharmacy/main.dart';
import 'package:healthcare_pharmacy/splash_screen.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {

Loading…
Cancel
Save