Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
raddi1972 committed Feb 16, 2022
1 parent 51b1c8b commit 7a2a0cc
Show file tree
Hide file tree
Showing 28 changed files with 1,274 additions and 515 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,3 @@ app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
95 changes: 84 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,91 @@
# carpool
# ShareCab : An organisation carpool app !

A new Flutter project.
## Problem Statement :-

## Getting Started
Often in college we have noticed the messages like " who is going to airport on this day and this time from campus". This is not only limited to college but also in large organisation where people have to depend on traditional WhatsApp messages and phone calls which makes the entire benifit of going together becomes a burden !

This project is a starting point for a Flutter application.
## Our Solution :-

A few resources to get you started if this is your first Flutter project:
We decided to help people to carpool by creating a mobile application which serves as a one stop check for everyone in the same organisation to carpool! The app mainly consist of a login screen which serves as a login as well as registration screen. The validity of the email is verified via OTP ([attribution](https://pub.dev/packages/email_auth)). This is followed by a simplistic UI where a user can add their booking as well as check how many might be already travelling during that slot. Once we have booked we can regularly come back to the app and check if someone else have also booked a slot to travel together. You can get the details of the user (Name, Email ID. This can be extended to more fields as per the organisation's preference) and can connect to travel together ! There is also a delete option added which can help you remove yourself from the list of travellers on a particular slot. For now we create this model for a uni-directional travel (i.e From College to Airport or vice versa ) but this can be easilty scaled up to add Location based support also.

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
## Technologies Utilized :-

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
The following set of technologies have been used for this project:

sdvlknesjdvn
**1) Firebase** (for cloud storage/database)

**2) Flutter** (UI and platform)

**3) Dart** (Interfacing the UI and database)

## Screenshots :-

<img src="https://github.com/ishaanj0412/Carpool/blob/a34bccce77ff397a046ceb1f21234082e04688fd/Readme_pics/1.jpeg" alt="Login" width="30%" /> <img src="https://github.com/ishaanj0412/Carpool/blob/a34bccce77ff397a046ceb1f21234082e04688fd/Readme_pics/2.jpeg" alt="OTP verification" width="30%" /> <img src="https://github.com/ishaanj0412/Carpool/blob/5117ac76994f4798224ed47ff5238edf50db24d9/Readme_pics/3.jpeg" alt="HomeScreen" width="30%" />


<img src="https://github.com/ishaanj0412/Carpool/blob/5117ac76994f4798224ed47ff5238edf50db24d9/Readme_pics/4.jpeg" alt="4" width="30%" /> <img src="https://github.com/ishaanj0412/Carpool/blob/60946ab891803ac79ece6e02e62e1a033c15d625/Readme_pics/5.jpeg" alt="5" width="30%" /> <img src="https://github.com/ishaanj0412/Carpool/blob/a34bccce77ff397a046ceb1f21234082e04688fd/Readme_pics/6.jpeg" alt="6" width="30%" />



# How to run the project

- ### For Testing and use :-

- Download the .apk file from this [link](https://github.com/ishaanj0412/Carpool/releases/download/Release/carpool.apk)

- Install the following .apk on your device. Please note you may need to allow external app installs on your phone

- On non-Samsung devices:

- Go to your phone’s **Settings**.

- Go to **Security & privacy** > **More settings**.

- Tap on **Install apps from external sources**.

- Select the browser (e.g., Chrome or Firefox) you want to download the APK files from.
[<img src="https://sp-ao.shortpixel.ai/client/to_webp,q_lossy,ret_img,w_1340,h_602/https://s23429.pcdn.co/wp-content/uploads/2016/08/andriod-install-unknown-apps.png" alt="Select the browser you want to download the APK from. " style="zoom:50%;" />](https://s23429.pcdn.co/wp-content/uploads/2016/08/andriod-install-unknown-apps.png)

- Toggle **Allow app installs** on.

On non-Samsung devices:

1. Go to your phone’s **Settings**.
2. Go to **Biometrics and security** > **Install unknown apps**.
3. Select the browser (e.g., Chrome or Firefox) you want to download the APK files from.
4. Toggle **Allow app installs** on.

- Launch the app normally from your app menu like any other app !

#### NOTE: Please ensure you have Android 9.0 or greater.

#### For current project implementation , one MUST have a iiitb.ac.in email ID to use the app

- ### For Developement :

- Setup [Flutter environment](https://docs.flutter.dev/get-started/install) and [Android Virtual Device Manager (AVD Manager)](https://medium.com/michael-wallace/how-to-install-android-sdk-and-setup-avd-emulator-without-android-studio-aeb55c014264)

- Clone this repository

- Open the main.dart file from lib folder

- You may need to run `$ dart pub get [options]` to load all the dependencies to run the code

#### NOTE : AVD version used to develop was 31.0 (Tested on pixel 4, 5 AVD)



### NOTE: The OTP_auth service is hosted on a test-server which allows only 30 OTP request for a single day. Also all time inputs are considered to be in 24hr format

# Contributors

- Ishan Jalan - https://www.linkedin.com/in/ishaan-jalan-550a28213/
- Karanjit Saha - https://www.linkedin.com/in/karanjit-saha-65a02122b/
- Monjoy Narayan Choudhury - https://www.linkedin.com/in/monjoy-narayan-choudhury-a424b3200/
- Rudransh Dixit - https://www.linkedin.com/in/rudransh-dixit-a785a61ba/



# Github Repo link

https://github.com/ishaanj0412/Carpool
Binary file added Readme_pics/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Readme_pics/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Readme_pics/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Readme_pics/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Readme_pics/5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Readme_pics/6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.carpool">
<application
android:label="carpool"
android:label="Carpool"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/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.
Binary file modified android/app/src/main/res/mipmap-mdpi/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.
Binary file modified android/app/src/main/res/mipmap-xhdpi/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.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/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.
Binary file modified 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.
Binary file added ico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions lib/LoginForm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class LoginForm extends StatelessWidget {
final String orgid;
final TextEditingController email_id_controller;
final TextEditingController roll_num_controller;
static late User u;
static late User? u;
static String? email;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -66,7 +67,7 @@ class LoginForm extends StatelessWidget {
hintStyle: const TextStyle(color: Colors.grey, fontSize: 14, fontFamily: 'Helvetica'),
labelStyle: const TextStyle(color: Colors.grey, fontSize: 14, fontFamily: 'Helvetica'),
hintText: "Enter Your Email",
labelText: "Email ID",
labelText: "Email ID (@iiitb.ac.in)",
filled: true,
fillColor: const Color(0xFF424242),
contentPadding: const EdgeInsets.all(15),
Expand Down Expand Up @@ -105,9 +106,7 @@ class LoginForm extends StatelessWidget {
ElevatedButton(
onPressed: () {
if (form_key.currentState!.validate()) {
//add backend

print("Validated");
//OTP FUNCTION
sendOTP(email_id_controller);
Navigator.push(
context,
Expand All @@ -116,9 +115,7 @@ class LoginForm extends StatelessWidget {
emailidcontroller: email_id_controller,
rollnumbercontroller: roll_num_controller,
)));
} else {
print("not valid");
}
} else {}
},
child: const Text(
"Get OTP",
Expand Down
130 changes: 21 additions & 109 deletions lib/OTP.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import 'package:carpool/auth.dart';
import 'package:carpool/database.dart';
import 'package:carpool/user.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:carpool/LoginForm.dart';
import 'package:string_validator/string_validator.dart';
import 'landing.dart';

// ignore: non_constant_identifier_names
class OTP extends StatelessWidget {
OTP(
{Key? key,
@required this.emailidcontroller,
@required this.rollnumbercontroller})
: super(key: key);
OTP({Key? key, @required this.emailidcontroller, @required this.rollnumbercontroller}) : super(key: key);
final _otpcontroller = TextEditingController();
final emailidcontroller;
final rollnumbercontroller;
Expand All @@ -38,10 +30,7 @@ class OTP extends StatelessWidget {
children: <Widget>[
const Text(
"Enter OTP",
style: TextStyle(
fontSize: 18,
color: Colors.grey,
fontFamily: 'Helvetica'),
style: TextStyle(fontSize: 18, color: Colors.grey, fontFamily: 'Helvetica'),
),
const SizedBox(
height: 15,
Expand All @@ -61,8 +50,7 @@ class OTP extends StatelessWidget {
filled: true,
fillColor: const Color(0xFF424242),
contentPadding: const EdgeInsets.all(15),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(7.0)),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(7.0)),
),
)),
const SizedBox(
Expand All @@ -72,104 +60,32 @@ class OTP extends StatelessWidget {
child: ElevatedButton(
onPressed: () async {
//removed otp for easy debug
//bool flag = await verifyOTP(emailidcontroller, _otpcontroller, context);
bool flag = true;
//bool flag = true;
bool flag = await verifyOTP(emailidcontroller, _otpcontroller, context);
//bool flag = true;
if (flag) {
Future<bool> flag1 = DataBaseService.exists(
emailidcontroller.text,
rollnumbercontroller.text);
if (kDebugMode) {
LoginForm.u = await User(
emailId: "[email protected]",
rollNumber: "IMT2020003",
dateRecords: []);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 7, 8);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 1, 2);
await LoginForm.u.update();

LoginForm.u = await User(
emailId: "[email protected]",
rollNumber: "IMT2020502",
dateRecords: []);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 7, 8);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 1, 4);
await LoginForm.u.update();

LoginForm.u = await User(
emailId: "[email protected]",
rollNumber: "IMT2020420",
dateRecords: []);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 3, 5);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 6, 9);
await LoginForm.u.update();

LoginForm.u = await User(
emailId: emailidcontroller.text,
rollNumber: rollnumbercontroller.text,
dateRecords: []);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 6, 8);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 9, 10);
await LoginForm.u.update();

var xD = await LoginForm.u.getBookingMatching(
LoginForm.u.bookingRecords.first);
print("hewwo");

LoginForm.u.deleteBooking(
LoginForm.u.bookingRecords.first,
LoginForm
.u.bookingRecords.first.intervals.first);
LoginForm.u.deleteBooking(
LoginForm.u.bookingRecords.first,
LoginForm
.u.bookingRecords.first.intervals.first);
Future<bool> flag1 = DataBaseService.exists(emailidcontroller.text);
if (await flag1) {
//get existing user
LoginForm.u = await DataBaseService.getData(emailidcontroller.text);
await LoginForm.u!.fetchBookingRecord();
} else {
if (await flag1) {
//get existing user
print(DataBaseService.getData(
emailidcontroller.text));
LoginForm.u = await DataBaseService.getData(
emailidcontroller.text);
await LoginForm.u.fetchBookingRecord();
print("hello success!");
} else {
LoginForm.u = await User(
emailId: emailidcontroller.text,
rollNumber: rollnumbercontroller.text,
dateRecords: []);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 6, 8);
LoginForm.u
.addBooking(DateTime(2022, 1, 4), 9, 10);
await LoginForm.u.update();
}
LoginForm.u = await User(emailId: emailidcontroller.text, rollNumber: rollnumbercontroller.text, dateRecords: []);
await LoginForm.u!.update();
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const TabNavigator()));

// storing in local storage
User.storeUser(emailidcontroller.text);
Navigator.push(context, MaterialPageRoute(builder: (context) => const TabNavigator()));
}
},
child: const Text(
"Verify OTP",
style: TextStyle(
fontSize: 12,
color: Colors.white,
fontFamily: 'Helvetica'),
style: TextStyle(fontSize: 12, color: Colors.white, fontFamily: 'Helvetica'),
),
style: ElevatedButton.styleFrom(
primary: Colors.blue,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
),
),
),
Expand All @@ -184,15 +100,11 @@ class OTP extends StatelessWidget {
},
child: const Text(
"Resend OTP",
style: TextStyle(
fontSize: 12,
color: Colors.white,
fontFamily: 'Helvetica'),
style: TextStyle(fontSize: 12, color: Colors.white, fontFamily: 'Helvetica'),
),
style: ElevatedButton.styleFrom(
primary: Colors.green,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
),
),
),
Expand Down
Loading

0 comments on commit 7a2a0cc

Please sign in to comment.