-
Notifications
You must be signed in to change notification settings - Fork 0
Otp authentication completed #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Deepak-coder80
wants to merge
20
commits into
dev
Choose a base branch
from
OTP_authentication
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
51466de
changes:
Deepak-coder80 42378fd
login screen finished
Deepak-coder80 d02d72b
login screen
Deepak-coder80 ab7cedd
sign up screen
Deepak-coder80 3dd1c2a
app logo and name temporaly changed
Deepak-coder80 f353c52
login and sign up screen refractored
Deepak-coder80 efc7688
launch icon changed
Deepak-coder80 cfa7257
launch icon changed
Deepak-coder80 03f02d9
login signup validation
Deepak-coder80 3786f08
login authentication sucessufully completed
Deepak-coder80 ad21b43
auto login finished
Deepak-coder80 972e828
otp authentication:
Deepak-coder80 273ec81
otp verfication screen design finished
Deepak-coder80 fa1275f
firebase setup and otp sending finished
Deepak-coder80 1e50cbc
started error handling on phone screen
Deepak-coder80 a30516f
error handling phone screen successfull
Deepak-coder80 4b070b0
otp verifcation done
Deepak-coder80 2a76eee
splash screen added
Deepak-coder80 346a98d
internet permission added
Deepak-coder80 dcc7174
Merge branch 'dev' into OTP_authentication
Deepak-coder80 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "project_info": { | ||
| "project_number": "1095884333172", | ||
| "project_id": "agrivator-test", | ||
| "storage_bucket": "agrivator-test.appspot.com" | ||
| }, | ||
| "client": [ | ||
| { | ||
| "client_info": { | ||
| "mobilesdk_app_id": "1:1095884333172:android:b17cb06d6b2b13b0bfb121", | ||
| "android_client_info": { | ||
| "package_name": "com.agrivator.app" | ||
| } | ||
| }, | ||
| "oauth_client": [ | ||
| { | ||
| "client_id": "1095884333172-qs0m3qtccptnk9rdon8i5to7u0b6v1kk.apps.googleusercontent.com", | ||
| "client_type": 1, | ||
| "android_info": { | ||
| "package_name": "com.agrivator.app", | ||
| "certificate_hash": "fd6f6e37e910e436c8f86e0cdbb94b3e6dfb8bac" | ||
| } | ||
| }, | ||
| { | ||
| "client_id": "1095884333172-eabh9sc51ko98g8s58fbbd4dvsc5f1g1.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| } | ||
| ], | ||
| "api_key": [ | ||
| { | ||
| "current_key": "AIzaSyCETi7qHyhSSDIXbltfTenZIkCfOqR7Ryc" | ||
| } | ||
| ], | ||
| "services": { | ||
| "appinvite_service": { | ||
| "other_platform_oauth_client": [ | ||
| { | ||
| "client_id": "1095884333172-eabh9sc51ko98g8s58fbbd4dvsc5f1g1.apps.googleusercontent.com", | ||
| "client_type": 3 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ], | ||
| "configuration_version": "1" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.88 KB
(520%)
app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import 'package:flutter/material.dart'; | ||
| class ConstColors{ | ||
| Color backgroudColor =const Color(0xFFE3FDE4); | ||
| Color darkGreen = const Color(0xFF46C64F); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,24 @@ | ||
| import './screens/splash_screen.dart'; | ||
| import 'package:firebase_core/firebase_core.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import './screens/login_phone.dart'; | ||
| import './screens/otp_verification_screen.dart'; | ||
|
|
||
| void main() { | ||
| runApp(const MyApp()); | ||
| Future<void> main() async { | ||
| WidgetsFlutterBinding.ensureInitialized(); | ||
| await Firebase.initializeApp(); | ||
| runApp(MaterialApp( | ||
| debugShowCheckedModeBanner: false, | ||
| title: 'Agrivator v3', | ||
| theme: ThemeData( | ||
| primarySwatch: Colors.green, | ||
| ), | ||
| home: const SplahScreen(), | ||
| routes: { | ||
| MyPhone.myPhoneRouteName : ((context) => const MyPhone()), | ||
| OTPScreen.otpScreenRouteName:(context) => OTPScreen() | ||
| }, | ||
| )); | ||
| } | ||
|
|
||
| class MyApp extends StatelessWidget { | ||
| const MyApp({super.key}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return MaterialApp( | ||
| title: 'Flutter Demo', | ||
| theme: ThemeData( | ||
| primarySwatch: Colors.blue, | ||
| //todo: create home page | ||
| ), | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| import 'package:app/constants/colors.dart'; | ||
| import 'package:app/service/firebase_service.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import '../utils/pop.dart'; | ||
| import 'otp_verification_screen.dart'; | ||
|
|
||
| class MyPhone extends StatefulWidget { | ||
| static const String myPhoneRouteName = 'MyPhone'; | ||
| final String phoneNumber = ""; | ||
| const MyPhone({super.key}); | ||
|
|
||
| @override | ||
| State<MyPhone> createState() => _MyPhoneState(); | ||
| } | ||
|
|
||
| class _MyPhoneState extends State<MyPhone> { | ||
|
|
||
| final TextEditingController _countryController = TextEditingController(); | ||
|
|
||
| var phone = ''; | ||
| @override | ||
| void initState() { | ||
| _countryController.text = '+91'; | ||
| super.initState(); | ||
| } | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| backgroundColor: ConstColors().backgroudColor, | ||
| body: Container( | ||
| alignment: Alignment.center, | ||
| margin: const EdgeInsets.only(left: 20, right: 20), | ||
| child: SingleChildScrollView( | ||
| child: Column( | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| children: [ | ||
| Image.asset( | ||
| 'assets/images/img1.png', | ||
| width: 150, | ||
| height: 150, | ||
| ), | ||
| const SizedBox( | ||
| height: 10, | ||
| ), | ||
| const Text( | ||
| 'Phone Verification', | ||
| style: TextStyle( | ||
| fontWeight: FontWeight.bold, | ||
| fontSize: 22, | ||
| ), | ||
| ), | ||
| const SizedBox( | ||
| height: 10, | ||
| ), | ||
| const Text( | ||
| 'We need to register your phone before getting started!', | ||
| style: TextStyle(fontSize: 16), | ||
| textAlign: TextAlign.center, | ||
| ), | ||
| const SizedBox( | ||
| height: 10, | ||
| ), | ||
| Container( | ||
| height: 55, | ||
| decoration: BoxDecoration( | ||
| color: Colors.white, | ||
| border: Border.all(color: Colors.grey, width: 1), | ||
| borderRadius: BorderRadius.circular(10)), | ||
| child: Row( | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| children: [ | ||
| const SizedBox( | ||
| width: 10, | ||
| ), | ||
| SizedBox( | ||
| width: 40, | ||
| child: TextField( | ||
| keyboardType: TextInputType.numberWithOptions(), | ||
| controller: _countryController, | ||
| decoration: | ||
| const InputDecoration(border: InputBorder.none), | ||
| ), | ||
| ), | ||
| const Text( | ||
| '|', | ||
| style: TextStyle(fontSize: 33, color: Colors.grey), | ||
| ), | ||
| const SizedBox( | ||
| width: 10, | ||
| ), | ||
| Expanded( | ||
| child: TextField( | ||
|
|
||
| keyboardType: TextInputType.number, | ||
| onChanged: (value) { | ||
| phone = value; | ||
| }, | ||
| decoration: const InputDecoration( | ||
| border: InputBorder.none, hintText: "Phone")), | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| const SizedBox( | ||
| height: 20, | ||
| ), | ||
| SizedBox( | ||
| height: 45, | ||
| width: double.infinity, | ||
| child: ElevatedButton( | ||
| onPressed: () { | ||
| if (_countryController.text.isEmpty) { | ||
| PopUp().popUpAlert( | ||
| context, | ||
| 'Country Code missing', | ||
| 'Enter a valid contrycode', | ||
| ); | ||
| } else if (phone.length < 10||phone.length > 10) { | ||
| PopUp().popUpAlert( | ||
| context, | ||
| 'Phone number error', | ||
| 'Enter a valid phonenumber', | ||
| ); | ||
| } else { | ||
| phone = _countryController.text +phone; | ||
| FirebaseServices().verifyPhoneNumber(phone); | ||
| Navigator.pushNamed(context, OTPScreen.otpScreenRouteName,arguments: phone); | ||
| } | ||
| }, | ||
| style: ElevatedButton.styleFrom( | ||
| backgroundColor: Colors.green, | ||
| shape: RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.circular(10)), | ||
| ), | ||
| child: const Text('Send OTP'), | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api keys are usually stored in an env file.