diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 789e90a..3e0bfa9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,21 +50,21 @@ jobs: - name: Get dependencies run: flutter pub get - - name: Create google-services.json - run: cat /home/runner/work/Makeathon5_app/Makeathon5_app/app/google-services.json | base64 +# - name: Create google-services.json +# run: cat /home/runner/work/Makeathon5_app/Makeathon5_app/app/google-services.json | base64 - - name: Putting data into google-services.json - env: - GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} - run: echo $GOOGLE_SERVICES_JSON | base64 -di > ./android/app/google-services.json +# - name: Putting data into google-services.json +# env: +# GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} +# run: echo $GOOGLE_SERVICES_JSON | base64 -di > ./android/app/google-services.json - - name: Create firebase_options.dart - run: cat /home/runner/work/Makeathon5_app/Makeathon5_app/lib/firebase_options.dart | base64 +# - name: Create firebase_options.dart +# run: cat /home/runner/work/Makeathon5_app/Makeathon5_app/lib/firebase_options.dart | base64 - - name: Putting data into firebase_options.dart - env: - FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} - run: echo $FIREBASE_OPTIONS | base64 -di > ./lib/firebase_options.dart +# - name: Putting data into firebase_options.dart +# env: +# FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }} +# run: echo $FIREBASE_OPTIONS | base64 -di > ./lib/firebase_options.dart # Runs a set of commands using the runners shell - name: Start release build diff --git a/.gitignore b/.gitignore index dc2918d..01b219d 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,8 @@ app.*.map.json /android/app/profile /android/app/release -#Firebase \ No newline at end of file +#Firebase +# /lib/firebase_options.dart +# /android/app/google-services.json +# /ios/firebase_app_id_file.json + diff --git a/Assets/Rectangle 29-1.png b/Assets/Rectangle 29-1.png new file mode 100644 index 0000000..2a4029b Binary files /dev/null and b/Assets/Rectangle 29-1.png differ diff --git a/Assets/Rectangle 29.png b/Assets/Rectangle 29.png new file mode 100644 index 0000000..2a4029b Binary files /dev/null and b/Assets/Rectangle 29.png differ diff --git a/Assets/Rectangle 36.png b/Assets/Rectangle 36.png new file mode 100644 index 0000000..2a4029b Binary files /dev/null and b/Assets/Rectangle 36.png differ diff --git a/Assets/back_arrow.png b/Assets/back_arrow.png new file mode 100644 index 0000000..742fc95 Binary files /dev/null and b/Assets/back_arrow.png differ diff --git a/Assets/blob 1.png b/Assets/blob 1.png new file mode 100644 index 0000000..a7c8a9e Binary files /dev/null and b/Assets/blob 1.png differ diff --git a/Assets/googlelogo.png b/Assets/googlelogo.png new file mode 100644 index 0000000..e14114b Binary files /dev/null and b/Assets/googlelogo.png differ diff --git a/Assets/upload_icon.png b/Assets/upload_icon.png new file mode 100644 index 0000000..4a1fff2 Binary files /dev/null and b/Assets/upload_icon.png differ diff --git a/Assets/vector.png b/Assets/vector.png new file mode 100644 index 0000000..fcc11c1 Binary files /dev/null and b/Assets/vector.png differ diff --git a/Assets/vector2.png b/Assets/vector2.png new file mode 100644 index 0000000..4b20732 Binary files /dev/null and b/Assets/vector2.png differ diff --git a/Assets/vector3.png b/Assets/vector3.png new file mode 100644 index 0000000..8d81896 Binary files /dev/null and b/Assets/vector3.png differ diff --git a/Assets/vector4.png b/Assets/vector4.png new file mode 100644 index 0000000..0b38287 Binary files /dev/null and b/Assets/vector4.png differ diff --git a/Assets/vector7.png b/Assets/vector7.png new file mode 100644 index 0000000..823e825 Binary files /dev/null and b/Assets/vector7.png differ diff --git a/Fonts/Inter.ttf b/Fonts/Inter.ttf new file mode 100644 index 0000000..ec3164e Binary files /dev/null and b/Fonts/Inter.ttf differ diff --git a/Fonts/jejugothic.ttf b/Fonts/jejugothic.ttf new file mode 100644 index 0000000..a6886c3 Binary files /dev/null and b/Fonts/jejugothic.ttf differ diff --git a/android/app/build.gradle b/android/app/build.gradle index db07773..41ea648 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -29,7 +29,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion flutter.compileSdkVersion + compileSdkVersion 33 ndkVersion flutter.ndkVersion compileOptions { @@ -50,7 +50,7 @@ android { applicationId "com.example.makeathon5_app" // 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 flutter.minSdkVersion + minSdkVersion 19 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/app/google-services.json b/android/app/google-services.json index c09ae43..d12c428 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,6 +1,7 @@ { "project_info": { "project_number": "962819408926", + "firebase_url": "https://make5app-dummy-default-rtdb.firebaseio.com", "project_id": "make5app-dummy", "storage_bucket": "make5app-dummy.appspot.com" }, @@ -14,7 +15,15 @@ }, "oauth_client": [ { - "client_id": "962819408926-d7i5l7m96b3utr44gul3nvk5l04v02nq.apps.googleusercontent.com", + "client_id": "962819408926-s6p8991knv2traif6cempkub8vkn1k2h.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.example.makeathon5_app", + "certificate_hash": "9f09222d58c8315f47aa8d807c92efcde29cd6fe" + } + }, + { + "client_id": "962819408926-88ci77f7607hpjsadk15psg60medv7uc.apps.googleusercontent.com", "client_type": 3 } ], @@ -27,8 +36,16 @@ "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "962819408926-d7i5l7m96b3utr44gul3nvk5l04v02nq.apps.googleusercontent.com", + + "client_id": "962819408926-88ci77f7607hpjsadk15psg60medv7uc.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "962819408926-fjvgqgmjj1n1rfjshk4dq1crfdqmrh7r.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.example.makeathon5App" + } } ] } @@ -37,3 +54,4 @@ ], "configuration_version": "1" } + diff --git a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 0000000..752fc18 --- /dev/null +++ b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/android/build.gradle b/android/build.gradle index 9192654..111a072 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:4.1.0' // START: FlutterFire Configuration classpath 'com.google.gms:google-services:4.3.10' // END: FlutterFire Configuration diff --git a/lib/AnnouncementsPage/announcement.dart b/lib/AnnouncementsPage/announcement.dart new file mode 100644 index 0000000..f8988ee --- /dev/null +++ b/lib/AnnouncementsPage/announcement.dart @@ -0,0 +1,30 @@ +import 'package:intl/intl.dart'; + +class Announcement { + List months = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec' + ]; + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm:ss"); + String? body; + String? time; + String? date; + String? formattedDateTime; + DateTime? dateTime; + + Announcement({this.body, this.formattedDateTime}) { + dateTime = dateFormat.parse(formattedDateTime!); + date = "${dateTime!.day} ${months[dateTime!.month]}"; + time = DateFormat("hh:mm a").format(dateTime!); + } +} diff --git a/lib/AnnouncementsPage/announcement_card.dart b/lib/AnnouncementsPage/announcement_card.dart new file mode 100644 index 0000000..acb504d --- /dev/null +++ b/lib/AnnouncementsPage/announcement_card.dart @@ -0,0 +1,58 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'announcement.dart'; + +class AnnouncementCard extends StatelessWidget { + Announcement? announcement; + + AnnouncementCard(this.announcement); + @override + Widget build(BuildContext context) { + return Card( + margin: EdgeInsets.only(bottom: 20), + elevation: 4, + clipBehavior: Clip.antiAlias, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(18)), + child: Material( + child: InkWell( + splashFactory: InkRipple.splashFactory, + splashColor: Color.fromARGB(66, 128, 128, 128), + onTap: () { + print('Tapped!'); + }, + child: Container( + padding: EdgeInsets.fromLTRB(5, 10, 5, 10), + child: ListTile( + title: Row( + children: [ + Text( + announcement!.time!, + style: TextStyle( + fontFamily: 'Inter', fontWeight: FontWeight.bold), + ), + Spacer(), + Text( + announcement!.date!, + style: TextStyle( + fontFamily: 'Inter', fontWeight: FontWeight.bold), + ), + ], + ), + subtitle: Container( + margin: EdgeInsets.only(top: 10), + child: Text( + announcement!.body!, + style: TextStyle( + color: Colors.black, + fontFamily: 'Inter', + ), + textAlign: TextAlign.left, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/AnnouncementsPage/main.dart b/lib/AnnouncementsPage/main.dart new file mode 100644 index 0000000..1c36f64 --- /dev/null +++ b/lib/AnnouncementsPage/main.dart @@ -0,0 +1,84 @@ +import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_database/firebase_database.dart'; +import 'package:flutter/material.dart'; +import 'package:makeathon5_app/AnnouncementsPage/announcement.dart'; +import 'package:makeathon5_app/AnnouncementsPage/announcement_card.dart'; +import 'package:makeathon5_app/AnnouncementsPage/top_bar.dart'; + +import '../firebase_options.dart'; + +class AnnouncementsPage extends StatefulWidget { + @override + State createState() => _AnnouncementsPage(); +} + +class _AnnouncementsPage extends State { + var announcements = []; + bool buffering = true; + + @override + void initState() { + super.initState(); + fetchAnnouncements(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + TopBar(), + Visibility( + visible: buffering, + child: Container( + margin: EdgeInsets.only( + top: MediaQuery.of(context).size.height / 3.5), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Spacer(), + Row( + children: [Spacer(), CircularProgressIndicator(), Spacer()], + ), + Spacer() + ], + ), + ), + ), + Container( + margin: + EdgeInsets.only(top: MediaQuery.of(context).size.height / 3.5), + child: ListView.builder( + padding: EdgeInsets.all(15), + itemBuilder: (context, position) { + return AnnouncementCard( + announcements[announcements.length - position - 1]); + }, + itemCount: announcements.length, + ), + ) + ], + ), + ); + } + + Future fetchAnnouncements() async { + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); + DatabaseReference announcementsRef = + FirebaseDatabase.instance.ref().child("Announcements"); + announcementsRef.onChildAdded.listen((event) { + Announcement announcement = Announcement( + formattedDateTime: event.snapshot.child("time").value.toString(), + body: event.snapshot.child("body").value.toString(), + ); + setState( + () { + announcements.add(announcement); + buffering = false; + }, + ); + }); + } +} diff --git a/lib/AnnouncementsPage/top_bar.dart b/lib/AnnouncementsPage/top_bar.dart new file mode 100644 index 0000000..d1b5a3a --- /dev/null +++ b/lib/AnnouncementsPage/top_bar.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; + +class TopBar extends StatelessWidget { + static double? height; + @override + Widget build(BuildContext context) { + height = MediaQuery.of(context).size.height / 3.5; + return Stack( + children: [ + Image.asset( + 'Assets/vector2.png', + width: MediaQuery.of(context).size.width, + height: height, + fit: BoxFit.fill, + ), + Column( + children: [ + Container( + child: Image.asset( + 'Assets/vector7.png', + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height / 5.5, + fit: BoxFit.fill, + ), + ), + Container( + transform: Matrix4.translationValues( + 0, -MediaQuery.of(context).size.height / 13, 0), + child: Row( + children: [ + SizedBox( + width: MediaQuery.of(context).size.width / 15, + ), + Text( + "Announcements", + style: TextStyle( + fontSize: 30, + color: Colors.white, + fontFamily: 'Jejugothic'), + ), + ], + ), + ), + ], + ), + Padding( + padding: EdgeInsets.only(top: 50, bottom: 40, left: 20, right: 20), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Image.asset( + // 'Assets/back_arrow.png', + // scale: 1.25, + // ), + Spacer(), + Image.asset( + 'Assets/MLSClogo.png', + scale: 2.75, + ), + ], + ), + ], + ), + ), + ], + ); + } +} diff --git a/lib/CheckinPage/checkin_button.dart b/lib/CheckinPage/checkin_button.dart new file mode 100644 index 0000000..7eb60ce --- /dev/null +++ b/lib/CheckinPage/checkin_button.dart @@ -0,0 +1,48 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'main.dart'; + +class CheckinButton extends StatelessWidget { + bool isEnabled = false; + + CheckinButton(bool isEnabled) { + this.isEnabled = isEnabled; + } + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: isEnabled + ? () { + checkinUser(); + } + : null, + style: ElevatedButton.styleFrom( + backgroundColor: Color.fromARGB(255, 34, 99, 192), + ), + child: Container( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 3, 0, 3), + child: Padding( + padding: EdgeInsets.only(top: 10, bottom: 10), + child: Row( + children: [ + Spacer(), + Text( + 'Check In', + style: TextStyle( + fontFamily: 'Inter', + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 18, + ), + ), + Spacer(), + ], + )), + ), + ), + ); + } +} diff --git a/lib/CheckinPage/main.dart b/lib/CheckinPage/main.dart new file mode 100644 index 0000000..0ff04b5 --- /dev/null +++ b/lib/CheckinPage/main.dart @@ -0,0 +1,116 @@ +import 'dart:io'; +import 'package:makeathon5_app/FirstPage/main.dart'; +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter/material.dart'; +import 'package:makeathon5_app/CheckinPage/checkin_button.dart'; +import 'package:makeathon5_app/CheckinPage/upload_button.dart'; + +class CheckinPage extends StatefulWidget { + User? user; + + @override + _CheckinPageState createState() => _CheckinPageState(); +} + +void checkinUser() { + File certificate = UploadButton.file!; + //TODO: Implement checkin and upload cert to databse +} + +class _CheckinPageState extends State { + bool isEnabled = false; + @override + Widget build(BuildContext context) { + void changeState(bool isEnabled) { + setState(() { + this.isEnabled = isEnabled; + }); + } + + return Scaffold( + body: Stack( + children: [ + Image.asset( + 'Assets/vector2.png', + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height / 1.75, + fit: BoxFit.fill, + ), + Column( + children: [ + Container( + child: Image.asset( + 'Assets/vector7.png', + width: MediaQuery.of(context).size.width, + fit: BoxFit.fill, + ), + ), + Row( + children: [ + SizedBox( + width: 50, + ), + Text( + "Check In", + style: TextStyle( + fontSize: 30, + color: Colors.white, + fontFamily: 'Jejugothic'), + ), + Spacer(), + Container( + transform: Matrix4.translationValues( + 0, -MediaQuery.of(context).size.height / 50, 0), + child: Image.asset('Assets/vector.png'), + ), + ], + ), + ], + ), + Padding( + padding: EdgeInsets.only(top: 50, bottom: 40, left: 20, right: 20), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => FirstPage()), + ); + }, + child: Image.asset( + 'Assets/back_arrow.png', + scale: 1.25, + ), + ), + Spacer(), + Image.asset( + 'Assets/MLSClogo.png', + scale: 2.75, + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(30, 0, 30, 50), + child: Column( + children: [ + Spacer(), + UploadButton(changeState), + SizedBox( + height: 60, + ), + CheckinButton(isEnabled) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/CheckinPage/upload_button.dart b/lib/CheckinPage/upload_button.dart new file mode 100644 index 0000000..115c6aa --- /dev/null +++ b/lib/CheckinPage/upload_button.dart @@ -0,0 +1,67 @@ +import 'dart:io'; + +import 'package:file_picker/file_picker.dart'; +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_database/firebase_database.dart'; +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class UploadButton extends StatelessWidget { + Function callback; + static File? file; + + UploadButton(this.callback); + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: () { + showFilePicker(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + side: BorderSide( + width: 1, + color: Color.fromARGB(255, 34, 99, 192), + ), + ), + child: Container( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 3, 0, 3), + child: Row( + children: [ + Image.asset( + 'Assets/upload_icon.png', + height: 40, + ), + Spacer(), + Text( + 'Upload Vaccination Cert.', + style: TextStyle( + fontFamily: 'Inter', + fontWeight: FontWeight.bold, + color: Color.fromARGB(255, 34, 99, 192), + fontSize: 18, + ), + ), + Spacer(), + ], + ), + ), + ), + ); + } + + Future showFilePicker() async { + FilePickerResult? result = await FilePicker.platform + .pickFiles(type: FileType.custom, allowedExtensions: ['pdf']); + + if (result != null) { + file = File(result.files.single.path!); + callback.call(true); + } else { + // User canceled the picker + } + } +} diff --git a/lib/FirstPage/google_sign_in.dart b/lib/FirstPage/google_sign_in.dart new file mode 100644 index 0000000..4015f3a --- /dev/null +++ b/lib/FirstPage/google_sign_in.dart @@ -0,0 +1,99 @@ +import 'package:firebase_database/firebase_database.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:makeathon5_app/CheckinPage/main.dart'; + +GoogleSignIn? googleSignIn; + +class Authentication { + Future signInWithGoogle() async { + googleSignIn = GoogleSignIn(); + final GoogleSignInAccount? googleUser = await googleSignIn!.signIn(); + + final GoogleSignInAuthentication? googleAuth = + await googleUser?.authentication; + + final credential = GoogleAuthProvider.credential( + accessToken: googleAuth?.accessToken, + idToken: googleAuth?.idToken, + ); + + return await FirebaseAuth.instance.signInWithCredential(credential); + } +} + +Future updateOnDatabase(User user) async { + final databaseRef = + FirebaseDatabase.instance.ref().child('Users').child(user.uid); + databaseRef.child('Name').set(user.providerData[0].displayName); +} + +class SignInButton extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column(children: [ + Container( + width: double.infinity, + child: Container( + // margin: EdgeInsets.fromLTRB(0, 10, 20, 50), + width: double.infinity, + child: ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + Color.fromARGB(255, 216, 217, 216))), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: ((context) { + //TODO: Change to HomePage() + return CheckinPage(); + }), + ), + ); + }, + child: Container( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 3, 0, 3), + child: Row( + children: [ + Image.asset( + 'Assets/googlelogo.png', + height: 40, + ), + Spacer(), + Text( + 'Skip Sign-in', + style: TextStyle( + fontFamily: 'Inter', + fontWeight: FontWeight.bold, + color: Color.fromARGB(255, 34, 99, 192), + fontSize: 18, + ), + ), + Spacer(), + ], + ), + ), + ), + ), + ), + ) + ]); + } + + Future _signOut() async { + await FirebaseAuth.instance.signOut(); + googleSignIn!.disconnect(); + Fluttertoast.showToast(msg: 'Please login with your thapar.edu account'); + } + + Future updateOnDatabase(User user) async { + final databaseRef = + FirebaseDatabase.instance.ref().child('Users').child(user.uid); + databaseRef.child('name').set(user.providerData[0].displayName); + } +} diff --git a/lib/FirstPage/main.dart b/lib/FirstPage/main.dart new file mode 100644 index 0000000..79dc858 --- /dev/null +++ b/lib/FirstPage/main.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'google_sign_in.dart'; + +class FirstPage extends StatefulWidget { + @override + _FirstPageState createState() => _FirstPageState(); +} + +class _FirstPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color.fromARGB(255, 34, 99, 192), + body: SafeArea( + child: Stack( + children: [ + Align( + alignment: Alignment.topLeft, + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width / 20, + top: MediaQuery.of(context).size.height / 30), + child: Image.asset( + 'Assets/MLSClogo.png', + ), + ), + ), + Column( + children: [ + Image.asset( + 'Assets/vector3.png', + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height / 1.8, + fit: BoxFit.fill, + ), + Container( + transform: Matrix4.translationValues( + 0, -MediaQuery.of(context).size.height / 10, 0), + alignment: Alignment.topRight, + child: Image.asset( + 'Assets/vector.png', + ), + ), + ], + ), + Container( + margin: EdgeInsets.fromLTRB(30, 0, 30, 50), + child: Column( + children: [ + Spacer(), + Container( + margin: EdgeInsets.only(left: 8), + alignment: AlignmentDirectional.topStart, + child: Text( + 'Lorem Ipsem', + style: TextStyle( + fontFamily: 'Inter', + fontWeight: FontWeight.bold, + fontSize: 22, + color: Colors.white, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 15, left: 8), + alignment: AlignmentDirectional.topStart, + child: Text( + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', + style: TextStyle( + fontFamily: 'Inter', + fontSize: 15, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 50, + ), + SignInButton(), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index b7f294b..b79ee0f 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -52,6 +52,7 @@ class DefaultFirebaseOptions { messagingSenderId: '962819408926', projectId: 'make5app-dummy', authDomain: 'make5app-dummy.firebaseapp.com', + databaseURL: 'https://make5app-dummy-default-rtdb.firebaseio.com', storageBucket: 'make5app-dummy.appspot.com', ); @@ -60,6 +61,7 @@ class DefaultFirebaseOptions { appId: '1:962819408926:android:09dd55ce0b250e83181a0f', messagingSenderId: '962819408926', projectId: 'make5app-dummy', + databaseURL: 'https://make5app-dummy-default-rtdb.firebaseio.com', storageBucket: 'make5app-dummy.appspot.com', ); @@ -68,9 +70,10 @@ class DefaultFirebaseOptions { appId: '1:962819408926:ios:c4d8255eee42004c181a0f', messagingSenderId: '962819408926', projectId: 'make5app-dummy', + databaseURL: 'https://make5app-dummy-default-rtdb.firebaseio.com', storageBucket: 'make5app-dummy.appspot.com', - iosClientId: - '962819408926-fjvgqgmjj1n1rfjshk4dq1crfdqmrh7r.apps.googleusercontent.com', + androidClientId: '962819408926-s6p8991knv2traif6cempkub8vkn1k2h.apps.googleusercontent.com', + iosClientId: '962819408926-fjvgqgmjj1n1rfjshk4dq1crfdqmrh7r.apps.googleusercontent.com', iosBundleId: 'com.example.makeathon5App', ); } diff --git a/lib/main.dart b/lib/main.dart index 41047c2..cc2d0a9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,11 +1,20 @@ import 'package:flutter/material.dart'; - -//Firebase Packages import 'package:firebase_core/firebase_core.dart'; +import 'package:makeathon5_app/CheckinPage/main.dart'; +import 'FirstPage/main.dart'; import 'firebase_options.dart'; +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:firebase_database/firebase_database.dart'; void main() { runApp(const MyApp()); + initFirebase(); +} + +Future initFirebase() async { + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); } class MyApp extends StatelessWidget { @@ -13,12 +22,8 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return const MaterialApp( - home: Scaffold( - body: Center( - child: Text("Hello World!"), - ), - ), + return MaterialApp( + home: FirstPage(), ); } } diff --git a/pubspec.lock b/pubspec.lock index f4c508e..cc54e2c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.12" async: dependency: transitive description: @@ -50,6 +57,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + file_picker: + dependency: "direct main" + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.5" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.5" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "6.11.7" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.4" firebase_core: dependency: "direct main" description: @@ -71,6 +113,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + firebase_database: + dependency: "direct main" + description: + name: firebase_database + url: "https://pub.dartlang.org" + source: hosted + version: "10.0.9" + firebase_database_platform_interface: + dependency: transitive + description: + name: firebase_database_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2+17" + firebase_database_web: + dependency: transitive + description: + name: firebase_database_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+19" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + url: "https://pub.dartlang.org" + source: hosted + version: "11.0.10" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.26" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + url: "https://pub.dartlang.org" + source: hosted + version: "3.3.19" flutter: dependency: "direct main" description: flutter @@ -83,6 +167,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" flutter_test: dependency: "direct dev" description: flutter @@ -93,6 +184,69 @@ packages: description: flutter source: sdk version: "0.0.0" + fluttertoast: + dependency: "direct main" + description: + name: fluttertoast + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.2" + google_sign_in: + dependency: "direct main" + description: + name: google_sign_in + url: "https://pub.dartlang.org" + source: hosted + version: "5.4.3" + google_sign_in_android: + dependency: transitive + description: + name: google_sign_in_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.4" + google_sign_in_ios: + dependency: transitive + description: + name: google_sign_in_ios + url: "https://pub.dartlang.org" + source: hosted + version: "5.5.1" + google_sign_in_platform_interface: + dependency: transitive + description: + name: google_sign_in_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.2+1" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.5" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" js: dependency: transitive description: @@ -142,6 +296,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.3" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" sky_engine: dependency: transitive description: flutter @@ -189,6 +350,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.12" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" vector_math: dependency: transitive description: @@ -196,6 +364,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.3" sdks: dart: ">=2.18.6 <3.0.0" - flutter: ">=1.20.0" + flutter: ">=2.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1324c1b..4fc2103 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,6 +37,13 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 + firebase_database: ^10.0.9 + intl: ^0.17.0 + firebase_storage: ^11.0.10 + firebase_auth: ^4.2.5 + google_sign_in: ^5.4.3 + fluttertoast: ^8.1.2 + file_picker: ^5.2.5 dev_dependencies: flutter_test: @@ -79,10 +86,13 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf + fonts: + - family: Inter + fonts: + - asset: Fonts/Inter.ttf + - family: JejuGothic + fonts: + - asset: Fonts/jejugothic.ttf # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro