diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies new file mode 100644 index 0000000..169a5f6 --- /dev/null +++ b/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"cloud_firestore","dependencies":["firebase_core","cloud_firestore_web"]},{"name":"cloud_firestore_web","dependencies":["firebase_core"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"qr_code_scanner","dependencies":[]}]} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ae1f183..6245db9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,4 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Exceptions to above rules. -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +.flutter-plugins-dependencies +.flutter-plugins +build/ +.packages \ No newline at end of file diff --git a/.packages b/.packages new file mode 100644 index 0000000..555781d --- /dev/null +++ b/.packages @@ -0,0 +1,43 @@ +# Generated by pub on 2020-03-05 21:20:38.644301. +archive:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.11/lib/ +args:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.2/lib/ +async:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.4.0/lib/ +boolean_selector:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.5/lib/ +charcode:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/ +cloud_firestore:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.4/lib/ +cloud_firestore_platform_interface:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-1.1.0/lib/ +cloud_firestore_web:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-0.1.1/lib/ +collection:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.11/lib/ +convert:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib/ +crypto:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.3/lib/ +cupertino_icons:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/ +firebase:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/ +firebase_core:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.4+2/lib/ +firebase_core_platform_interface:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_platform_interface-1.0.4/lib/ +firebase_core_web:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-0.1.1+2/lib/ +flutter:file:///C:/flutter/packages/flutter/lib/ +flutter_test:file:///C:/flutter/packages/flutter_test/lib/ +flutter_web_plugins:file:///C:/flutter/packages/flutter_web_plugins/lib/ +http:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.0+4/lib/ +http_parser:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/ +image:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.4/lib/ +js:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/ +matcher:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.6/lib/ +meta:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.8/lib/ +path:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.4/lib/ +pedantic:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.8.0+1/lib/ +petitparser:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/petitparser-2.4.0/lib/ +plugin_platform_interface:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.0.2/lib/ +qr_code_scanner:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.0.12/lib/ +quiver:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.0.5/lib/ +sky_engine:file:///C:/flutter/bin/cache/pkg/sky_engine/lib/ +source_span:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.5.5/lib/ +stack_trace:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/ +stream_channel:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.0.0/lib/ +string_scanner:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5/lib/ +term_glyph:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0/lib/ +test_api:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.11/lib/ +typed_data:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/ +vector_math:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/ +xml:file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/xml-3.5.0/lib/ +project:lib/ diff --git a/README.md b/README.md index 9813765..212f731 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# QRRegistration-Frontend +# How to run + +### Run these commands in the terminal +```shell + flutter pub get + flutter run +``` \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index ebf229c..a3a544a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,67 +1,68 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.ieee_qr_app" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply plugin: 'com.google.gms.google-services' + +android { + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.ieee" + minSdkVersion 21 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' +} diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..9336080 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "763064306598", + "firebase_url": "https://qr-reg-ieee.firebaseio.com", + "project_id": "qr-reg-ieee", + "storage_bucket": "qr-reg-ieee.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:763064306598:android:778cd8e99face8ba6b9d67", + "android_client_info": { + "package_name": "com.example.ieee" + } + }, + "oauth_client": [ + { + "client_id": "763064306598-2fd8p3ncoqprtkunb4jnh0if92bkaocm.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBAib19Ve_BjRzpQdSLAq5QTWrbqJahZio" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "763064306598-2fd8p3ncoqprtkunb4jnh0if92bkaocm.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index b00b049..d17bd91 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d6e2d40..92df635 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 0000000..a54ef04 --- /dev/null +++ b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,21 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.embedding.engine.FlutterEngine; +import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine); + io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin.registerWith(shimPluginRegistry.registrarFor("io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin")); + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FirebaseCorePlugin()); + net.touchcapture.qr.flutterqr.FlutterQrPlugin.registerWith(shimPluginRegistry.registrarFor("net.touchcapture.qr.flutterqr.FlutterQrPlugin")); + } +} diff --git a/android/app/src/main/kotlin/com/example/ieee/MainActivity.kt b/android/app/src/main/kotlin/com/example/ieee/MainActivity.kt new file mode 100644 index 0000000..f2b9456 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/ieee/MainActivity.kt @@ -0,0 +1,12 @@ +package com.example.ieee; + +import androidx.annotation.NonNull; +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugins.GeneratedPluginRegistrant + +class MainActivity: FlutterActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + } +} diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 304732f..8403758 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,12 @@ - - - - - - - - + + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 00fa441..4c57322 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,8 +1,8 @@ - - - - + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index b00b049..007af16 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/android/build.gradle b/android/build.gradle index 3100ad2..66fd2e7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,31 +1,32 @@ -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.3' + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties index 38c8d45..74c1d92 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true -android.useAndroidX=true -android.enableJetifier=true +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..13372ae Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146..31afd70 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/android/gradlew b/android/gradlew new file mode 100644 index 0000000..e834973 --- /dev/null +++ b/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/local.properties b/android/local.properties new file mode 100644 index 0000000..c0e4c53 --- /dev/null +++ b/android/local.properties @@ -0,0 +1,5 @@ +sdk.dir=C:\\Users\\Shloka\\AppData\\Local\\Android\\sdk +flutter.sdk=C:\\flutter +flutter.buildMode=debug +flutter.versionName=1.0.0 +flutter.versionCode=1 \ No newline at end of file diff --git a/android/project_android.iml b/android/project_android.iml new file mode 100644 index 0000000..1ab2736 --- /dev/null +++ b/android/project_android.iml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14f..4f14f8e 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,15 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/home.dart b/home.dart new file mode 100644 index 0000000..f6339e8 --- /dev/null +++ b/home.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; +// import 'package:ieee/qrpage.dart'; + +import './qrpage.dart'; + +import 'listpage.dart'; + +class HomePage extends StatefulWidget { + @override + _HomePageState createState() => _HomePageState(); +} + +class _HomePageState extends State { + int _selectedIndex = 0; + PageController _controller = PageController(initialPage: 0); + @override + Widget build(BuildContext context) { + return Scaffold( + body: PageView( + controller: _controller, + scrollDirection: Axis.horizontal, + children: [ + QRPage(), + ListPage(), + ], + onPageChanged: (i) { + setState(() { + _selectedIndex = i; + }); + }, + ), + bottomNavigationBar: BottomNavigationBar( + currentIndex: _selectedIndex, + backgroundColor: Colors.blueGrey, + selectedItemColor: Colors.white, + unselectedItemColor: Colors.grey[400], + items: [ + BottomNavigationBarItem( + icon: Icon(Icons.camera_alt), + title: Text("Scan QR"), + ), + BottomNavigationBarItem( + icon: Icon(Icons.list), + title: Text("Participants"), + ), + ], + onTap: (i) { + _controller.animateToPage(i, + duration: Duration(milliseconds: 100), curve: Curves.linear); + setState(() { + _selectedIndex = i; + }); + }, + ), + ); + } +} diff --git a/listpage.dart b/listpage.dart new file mode 100644 index 0000000..bb8a5e0 --- /dev/null +++ b/listpage.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; +class ListPage extends StatefulWidget { + @override + _ListPageState createState() => _ListPageState(); +} +class _ListPageState extends State { + @override + void initState() { + super.initState(); + getParticipantsList().then((results) { + setState(() { + querySnapshot = results; + }); + }); + } + + QuerySnapshot querySnapshot; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.blueGrey, + title: Text( + "Participants", + textAlign: TextAlign.center,), + ), + body: _showParticipants(), + + + ); + } + + Widget _showParticipants() { + if (querySnapshot != null) { + return ListView.builder( + primary: false, + itemCount: querySnapshot.documents.length, + padding: EdgeInsets.all(12), + itemBuilder: (context, i) { + return Column( + children: [ + Text("${querySnapshot.documents[i].data['name']}", + style:TextStyle(fontWeight: FontWeight.bold)), + ] + ); + } + ); + } + + } + } +getParticipantsList() async { + return await Firestore.instance.collection('participant').getDocuments(); +} \ No newline at end of file diff --git a/main.dart b/main.dart new file mode 100644 index 0000000..2864250 --- /dev/null +++ b/main.dart @@ -0,0 +1,116 @@ +import 'package:flutter/material.dart'; +// import 'package:qrscan/qrscan.dart' as scanner; +import 'package:flutter/services.dart'; +//import 'package:barcode_scan/barcode_scan.dart' + +import 'home.dart'; + +void main() => runApp(MaterialApp( + debugShowCheckedModeBanner: false, + home: HomePage(), + )); + +// class MainPage extends StatefulWidget { +// @override +// MainPageState createState() { +// return new MainPageState(); +// } +// } + +// class MainPageState extends State { +// String result = 'hi'; + +// Future _scanQR() async { +// try { +// String cameraScanResult = await scanner.scan(); +// print(cameraScanResult); +// // setState(() { +// // result = cameraScanResult; +// // }); +// } on PlatformException catch (ex) { +// if (ex.code == scanner.CameraAccessDenied) { +// setState(() { +// result = "Camera permission was denied"; +// }); +// } else { +// setState(() { +// result = "Unknown Error $ex"; +// }); +// } +// } on FormatException { +// setState(() { +// result = "You pressed the back button before scanning anything"; +// }); +// } catch (ex) { +// setState(() { +// result = "Unknown Error $ex"; +// }); +// } +// } + +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// appBar: AppBar( +// title: Image( +// image: AssetImage('images/download.png'), +// height: 25, +// width: 500, +// ), +// backgroundColor: Colors.blueAccent, +// ), +// body: Stack( +// children: [ +// new Container( +// decoration: new BoxDecoration( +// image: new DecorationImage( +// image: new AssetImage('images/bg1.jpg'), +// fit: BoxFit.cover, +// ), +// ), +// ), +// Center( +// child: +// Column( +// children: [ +// FlatButton( +// onPressed: (){ +// print(" "); +// }, +// child:Text("EVENTS LIST",style: TextStyle(color: Colors.white),), +// color:Colors.lightBlueAccent, +// ), +// FlatButton( +// onPressed: (){ +// print(" "); +// }, +// child:Text("PARTICIPANTS LIST",style: TextStyle(color: Colors.white),), +// color:Colors.lightBlueAccent, +// ), +// ], + +// ) +// ) + +// ], + +// ), + + +// //Container( +// //// decoration: new BoxDecoration( +// //// image: new DecorationImage( +// //// image: new AssetImage('images/.jpg'), +// //// fit:BoxFit.cover, +// // ), +// //) +// floatingActionButton: FloatingActionButton.extended( +// icon: Icon(Icons.camera_alt), +// label: Text("Scan"), +// onPressed: _scanQR, +// backgroundColor: Colors.blueAccent, +// ), +// floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, +// ); +// } +// } diff --git a/project.iml b/project.iml new file mode 100644 index 0000000..3ae446d --- /dev/null +++ b/project.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index fcf6763..d86b628 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -36,6 +36,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.2" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" collection: dependency: transitive description: @@ -64,6 +85,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.4+2" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+2" flutter: dependency: "direct main" description: flutter @@ -74,6 +123,25 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0+4" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.3" image: dependency: transitive description: @@ -81,6 +149,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.4" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1+1" matcher: dependency: transitive description: @@ -116,6 +191,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.4.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + qr_code_scanner: + dependency: "direct main" + description: + name: qr_code_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.12" quiver: dependency: transitive description: @@ -192,4 +281,5 @@ packages: source: hosted version: "3.5.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.7.0-dev <3.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index b9b177a..4fba152 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,72 +1,76 @@ -name: ieee_qr_app -description: A new Flutter project. - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 - -environment: - sdk: ">=2.1.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 - -dev_dependencies: - flutter_test: - sdk: flutter - - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "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 - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages +name: project +description: A new Flutter application. + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.1.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + firebase_core: ^0.4.0+9 + cupertino_icons: ^0.1.2 + cloud_firestore: ^0.13.4 + qr_code_scanner: ^0.0.12 + + +dev_dependencies: + flutter_test: + sdk: flutter + + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # # To add assets to your application, add an assets section, like this: + # assets: + # - images/ + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "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 + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages