Skip to content
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

Sampad otpscreen home #21

Open
wants to merge 21 commits into
base: 17-fl2-screen
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "952921194402",
"project_id": "bloodbank31-6cbc0",
"storage_bucket": "bloodbank31-6cbc0.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:952921194402:android:43f1625dbae2098ee87cfb",
"android_client_info": {
"package_name": "com.example.bloodbank_app"
}
},
"oauth_client": [
{
"client_id": "952921194402-3vmh6851dbu5h9heiftbmi5dpi2e6r7o.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB9xM6tkJTHm6mJiijKWQDqUFjuoIUx2fU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "952921194402-3vmh6851dbu5h9heiftbmi5dpi2e6r7o.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
28 changes: 28 additions & 0 deletions bin/date_time.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
void main() {
// var now = DateTime.now();
// var jan = DateTime(2000);
// DateTime jan = DateTime(2002, 1, 24);
// DateTime janUtc = DateTime.utc(2002, 1, 24);
// DateTime someDate = DateTime.parse('2002-01-24 00:00:00.000Z');
// calculate date of birth
// calculateAge(1990, 3, 3);
compareYear(2002);
// print(someDate);
}

void calculateAge(int year, int month, int day) {
DateTime startDate = DateTime(year, month, day);
DateTime now = DateTime.now();

var difference = now.difference(startDate);
print(difference);
// print(difference.inDays / 365);
}

void compareYear(int year) {
DateTime startDate = DateTime(year);
DateTime now = DateTime.now();
var difference = now.compareTo(startDate);
print(difference);
// print(difference.inDays / 365);
}
2 changes: 2 additions & 0 deletions bin/tempCodeRunnerFile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// print(janUtc);
// print(jan);
34 changes: 34 additions & 0 deletions ios/Runner/GoogleService-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>952921194402-o31bk6si3cc48meetj4jig02slffb8am.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.952921194402-o31bk6si3cc48meetj4jig02slffb8am</string>
<key>API_KEY</key>
<string>AIzaSyDSzsT_3SmPbMos1QBWwiZ_wnjzaDJpgkA</string>
<key>GCM_SENDER_ID</key>
<string>952921194402</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.example.bloodbankApp</string>
<key>PROJECT_ID</key>
<string>bloodbank31-6cbc0</string>
<key>STORAGE_BUCKET</key>
<string>bloodbank31-6cbc0.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:952921194402:ios:c954b54e0b1481fee87cfb</string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions ios/firebase_app_id_file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"file_generated_by": "FlutterFire CLI",
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
"GOOGLE_APP_ID": "1:952921194402:ios:c954b54e0b1481fee87cfb",
"FIREBASE_PROJECT_ID": "bloodbank31-6cbc0",
"GCM_SENDER_ID": "952921194402"
}
1 change: 1 addition & 0 deletions lib/constants/routes.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Routes {
static const String splashScreen = '/splash';
static const String onboardingScreen = '/onboarding';
static const String onboarding1Screen = '/onboarding1';
static const String onboarding2Screen = '/onboarding2';
Expand Down
86 changes: 86 additions & 0 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;

/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
return macos;
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyC_IkJmuph2xX_czigdksTL9blHsh-1qto',
appId: '1:952921194402:web:e16b45fcafb135cbe87cfb',
messagingSenderId: '952921194402',
projectId: 'bloodbank31-6cbc0',
authDomain: 'bloodbank31-6cbc0.firebaseapp.com',
storageBucket: 'bloodbank31-6cbc0.appspot.com',
measurementId: 'G-NS0CS3YGZS',
);

static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyB9xM6tkJTHm6mJiijKWQDqUFjuoIUx2fU',
appId: '1:952921194402:android:43f1625dbae2098ee87cfb',
messagingSenderId: '952921194402',
projectId: 'bloodbank31-6cbc0',
storageBucket: 'bloodbank31-6cbc0.appspot.com',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyDSzsT_3SmPbMos1QBWwiZ_wnjzaDJpgkA',
appId: '1:952921194402:ios:c954b54e0b1481fee87cfb',
messagingSenderId: '952921194402',
projectId: 'bloodbank31-6cbc0',
storageBucket: 'bloodbank31-6cbc0.appspot.com',
iosClientId:
'952921194402-o31bk6si3cc48meetj4jig02slffb8am.apps.googleusercontent.com',
iosBundleId: 'com.example.bloodbankApp',
);

static const FirebaseOptions macos = FirebaseOptions(
apiKey: 'AIzaSyDSzsT_3SmPbMos1QBWwiZ_wnjzaDJpgkA',
appId: '1:952921194402:ios:c954b54e0b1481fee87cfb',
messagingSenderId: '952921194402',
projectId: 'bloodbank31-6cbc0',
storageBucket: 'bloodbank31-6cbc0.appspot.com',
iosClientId:
'952921194402-o31bk6si3cc48meetj4jig02slffb8am.apps.googleusercontent.com',
iosBundleId: 'com.example.bloodbankApp',
);
}
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class MyApp extends StatelessWidget {
// buttonTheme:
),
// home: SplashScreen(),
initialRoute: Routes.loginScreen,
initialRoute: Routes.signUpScreen,
routes: {
// "/": (context) => SplashScreen(),
Routes.splashScreen: (context) => SplashScreen(),
Routes.onboardingScreen: (context) => OnboardingPage(),
Routes.onboarding1Screen: (context) => OnboardingPage1(),
Routes.onboarding2Screen: (context) => OnboardingPage2(),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/mobile_number.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// ignore_for_file: avoid_unnecessary_containers, duplicate_ignore, sized_box_for_whitespace, prefer_const_constructors
// ignore_for_file: avoid_unnecessary_containers, duplicate_ignore, sized_box_for_whitespace

import 'dart:developer';

import 'dart:developer';
import 'package:bloodbank_app/constants/colors.dart';
import 'package:bloodbank_app/constants/routes.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -98,7 +100,6 @@ class LoginScreen extends StatelessWidget {
],
),
),

// add some spacing
const SizedBox(
height: 67,
Expand Down
33 changes: 0 additions & 33 deletions lib/screens/onboarding_screen.dart

This file was deleted.

53 changes: 53 additions & 0 deletions lib/screens/otpScreen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:bloodbank_app/constants/routes.dart';
import 'package:flutter/material.dart';
import 'package:otp_text_field/otp_field.dart';
import 'package:otp_text_field/otp_field_style.dart';
import 'package:otp_text_field/style.dart';

class OtpScreen extends StatelessWidget {
const OtpScreen({super.key});

@override
Widget build(BuildContext context) {
OtpFieldController otpController = OtpFieldController();

return Scaffold(
body: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
OTPTextField(
controller: otpController,
onChanged: (pin) {
print("Changed: " + pin);
},
length: 5,
// onChanged: (value) => print(value),
width: MediaQuery.of(context).size.width,
fieldWidth: 80,
style: TextStyle(fontSize: 17),
otpFieldStyle: OtpFieldStyle(
backgroundColor: Colors.blue, borderColor: Colors.green),
textFieldAlignment: MainAxisAlignment.spaceAround,
fieldStyle: FieldStyle.underline,
onCompleted: (pin) {
print("Completed: " + pin);
// Navigator.pushNamed(
// context,
// Routes.signUpScreen,
// );
},
),
ElevatedButton(
onPressed: () => {
Navigator.pushNamed(context, Routes.home),
},
child: Text("Go to home"),
),
],
),
),
);
}
}
6 changes: 6 additions & 0 deletions lib/screens/otp_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class OtpScreen extends StatelessWidget {
// );
},
),
ElevatedButton(
onPressed: () => {
Navigator.pushNamed(context, Routes.home),
},
child: Text("Go to home"),
),
],
),
),
Expand Down
Loading