├── .gitignore ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── miniproject │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── Student.png └── Teacher.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── main.dart ├── models │ └── todo.dart ├── pages │ ├── register_page.dart │ ├── student_home_page.dart │ ├── student_login.dart │ ├── student_root_page.dart │ ├── teach_home_page.dart │ ├── teach_tab1_page.dart │ ├── teach_tab2_page.dart │ ├── teacher_login.dart │ └── teacher_root_page.dart └── services │ └── authentication.dart ├── pubspec.lock ├── pubspec.yaml └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 27321ebbad34b0a3fafe99fac037102196d655ff 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

QR-Code-Based-Attendance-Management-System

2 |

build:passed

3 | 4 | ## Getting Started 5 | This project is a starting point for a Flutter application. 6 | 7 | A few resources to get you started if this is your first Flutter project: 8 | 9 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 10 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | 16 | ## Screenshots 17 | 18 | ### Mobile 19 | ![p1](https://user-images.githubusercontent.com/51479606/83336164-dba1d400-a2ce-11ea-8e00-dc3f99271831.jpg) 20 | ![p2](https://user-images.githubusercontent.com/51479606/83336220-2ae80480-a2cf-11ea-8c1a-6af2795982b9.jpg) 21 | ![p3](https://user-images.githubusercontent.com/51479606/83336242-6c78af80-a2cf-11ea-96c9-0e7ddc7207c2.jpg) 22 | ![p4](https://user-images.githubusercontent.com/51479606/83336278-b792c280-a2cf-11ea-9b71-e944dcf789bf.jpg) 23 | ![p5](https://user-images.githubusercontent.com/51479606/83336302-ed37ab80-a2cf-11ea-99a8-6f3afa394b0a.jpg) 24 | ![p6](https://user-images.githubusercontent.com/51479606/83336339-38ea5500-a2d0-11ea-9756-d7d6afe3adca.jpg) 25 | ![p7](https://user-images.githubusercontent.com/51479606/83336363-7222c500-a2d0-11ea-8a8e-964e021cc861.jpg) 26 | ![p8](https://user-images.githubusercontent.com/51479606/83336389-ab5b3500-a2d0-11ea-9e84-f5c96cf2f82f.jpg) 27 | 28 | ## 👍 Contribution 29 | 1. Fork it 30 | 2. Create your feature branch (git checkout -b my-new-feature) 31 | 3. Commit your changes (git commit -m 'Add some feature') 32 | 4. Push to the branch (git push origin my-new-feature) 33 | 5. Create new Pull Request 34 | 35 | ### What can you contribute 36 | 1. Find bugs or errors and fix it. 37 | 2. Improve UI/UX designs. 38 | 3. Add some cool features. 39 | 40 | ## Project setup 41 | 42 | **Step 1:** 43 | 44 | Download or clone this repo by using the link below: 45 | 46 | ``` 47 | https://github.com/anushad511/QR-Code-Based-Attendance-Management-System 48 | ``` 49 | 50 | **Step 2:** 51 | 52 | Go to project root and execute the following command in console to get the required dependencies: 53 | 54 | ``` 55 | flutter pub get 56 | ``` 57 | 58 | **Step 3:** 59 | 60 | Run the project in Android Studio or any IDE you prefer or run the command: 61 | 62 | ``` 63 | flutter run or Run the project in android studio 64 | ``` 65 | 66 | **Step 4:** 67 | 68 | To build the flutter project: 69 | 70 | ``` 71 | flutter build 72 | ``` 73 | 74 | ## Facing Any Problem or need any Help:grey_question: 75 | Incase you face any problem or need any help write me in [issues](https://github.com/anushad511/QR-Code-Based-Attendance-Management-System/issues) section 76 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.miniproject" 42 | minSdkVersion 21 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | 68 | } 69 | apply plugin: 'com.google.gms.google-services' 70 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "751666247977", 4 | "firebase_url": "https://fire-demo-52e1f.firebaseio.com", 5 | "project_id": "fire-demo-52e1f", 6 | "storage_bucket": "fire-demo-52e1f.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:751666247977:android:31ada903be91e88a409f38", 12 | "android_client_info": { 13 | "package_name": "com.example.miniproject" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "751666247977-7pskitqrv6s72ta5q6eptjugqc9ckv1a.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyBAi5X4HWhj0Ul944pvAAuT8HBlej1aghE" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "751666247977-7pskitqrv6s72ta5q6eptjugqc9ckv1a.apps.googleusercontent.com", 32 | "client_type": 3 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | ], 39 | "configuration_version": "1" 40 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/miniproject/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.miniproject 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity 5 | import io.flutter.embedding.engine.FlutterEngine 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { 10 | GeneratedPluginRegistrant.registerWith(flutterEngine); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.3' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/Student.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/assets/Student.png -------------------------------------------------------------------------------- /assets/Teacher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/assets/Teacher.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXCopyFilesBuildPhase section */ 23 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 24 | isa = PBXCopyFilesBuildPhase; 25 | buildActionMask = 2147483647; 26 | dstPath = ""; 27 | dstSubfolderSpec = 10; 28 | files = ( 29 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 30 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 31 | ); 32 | name = "Embed Frameworks"; 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXCopyFilesBuildPhase section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 39 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 40 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 41 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 42 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 43 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 47 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 48 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 61 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 9740EEB11CF90186004384FC /* Flutter */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3B80C3931E831B6300D905FE /* App.framework */, 72 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 73 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 74 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 75 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 76 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 77 | ); 78 | name = Flutter; 79 | sourceTree = ""; 80 | }; 81 | 97C146E51CF9000F007C117D = { 82 | isa = PBXGroup; 83 | children = ( 84 | 9740EEB11CF90186004384FC /* Flutter */, 85 | 97C146F01CF9000F007C117D /* Runner */, 86 | 97C146EF1CF9000F007C117D /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 97C146EF1CF9000F007C117D /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 97C146EE1CF9000F007C117D /* Runner.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 97C146F01CF9000F007C117D /* Runner */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 102 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 103 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 104 | 97C147021CF9000F007C117D /* Info.plist */, 105 | 97C146F11CF9000F007C117D /* Supporting Files */, 106 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 107 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 108 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 109 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 110 | ); 111 | path = Runner; 112 | sourceTree = ""; 113 | }; 114 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 97C146ED1CF9000F007C117D /* Runner */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 127 | buildPhases = ( 128 | 9740EEB61CF901F6004384FC /* Run Script */, 129 | 97C146EA1CF9000F007C117D /* Sources */, 130 | 97C146EB1CF9000F007C117D /* Frameworks */, 131 | 97C146EC1CF9000F007C117D /* Resources */, 132 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 133 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = Runner; 140 | productName = Runner; 141 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 142 | productType = "com.apple.product-type.application"; 143 | }; 144 | /* End PBXNativeTarget section */ 145 | 146 | /* Begin PBXProject section */ 147 | 97C146E61CF9000F007C117D /* Project object */ = { 148 | isa = PBXProject; 149 | attributes = { 150 | LastUpgradeCheck = 1020; 151 | ORGANIZATIONNAME = "The Chromium Authors"; 152 | TargetAttributes = { 153 | 97C146ED1CF9000F007C117D = { 154 | CreatedOnToolsVersion = 7.3.1; 155 | LastSwiftMigration = 1100; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = en; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | Base, 166 | ); 167 | mainGroup = 97C146E51CF9000F007C117D; 168 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 169 | projectDirPath = ""; 170 | projectRoot = ""; 171 | targets = ( 172 | 97C146ED1CF9000F007C117D /* Runner */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | 97C146EC1CF9000F007C117D /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 183 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 184 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 185 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXShellScriptBuildPhase section */ 192 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 193 | isa = PBXShellScriptBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | inputPaths = ( 198 | ); 199 | name = "Thin Binary"; 200 | outputPaths = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 205 | }; 206 | 9740EEB61CF901F6004384FC /* Run Script */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | name = "Run Script"; 214 | outputPaths = ( 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | shellPath = /bin/sh; 218 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 219 | }; 220 | /* End PBXShellScriptBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | 97C146EA1CF9000F007C117D /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 228 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXVariantGroup section */ 235 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | 97C146FB1CF9000F007C117D /* Base */, 239 | ); 240 | name = Main.storyboard; 241 | sourceTree = ""; 242 | }; 243 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | 97C147001CF9000F007C117D /* Base */, 247 | ); 248 | name = LaunchScreen.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 255 | isa = XCBuildConfiguration; 256 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | CLANG_ANALYZER_NONNULL = YES; 260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 261 | CLANG_CXX_LIBRARY = "libc++"; 262 | CLANG_ENABLE_MODULES = YES; 263 | CLANG_ENABLE_OBJC_ARC = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_NS_ASSERTIONS = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = NO; 298 | SDKROOT = iphoneos; 299 | SUPPORTED_PLATFORMS = iphoneos; 300 | TARGETED_DEVICE_FAMILY = "1,2"; 301 | VALIDATE_PRODUCT = YES; 302 | }; 303 | name = Profile; 304 | }; 305 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 306 | isa = XCBuildConfiguration; 307 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CLANG_ENABLE_MODULES = YES; 311 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 312 | ENABLE_BITCODE = NO; 313 | FRAMEWORK_SEARCH_PATHS = ( 314 | "$(inherited)", 315 | "$(PROJECT_DIR)/Flutter", 316 | ); 317 | INFOPLIST_FILE = Runner/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | LIBRARY_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "$(PROJECT_DIR)/Flutter", 322 | ); 323 | PRODUCT_BUNDLE_IDENTIFIER = com.example.miniproject; 324 | PRODUCT_NAME = "$(TARGET_NAME)"; 325 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 326 | SWIFT_VERSION = 5.0; 327 | VERSIONING_SYSTEM = "apple-generic"; 328 | }; 329 | name = Profile; 330 | }; 331 | 97C147031CF9000F007C117D /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_COMMA = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = dwarf; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | ENABLE_TESTABILITY = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | 97C147041CF9000F007C117D /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_COMMA = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 412 | CLANG_WARN_STRICT_PROTOTYPES = YES; 413 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 414 | CLANG_WARN_UNREACHABLE_CODE = YES; 415 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 417 | COPY_PHASE_STRIP = NO; 418 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 419 | ENABLE_NS_ASSERTIONS = NO; 420 | ENABLE_STRICT_OBJC_MSGSEND = YES; 421 | GCC_C_LANGUAGE_STANDARD = gnu99; 422 | GCC_NO_COMMON_BLOCKS = YES; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 430 | MTL_ENABLE_DEBUG_INFO = NO; 431 | SDKROOT = iphoneos; 432 | SUPPORTED_PLATFORMS = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.example.miniproject; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_VERSION = 5.0; 462 | VERSIONING_SYSTEM = "apple-generic"; 463 | }; 464 | name = Debug; 465 | }; 466 | 97C147071CF9000F007C117D /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CLANG_ENABLE_MODULES = YES; 472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 473 | ENABLE_BITCODE = NO; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | INFOPLIST_FILE = Runner/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 480 | LIBRARY_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | PRODUCT_BUNDLE_IDENTIFIER = com.example.miniproject; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 487 | SWIFT_VERSION = 5.0; 488 | VERSIONING_SYSTEM = "apple-generic"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147031CF9000F007C117D /* Debug */, 499 | 97C147041CF9000F007C117D /* Release */, 500 | 249021D3217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 97C147061CF9000F007C117D /* Debug */, 509 | 97C147071CF9000F007C117D /* Release */, 510 | 249021D4217E4FDB00AE95B9 /* Profile */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushad511/QR-Code-Based-Attendance-Management-System/08d20a17677249abeb782e9980bcb857494cf54a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | miniproject 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:miniproject/pages/register_page.dart'; 3 | 4 | void main() { 5 | runApp(new MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return new MaterialApp( 12 | debugShowCheckedModeBanner: false, 13 | home: Scaffold( 14 | backgroundColor: Colors.grey[200], 15 | appBar: AppBar( 16 | elevation: 0.0, 17 | backgroundColor: Colors.pink, 18 | title: Text( 19 | "Smart Attendance", 20 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), 21 | ), 22 | ), 23 | body: Registration()), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/models/todo.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_database/firebase_database.dart'; 2 | 3 | class Todo { 4 | String key; 5 | String subject; 6 | bool completed; 7 | String userId; 8 | 9 | Todo(this.subject, this.userId, this.completed); 10 | 11 | Todo.fromSnapshot(DataSnapshot snapshot) : 12 | key = snapshot.key, 13 | userId = snapshot.value["userId"], 14 | subject = snapshot.value["subject"], 15 | completed = snapshot.value["completed"]; 16 | 17 | toJson() { 18 | return { 19 | "userId": userId, 20 | "subject": subject, 21 | "completed": completed, 22 | }; 23 | } 24 | } -------------------------------------------------------------------------------- /lib/pages/register_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:miniproject/pages/teacher_root_page.dart'; 3 | import 'package:miniproject/pages/student_root_page.dart'; 4 | import 'package:miniproject/services/authentication.dart'; 5 | 6 | class Registration extends StatefulWidget { 7 | State createState() { 8 | return _RegistrationState(); 9 | } 10 | } 11 | 12 | class _RegistrationState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return ListView(padding: const EdgeInsets.all(2), children: [ 16 | GestureDetector( 17 | onTap: () { 18 | Navigator.push( 19 | context, 20 | MaterialPageRoute( 21 | builder: (context) => new TeacherRootPage( 22 | auth: new Auth(), 23 | )), 24 | ); 25 | }, 26 | child: Padding( 27 | padding: const EdgeInsets.all(80.0), 28 | child: Container( 29 | height: 150, 30 | width: 100, 31 | decoration: BoxDecoration( 32 | shape: BoxShape.circle, 33 | color: Colors.orange, 34 | ), 35 | margin: EdgeInsets.all(10.0), 36 | child: const Center( 37 | child: Text(' Login as \nTEACHER', 38 | style: TextStyle( 39 | color: Colors.white, 40 | fontWeight: FontWeight.bold, 41 | fontSize: 18.0, 42 | ))), 43 | ), 44 | ), 45 | ), 46 | GestureDetector( 47 | onTap: () { 48 | Navigator.push( 49 | context, 50 | MaterialPageRoute( 51 | builder: (context) => new StudentRootPage( 52 | auth: new Auth(), 53 | )), 54 | ); 55 | }, 56 | child: Container( 57 | height: 150, 58 | width: 100, 59 | decoration: BoxDecoration( 60 | shape: BoxShape.circle, 61 | color: Colors.purple, 62 | ), 63 | margin: EdgeInsets.all(10.0), 64 | child: const Center( 65 | child: Text(' Login as \nSTUDENT', 66 | style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0,color: Colors.white)), 67 | ), 68 | ), 69 | ), 70 | ]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/pages/student_home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | import "package:cloud_firestore/cloud_firestore.dart"; 4 | import 'package:encrypt/encrypt.dart' as ency; 5 | 6 | 7 | import 'package:miniproject/services/authentication.dart'; 8 | 9 | import 'package:qrscan/qrscan.dart' as scanner; 10 | 11 | class StudentHomePage extends StatefulWidget { 12 | StudentHomePage({Key key, this.auth, this.userId, this.logoutCallback}) 13 | : super(key: key); 14 | 15 | final BaseAuth auth; 16 | final VoidCallback logoutCallback; 17 | final String userId; 18 | 19 | @override 20 | State createState() => new _StudentHomePageState(); 21 | } 22 | 23 | class _StudentHomePageState extends State { 24 | //final FirebaseDatabase _database = FirebaseDatabase.instance; 25 | final GlobalKey formKey = GlobalKey(); 26 | String barcode = ""; 27 | String status = ""; 28 | 29 | //final _textEditingController = TextEditingController(); 30 | 31 | //bool _isEmailVerified = false; 32 | 33 | 34 | 35 | 36 | 37 | @override 38 | void initState() { 39 | super.initState(); 40 | 41 | 42 | //_checkEmailVerification(); 43 | } 44 | 45 | 46 | 47 | signOut() async { 48 | try { 49 | await widget.auth.signOut(); 50 | widget.logoutCallback(); 51 | } catch (e) { 52 | print(e); 53 | } 54 | } 55 | 56 | 57 | 58 | @override 59 | Widget build(BuildContext context) { 60 | return new WillPopScope( 61 | onWillPop: () async => false, 62 | child: new Scaffold( 63 | appBar: new AppBar( 64 | title: new Text('Smart Attendance'), 65 | backgroundColor: Colors.deepOrange, 66 | actions: [ 67 | new FlatButton( 68 | child: new Text('Logout', 69 | style: new TextStyle(fontSize: 20.0, color: Colors.white)), 70 | onPressed: signOut) 71 | ], 72 | ), 73 | body: SingleChildScrollView( 74 | child: Column( 75 | crossAxisAlignment: CrossAxisAlignment.center, 76 | children: [ 77 | 78 | Center( 79 | child: Padding( 80 | padding: const EdgeInsets.all(30.0), 81 | child: Container( 82 | padding: EdgeInsets.fromLTRB(2, 2, 2, 2), 83 | width: 400, 84 | height: 60, 85 | alignment: Alignment(100, 20), 86 | decoration: BoxDecoration( 87 | color: Colors.deepOrangeAccent, 88 | shape: BoxShape.rectangle, 89 | //borderRadius: BorderRadius.circular(15), 90 | borderRadius: BorderRadius.only( 91 | bottomRight: Radius.circular(25), 92 | topLeft: Radius.circular(25)), 93 | ), 94 | child: const Center( 95 | child: Text( 96 | 'Hello Student' , 97 | style: TextStyle( 98 | fontWeight: FontWeight.bold, 99 | color: Colors.white, 100 | fontSize: 20), 101 | ), 102 | ), 103 | ), 104 | ), 105 | ), 106 | 107 | 108 | 109 | Container( 110 | margin: new EdgeInsets.only(top: 40, bottom: 40), 111 | width: 320.0, 112 | height: 380.0, 113 | //alignment: Alignment(100, 20), 114 | decoration: BoxDecoration( 115 | //color: Colors.lightBlue[50], 116 | shape: BoxShape.rectangle, 117 | //borderRadius: BorderRadius.circular(25), 118 | borderRadius: BorderRadius.only( 119 | bottomRight: Radius.circular(35), 120 | topLeft: Radius.circular(35)), 121 | ), 122 | child: SingleChildScrollView( 123 | child: Column( 124 | children: [ 125 | GestureDetector( 126 | onTap: () { 127 | qrCodeScan(); 128 | }, 129 | child: Container( 130 | // margin: new EdgeInsets.only(left: 10,right:10,top:10,bottom:30), 131 | padding: EdgeInsets.fromLTRB(2, 2, 2, 2), 132 | width: 200, 133 | margin: new EdgeInsets.only(top: 60, bottom: 10), 134 | height: 80, 135 | alignment: Alignment(50, 50), 136 | decoration: BoxDecoration( 137 | color: Colors.deepOrange, 138 | shape: BoxShape.rectangle, 139 | borderRadius: 140 | BorderRadius.all(Radius.elliptical(20, 30)), 141 | //borderRadius: BorderRadius.circular(15), 142 | ), 143 | child: const Center( 144 | child: Text( 145 | ' Scan QR \n Code', 146 | style: TextStyle( 147 | fontWeight: FontWeight.bold, 148 | color: Colors.white, 149 | fontSize: 20), 150 | ), 151 | ), 152 | ), 153 | ), 154 | SizedBox(height: 200), 155 | new Text(status), 156 | ], 157 | ), 158 | )), 159 | ], 160 | ), 161 | ), 162 | ), 163 | ); 164 | 165 | } 166 | 167 | Future qrCodeScan() async { 168 | String barcode = await scanner.scan(); 169 | final key = ency.Key.fromUtf8('JingalalahuhuJingalalahuhuJingal'); 170 | final iv = ency.IV.fromLength(16); 171 | final encrypter = ency.Encrypter(ency.AES(key)); 172 | final decryptedQR = 173 | encrypter.decrypt(ency.Encrypted.from64(barcode), iv: iv); 174 | print('BARCODE' + decryptedQR); 175 | setState(() => this.barcode = decryptedQR); 176 | var a = updateDatabase(); 177 | } 178 | 179 | Future updateDatabase() async { 180 | final firestoreInstance = Firestore.instance; 181 | var docs = Firestore.instance.document('Users/$this.userId'); 182 | var qrDetails = barcode.split('/'); 183 | var classname = qrDetails[0]; 184 | var dates = qrDetails[1].split('.'); 185 | var day = dates[0]; 186 | var date = dates[1] + '.' + dates[2]; 187 | var check = qrDetails[2]; 188 | var secretCode = qrDetails[3]; 189 | var updatedCount = 0; 190 | var updatedCodes = []; 191 | var codeExists = 0; 192 | var teacherCodeExists = 0; 193 | var exists = 0; 194 | //print(docs); 195 | var teacherUID = qrDetails[4]; 196 | var firebaseUser = await FirebaseAuth.instance.currentUser(); 197 | final CollectionReference monthsRef = Firestore.instance 198 | .collection('users') 199 | .document(firebaseUser.uid) 200 | .collection(classname); 201 | var monthsDocs = await Firestore.instance 202 | .collection("users") 203 | .document(firebaseUser.uid) 204 | .collection(classname) 205 | .getDocuments(); 206 | 207 | var months = monthsDocs.documents; 208 | 209 | for (int i = 0; i < months.length; i++) 210 | if (date == months[i].documentID) { 211 | exists = 1; 212 | break; 213 | } 214 | 215 | if (exists == 0) await monthsRef.document(date).setData({}); 216 | 217 | var data = await Firestore.instance 218 | .collection("users") 219 | .document(firebaseUser.uid) 220 | .collection(classname) 221 | .document(date) 222 | .get(); 223 | 224 | print('TEACHER UID :' + teacherUID); 225 | 226 | var teacherData = await Firestore.instance 227 | .collection("users") 228 | .document(teacherUID) 229 | .collection(classname) 230 | .document(date) 231 | .get(); 232 | 233 | try { 234 | for (int i = 0; i < teacherData[day]['codes'].length; i++) { 235 | print(teacherData[day]['codes'][i]); 236 | if (teacherData[day]['codes'][i] == secretCode) { 237 | teacherCodeExists = 1; 238 | break; 239 | } 240 | } 241 | } catch (e) { 242 | print('Teacher Code exists caught'); 243 | } 244 | 245 | try { 246 | updatedCount = data[day]['count'] + 1; 247 | } catch (e) { 248 | updatedCount = 1; 249 | 250 | } 251 | 252 | try { 253 | for (int i = 0; i < data[day]['codes'].length; i++) { 254 | print(data[day]['codes'][i]); 255 | if (data[day]['codes'][i] == secretCode) { 256 | codeExists = 1; 257 | break; 258 | } 259 | } 260 | } catch (e) { 261 | print('Code exists caught'); 262 | } 263 | print('CODE EXISTS' + codeExists.toString()); 264 | if (int.parse(check) < updatedCount) { 265 | setState(() { 266 | this.status = 'Attendance limit exeeded'; 267 | }); 268 | } else if (codeExists == 1) { 269 | setState(() { 270 | this.status = 'Reuse of code detected'; 271 | }); 272 | } else if (teacherCodeExists == 0) { 273 | setState(() { 274 | this.status = 'Invalid Code,not in database'; 275 | }); 276 | } else { 277 | try { 278 | updatedCodes = data[day]['codes'] + [secretCode]; 279 | } catch (e) { 280 | updatedCodes = [secretCode]; 281 | } 282 | 283 | try { 284 | firestoreInstance 285 | .collection("users") 286 | .document(firebaseUser.uid) 287 | .collection(classname) 288 | .document(date) 289 | .updateData({ 290 | "$day.check": int.parse(check), 291 | "$day.count": updatedCount, 292 | "$day.codes": updatedCodes 293 | }).then((_) { 294 | setState(() { 295 | this.status = 'Update Successful'; 296 | }); 297 | }); 298 | } catch (e) { 299 | setState(() { 300 | this.status = this.status + 'Update Fail'; 301 | }); 302 | print(e.toString()); 303 | } 304 | } 305 | } 306 | } 307 | -------------------------------------------------------------------------------- /lib/pages/student_login.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:miniproject/services/authentication.dart'; 3 | import "package:cloud_firestore/cloud_firestore.dart"; 4 | 5 | class StudentLogin extends StatefulWidget { 6 | StudentLogin({this.auth, this.loginCallback}); 7 | 8 | final BaseAuth auth; 9 | final VoidCallback loginCallback; 10 | 11 | @override 12 | State createState() => new _StudentLoginState(); 13 | } 14 | 15 | class _StudentLoginState extends State { 16 | final _formKey = new GlobalKey(); 17 | 18 | String _email; 19 | String _password; 20 | String _errorMessage; 21 | 22 | bool _isLoading; 23 | 24 | // Check if form is valid before perform login or signup 25 | bool validateAndSave() { 26 | final form = _formKey.currentState; 27 | if (form.validate()) { 28 | form.save(); 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | // Perform login or signup 35 | void validateAndSubmit() async { 36 | setState(() { 37 | _errorMessage = ""; 38 | _isLoading = true; 39 | }); 40 | if (validateAndSave()) { 41 | String userId = ""; 42 | try { 43 | userId = await widget.auth.signIn(_email, _password); 44 | var result = 45 | await Firestore.instance.collection('users').document(userId).get(); 46 | print(result['role']); 47 | if (result['role'] == "Teacher") 48 | throw Exception("Only Students can login"); 49 | print('Signed in: $userId'); 50 | setState(() { 51 | _isLoading = false; 52 | }); 53 | 54 | if (userId.length > 0 && userId != null) { 55 | widget.loginCallback(); 56 | } 57 | } catch (e) { 58 | 59 | print('Error: $e'); 60 | setState(() { 61 | _isLoading = false; 62 | _errorMessage = e.message; 63 | _formKey.currentState.reset(); 64 | }); 65 | } 66 | } 67 | } 68 | 69 | @override 70 | void initState() { 71 | _errorMessage = ""; 72 | _isLoading = false; 73 | super.initState(); 74 | } 75 | 76 | void resetForm() { 77 | _formKey.currentState.reset(); 78 | _errorMessage = ""; 79 | } 80 | 81 | @override 82 | Widget build(BuildContext context) { 83 | return new Scaffold( 84 | appBar: new AppBar( 85 | backgroundColor: Colors.red, 86 | title: new Text('Login Here', 87 | style: TextStyle( 88 | fontSize: 20, 89 | fontWeight: FontWeight.bold, 90 | color: Colors.white)), 91 | ), 92 | body: Stack( 93 | children: [ 94 | _showForm(), 95 | _showCircularProgress(), 96 | ], 97 | )); 98 | } 99 | 100 | Widget _showCircularProgress() { 101 | if (_isLoading) { 102 | return Center(child: CircularProgressIndicator()); 103 | } 104 | return Container( 105 | height: 0.0, 106 | width: 0.0, 107 | ); 108 | } 109 | 110 | Widget _showForm() { 111 | return new Container( 112 | padding: EdgeInsets.all(16.0), 113 | child: new Form( 114 | key: _formKey, 115 | child: new ListView( 116 | shrinkWrap: true, 117 | children: [ 118 | showLogo(), 119 | showEmailInput(), 120 | showPasswordInput(), 121 | showPrimaryButton(), 122 | showErrorMessage(), 123 | ], 124 | ), 125 | )); 126 | } 127 | 128 | Widget showErrorMessage() { 129 | if (_errorMessage.length > 0 && _errorMessage != null) { 130 | return Padding( 131 | padding: const EdgeInsets.all(10.0), 132 | child: Center( 133 | child: new Text( 134 | _errorMessage, 135 | style: TextStyle( 136 | fontSize: 13.0, 137 | color: Colors.red, 138 | height: 1.0, 139 | fontWeight: FontWeight.w300), 140 | ), 141 | ), 142 | ); 143 | } else { 144 | return new Container( 145 | height: 0.0, 146 | ); 147 | } 148 | } 149 | 150 | Widget showLogo() { 151 | return new Hero( 152 | tag: 'hero', 153 | child: Padding( 154 | padding: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0), 155 | child: CircleAvatar( 156 | backgroundColor: Colors.transparent, 157 | radius: 120.0, 158 | child: Image.asset('assets/Student.png'), 159 | ), 160 | ), 161 | ); 162 | } 163 | 164 | Widget showEmailInput() { 165 | return Padding( 166 | padding: const EdgeInsets.fromLTRB(0.0, 60.0, 0.0, 0.0), 167 | child: new TextFormField( 168 | maxLines: 1, 169 | keyboardType: TextInputType.emailAddress, 170 | autofocus: false, 171 | decoration: new InputDecoration( 172 | hintText: 'Email', 173 | icon: new Icon( 174 | Icons.mail, 175 | color: Colors.grey, 176 | )), 177 | validator: (value) => value.isEmpty ? 'Email can\'t be empty' : null, 178 | onSaved: (value) => _email = value.trim(), 179 | ), 180 | ); 181 | } 182 | 183 | Widget showPasswordInput() { 184 | return Padding( 185 | padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), 186 | child: new TextFormField( 187 | maxLines: 1, 188 | obscureText: true, 189 | autofocus: false, 190 | decoration: new InputDecoration( 191 | hintText: 'Password', 192 | icon: new Icon( 193 | Icons.lock, 194 | color: Colors.grey, 195 | )), 196 | validator: (value) => value.isEmpty ? 'Password can\'t be empty' : null, 197 | onSaved: (value) => _password = value.trim(), 198 | ), 199 | ); 200 | } 201 | 202 | Widget showPrimaryButton() { 203 | return new Padding( 204 | padding: EdgeInsets.fromLTRB(0.0, 45.0, 0.0, 0.0), 205 | child: SizedBox( 206 | height: 40.0, 207 | child: new RaisedButton( 208 | elevation: 5.0, 209 | shape: new RoundedRectangleBorder( 210 | borderRadius: new BorderRadius.circular(30.0)), 211 | color: Colors.blue, 212 | child: new Text('Login', 213 | style: new TextStyle(fontSize: 20.0, color: Colors.white)), 214 | onPressed: validateAndSubmit, 215 | ), 216 | )); 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /lib/pages/student_root_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:miniproject/pages/student_login.dart'; 3 | import 'package:miniproject/services/authentication.dart'; 4 | import 'package:miniproject/pages/student_home_page.dart'; 5 | 6 | enum AuthStatus { 7 | NOT_DETERMINED, 8 | NOT_LOGGED_IN, 9 | LOGGED_IN, 10 | } 11 | 12 | class StudentRootPage extends StatefulWidget { 13 | StudentRootPage({this.auth}); 14 | 15 | final BaseAuth auth; 16 | 17 | @override 18 | State createState() => new _StudentRootPageState(); 19 | } 20 | 21 | class _StudentRootPageState extends State { 22 | AuthStatus authStatus = AuthStatus.NOT_DETERMINED; 23 | String _userId = ""; 24 | 25 | @override 26 | void initState() { 27 | super.initState(); 28 | widget.auth.getCurrentUser().then((user) { 29 | setState(() { 30 | if (user != null) { 31 | _userId = user?.uid; 32 | } 33 | authStatus = 34 | user?.uid == null ? AuthStatus.NOT_LOGGED_IN : AuthStatus.LOGGED_IN; 35 | }); 36 | }); 37 | } 38 | 39 | void loginCallback() { 40 | widget.auth.getCurrentUser().then((user) { 41 | setState(() { 42 | _userId = user.uid.toString(); 43 | }); 44 | }); 45 | setState(() { 46 | authStatus = AuthStatus.LOGGED_IN; 47 | }); 48 | } 49 | 50 | void logoutCallback() { 51 | setState(() { 52 | authStatus = AuthStatus.NOT_LOGGED_IN; 53 | _userId = ""; 54 | }); 55 | } 56 | 57 | Widget buildWaitingScreen() { 58 | return Scaffold( 59 | body: Container( 60 | alignment: Alignment.center, 61 | child: CircularProgressIndicator(), 62 | ), 63 | ); 64 | } 65 | 66 | @override 67 | Widget build(BuildContext context) { 68 | switch (authStatus) { 69 | case AuthStatus.NOT_DETERMINED: 70 | return buildWaitingScreen(); 71 | break; 72 | case AuthStatus.NOT_LOGGED_IN: 73 | return new StudentLogin( 74 | auth: widget.auth, 75 | loginCallback: loginCallback, 76 | ); 77 | break; 78 | case AuthStatus.LOGGED_IN: 79 | if (_userId.length > 0 && _userId != null) { 80 | return new StudentHomePage( 81 | userId: _userId, 82 | auth: widget.auth, 83 | logoutCallback: logoutCallback, 84 | ); 85 | } else 86 | return buildWaitingScreen(); 87 | break; 88 | default: 89 | return buildWaitingScreen(); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/pages/teach_home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:miniproject/services/authentication.dart'; 4 | 5 | 6 | /*import 'package:qr_flutter/qr_flutter.dart'; 7 | import 'package:cloud_firestore/cloud_firestore.dart';*/ 8 | 9 | import 'teach_tab1_page.dart'; 10 | import 'teach_tab2_page.dart'; 11 | 12 | class TeacherHomePage extends StatefulWidget { 13 | TeacherHomePage({Key key, this.auth, this.userId, this.logoutCallback}) 14 | : super(key: key); 15 | 16 | final BaseAuth auth; 17 | final VoidCallback logoutCallback; 18 | 19 | final String userId; 20 | 21 | @override 22 | State createState() => new _TeacherHomePageState(); 23 | } 24 | 25 | class _TeacherHomePageState extends State { 26 | //final FirebaseDatabase _database = FirebaseDatabase.instance; 27 | 28 | signOut() async { 29 | try { 30 | await widget.auth.signOut(); 31 | widget.logoutCallback(); 32 | } catch (e) { 33 | print(e); 34 | } 35 | } 36 | 37 | Widget build(BuildContext context) { 38 | return MaterialApp( 39 | debugShowCheckedModeBanner: false, 40 | home: DefaultTabController( 41 | length: 2, 42 | child: Scaffold( 43 | appBar: AppBar( 44 | bottom: TabBar( 45 | tabs: [ 46 | Tab( 47 | icon: Icon(Icons.arrow_drop_down), 48 | text: "Take Attendance", 49 | ), 50 | Tab(icon: Icon(Icons.book), text: "View Records"), 51 | ], 52 | ), 53 | title: Text( 54 | ' Welcome Teacher', 55 | style: TextStyle( 56 | fontSize: 25, 57 | color: Colors.white, 58 | fontWeight: FontWeight.bold), 59 | ), 60 | backgroundColor: Colors.pinkAccent, 61 | actions: [ 62 | new FlatButton( 63 | child: new Text('Logout', 64 | style: new TextStyle( 65 | fontSize: 20.0, 66 | color: Colors.white, 67 | fontWeight: FontWeight.bold)), 68 | onPressed: signOut), 69 | ], 70 | ), 71 | body: TabBarView( 72 | children: [ 73 | TeacherBasicPage(), 74 | TeacherBasicSecPage(), 75 | ], 76 | ), 77 | ), 78 | ), 79 | ); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/pages/teach_tab1_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:miniproject/services/authentication.dart'; 5 | import 'package:encrypt/encrypt.dart' as ency; 6 | 7 | import 'package:qr_flutter/qr_flutter.dart'; 8 | import 'package:cloud_firestore/cloud_firestore.dart'; 9 | 10 | class TeacherBasicPage extends StatefulWidget { 11 | TeacherBasicPage({Key key, this.auth, this.userId, this.logoutCallback}) 12 | : super(key: key); 13 | 14 | final BaseAuth auth; 15 | final VoidCallback logoutCallback; 16 | 17 | final String userId; 18 | 19 | @override 20 | State createState() => new _TeacherBasicPageState(); 21 | } 22 | 23 | class _TeacherBasicPageState extends State { 24 | //final FirebaseDatabase _database = FirebaseDatabase.instance; 25 | final GlobalKey _formKey1 = GlobalKey(); 26 | 27 | 28 | //bool _isEmailVerified = false; 29 | String classname; 30 | String date; 31 | String secretcode; 32 | String check; 33 | String str; 34 | String userId = ''; 35 | String saveMessage = 'Click save to update or cancel to reject'; 36 | 37 | 38 | 39 | 40 | bool validateAndSave() { 41 | final form = _formKey1.currentState; 42 | if (form.validate()) { 43 | form.save(); 44 | return true; 45 | } 46 | return false; 47 | } 48 | 49 | @override 50 | void initState() { 51 | userId = widget.userId; 52 | super.initState(); 53 | //_checkEmailVerification(); 54 | } 55 | 56 | signOut() async { 57 | try { 58 | await widget.auth.signOut(); 59 | widget.logoutCallback(); 60 | } catch (e) { 61 | print(e); 62 | } 63 | } 64 | 65 | @override 66 | Widget build(BuildContext context) { 67 | return MaterialApp( 68 | debugShowCheckedModeBanner: false, 69 | home: Scaffold( 70 | resizeToAvoidBottomPadding: false, 71 | body: SingleChildScrollView( 72 | /*ConstrainedBox( 73 | constraints: new BoxConstraints( 74 | minHeight: 500, 75 | minWidth: 300, 76 | maxHeight: 700, 77 | maxWidth: 500, 78 | ),*/ 79 | child: Center( 80 | child: Column( 81 | crossAxisAlignment: CrossAxisAlignment.center, 82 | children: [ 83 | SingleChildScrollView( 84 | child: Column( 85 | children: [ 86 | enterDetails(), 87 | formInput(), 88 | GestureDetector( 89 | onTap: () { 90 | showCustomDialogWithImage(context); 91 | }, 92 | child: Container( 93 | margin: EdgeInsets.all(70), 94 | width: 300, 95 | height: 40, 96 | //color:Colors.pink, 97 | decoration: BoxDecoration( 98 | color: Colors.pink, 99 | shape: BoxShape.rectangle, 100 | //borderRadius: BorderRadius.circular(10), 101 | borderRadius: 102 | BorderRadius.all(Radius.circular(25))), 103 | 104 | child: const Center( 105 | child: Text( 106 | 'Generate QR Code', 107 | style: TextStyle( 108 | color: Colors.white, 109 | fontWeight: FontWeight.bold, 110 | fontSize: 16), 111 | ), 112 | ), 113 | ), 114 | ), 115 | ], 116 | ), 117 | ), 118 | ], 119 | ), 120 | ), 121 | )), 122 | ); 123 | } 124 | 125 | Widget formInput() { 126 | return new Form( 127 | key: _formKey1, 128 | child: new ListView( 129 | shrinkWrap: true, 130 | children: [ 131 | subjCodeInput(), 132 | dateInput(), 133 | checkInput(), 134 | codeInput(), 135 | ], 136 | ), 137 | ); 138 | } 139 | 140 | Widget enterDetails() { 141 | return Padding( 142 | padding: const EdgeInsets.all(30.0), 143 | child: Container( 144 | padding: EdgeInsets.fromLTRB(2, 2, 2, 2), 145 | width: 280, 146 | height: 50, 147 | alignment: Alignment(80, 30), 148 | decoration: BoxDecoration( 149 | color: Colors.pink, 150 | shape: BoxShape.rectangle, 151 | //borderRadius: BorderRadius.circular(12), 152 | borderRadius: BorderRadius.only( 153 | bottomRight: Radius.circular(20), topLeft: Radius.circular(20)), 154 | ), 155 | child: const Center( 156 | child: Text( 157 | 'Enter Details', 158 | style: TextStyle( 159 | fontWeight: FontWeight.bold, color: Colors.white, fontSize: 18), 160 | ), 161 | ), 162 | ), 163 | ); 164 | } 165 | 166 | Widget checkInput() { 167 | return Padding( 168 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 5.0), 169 | child: new TextFormField( 170 | 171 | maxLines: 1, 172 | textAlign: TextAlign.center, 173 | decoration: new InputDecoration( 174 | hintText: 'Enter no of classes for the day', 175 | ), 176 | keyboardType: TextInputType.number, 177 | autofocus: false, 178 | validator: (value) => value.isEmpty ? 'Enter classes first' : null, 179 | onSaved: (value) => check = value.trim(), 180 | ), 181 | ); 182 | } 183 | 184 | Widget subjCodeInput() { 185 | return Padding( 186 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 5.0), 187 | child: new TextFormField( 188 | maxLines: 1, 189 | textAlign: TextAlign.center, 190 | decoration: new InputDecoration( 191 | hintText: 'Enter subject code', 192 | ), 193 | keyboardType: TextInputType.text, 194 | autofocus: false, 195 | validator: (value) => value.isEmpty ? 'Enter subject code first' : null, 196 | onSaved: (value) => classname = value.trim(), 197 | ), 198 | ); 199 | } 200 | 201 | Widget dateInput() { 202 | return Padding( 203 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 0.0), 204 | child: new TextFormField( 205 | maxLines: 1, 206 | decoration: new InputDecoration( 207 | hintText: 'Enter date in dd.mm.yy format', 208 | ), 209 | textAlign: TextAlign.center, 210 | keyboardType: TextInputType.datetime, 211 | autofocus: false, 212 | validator: (value) => 213 | value.isEmpty ? 'Enter date in dd.mm.yy format' : null, 214 | onSaved: (value) => date = value.trim(), 215 | ), 216 | ); 217 | } 218 | 219 | Widget codeInput() { 220 | return Padding( 221 | padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), 222 | child: new TextFormField( 223 | maxLines: 1, 224 | decoration: new InputDecoration( 225 | hintText: 'Enter your code', 226 | ), 227 | textAlign: TextAlign.center, 228 | keyboardType: TextInputType.number, 229 | autofocus: false, 230 | validator: (value) => 231 | value.isEmpty || value.contains('.') || value.contains(' ') 232 | ? 'Code cant be empty or have spaces and dots' 233 | : null, 234 | onSaved: (value) => secretcode = value.trim(), 235 | ), 236 | ); 237 | } 238 | 239 | Future showCustomDialogWithImage(BuildContext context) async { 240 | if (validateAndSave()) { 241 | //print(userId); 242 | var firebaseUser = await FirebaseAuth.instance.currentUser(); 243 | String qrData = classname + '/' + date + '/' + check + '/' + secretcode + '/' + firebaseUser.uid; 244 | 245 | final key = ency.Key.fromUtf8('JingalalahuhuJingalalahuhuJingal'); 246 | final iv = ency.IV.fromLength(16); 247 | final encrypter = ency.Encrypter(ency.AES(key)); 248 | final encryptedQR = encrypter.encrypt(qrData, iv: iv); 249 | final decryptedQR = encrypter.decrypt(encryptedQR, iv: iv);//used in student's home page 250 | 251 | print(qrData); 252 | print(encryptedQR.base64); 253 | print(decryptedQR); 254 | print(encryptedQR.base64); 255 | 256 | Dialog dialogWithImage = Dialog( 257 | 258 | 259 | child: Container( 260 | height: 330.0, 261 | width: 300.0, 262 | child: Column( 263 | children: [ 264 | Padding( 265 | padding: const EdgeInsets.only(top: 20.0, bottom: 10.0), 266 | child: Container( 267 | height: 200, 268 | width: 300, 269 | child: Center( 270 | child: QrImage( 271 | data: encryptedQR.base64, 272 | version: QrVersions.auto, 273 | size: 200.0, 274 | ), 275 | ), 276 | ), 277 | ), 278 | Row( 279 | mainAxisAlignment: MainAxisAlignment.center, 280 | children: [ 281 | RaisedButton( 282 | color: Colors.blue, 283 | onPressed: () { 284 | saveTheForm(qrData); 285 | }, 286 | child: Text( 287 | 'Save', 288 | style: TextStyle(fontSize: 18.0, color: Colors.white), 289 | ), 290 | ), 291 | SizedBox( 292 | width: 20, 293 | ), 294 | RaisedButton( 295 | color: Colors.blue, 296 | onPressed: () { 297 | setState(() { 298 | saveMessage = 299 | 'Click save to update or cancel to reject'; 300 | }); 301 | Navigator.of(context, rootNavigator: true).pop(); 302 | }, 303 | child: Text( 304 | 'Cancel', 305 | style: TextStyle(fontSize: 18.0, color: Colors.white), 306 | ), 307 | ), 308 | ], 309 | ), 310 | SizedBox( 311 | height: 10, 312 | ), 313 | Text(saveMessage) 314 | ], 315 | ), 316 | ), 317 | ); 318 | showDialog( 319 | context: context, 320 | builder: (BuildContext context) => dialogWithImage, 321 | barrierDismissible: false 322 | ); 323 | } 324 | } 325 | 326 | void showCustomDialog(BuildContext context, String msg,String msg1) { 327 | AlertDialog dialogWithImage = AlertDialog( 328 | title: Text(msg1), 329 | content: Text(msg), 330 | actions: [ 331 | FlatButton( 332 | onPressed: () { 333 | Navigator.of(context, rootNavigator: true).pop(); 334 | }, 335 | child: 336 | Text('OK', style: TextStyle(fontSize: 18.0, color: Colors.blue)), 337 | ), 338 | ], 339 | elevation: 24.0, 340 | ); 341 | showDialog( 342 | context: context, 343 | builder: (BuildContext context) => dialogWithImage, 344 | barrierDismissible: false); 345 | } 346 | 347 | Future saveTheForm(String qrData) async { 348 | final firestoreInstance = Firestore.instance; 349 | var qrDetails = qrData.split('/'); 350 | var classname = qrDetails[0]; 351 | var dates = qrDetails[1].split('.'); 352 | var day = dates[0]; 353 | var date = dates[1] + '.' + dates[2]; 354 | var secretCode = qrDetails[3]; 355 | var exists = 0; 356 | var codeExists = 0; 357 | var updatedData = []; 358 | //print(docs); 359 | var firebaseUser = await FirebaseAuth.instance.currentUser(); 360 | 361 | final CollectionReference monthsRef = Firestore.instance 362 | .collection('users') 363 | .document(firebaseUser.uid) 364 | .collection(classname); 365 | 366 | var monthsDocs = await Firestore.instance 367 | .collection("users") 368 | .document(firebaseUser.uid) 369 | .collection(classname) 370 | .getDocuments(); 371 | 372 | var months = monthsDocs.documents; 373 | 374 | for (int i = 0; i < months.length; i++) 375 | if (date == months[i].documentID) { 376 | exists = 1; 377 | break; 378 | } 379 | 380 | if (exists == 0) await monthsRef.document(date).setData({}); 381 | 382 | var data = await Firestore.instance 383 | .collection("users") 384 | .document(firebaseUser.uid) 385 | .collection(classname) 386 | .document(date) 387 | .get(); 388 | 389 | //print(data[day]['codes'][0]); 390 | 391 | try { 392 | for (int i = 0; i < data[day]['codes'].length; i++) 393 | if (data[day]['codes'][i] == secretCode) { 394 | codeExists = 1; 395 | break; 396 | } 397 | } catch (e) { 398 | print("Caught"); 399 | } 400 | 401 | print(codeExists); 402 | if (codeExists == 1) { 403 | Navigator.of(context, rootNavigator: true).pop(); 404 | showCustomDialog( 405 | context, 'Secret code already exists.Please enter a new one','Oops'); 406 | } else { 407 | try { 408 | updatedData = data[day]['codes'] + [secretCode]; 409 | } catch (e) { 410 | updatedData = [secretCode]; 411 | } 412 | 413 | try { 414 | firestoreInstance 415 | .collection("users") 416 | .document(firebaseUser.uid) 417 | .collection(classname) 418 | .document(date) 419 | .updateData({ 420 | "$day.codes": updatedData, 421 | }); 422 | // Navigator.of(context, rootNavigator: true).pop(); 423 | showCustomDialog(context, 'QR Saved and ready to be scanned','Success'); 424 | } catch (e) { 425 | showCustomDialog(context, 'Update Failed,Please try again','Error'); 426 | print(e.toString()); 427 | } 428 | } 429 | } 430 | } 431 | -------------------------------------------------------------------------------- /lib/pages/teach_tab2_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:cloud_firestore/cloud_firestore.dart'; 5 | import 'package:miniproject/services/authentication.dart'; 6 | 7 | class TeacherBasicSecPage extends StatefulWidget { 8 | TeacherBasicSecPage({Key key, this.auth, this.userId, this.logoutCallback}) 9 | : super(key: key); 10 | 11 | final BaseAuth auth; 12 | final VoidCallback logoutCallback; 13 | 14 | final String userId; 15 | 16 | @override 17 | State createState() => new _TeacherBasicSecPageState(); 18 | } 19 | 20 | class _TeacherBasicSecPageState extends State { 21 | //final FirebaseDatabase _database = FirebaseDatabase.instance; 22 | final GlobalKey _formKey2 = GlobalKey(); 23 | 24 | //final _textEditingController = TextEditingController(); 25 | //bool _isEmailVerified = false; 26 | String subject; 27 | String month; 28 | String year; 29 | String str; 30 | String userId = ''; 31 | int shows = 0; 32 | 33 | bool validateAndSave() { 34 | final form = _formKey2.currentState; 35 | if (form.validate()) { 36 | form.save(); 37 | return true; 38 | } 39 | return false; 40 | } 41 | 42 | @override 43 | void initState() { 44 | userId = widget.userId; 45 | super.initState(); 46 | //_checkEmailVerification(); 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | if (shows == 0) { 52 | return showEntryPage(); 53 | } else { 54 | return showDataPage(); 55 | } 56 | } 57 | 58 | Widget showEntryPage() { 59 | return MaterialApp( 60 | debugShowCheckedModeBanner: false, 61 | home: Scaffold( 62 | resizeToAvoidBottomPadding: false, 63 | body: SingleChildScrollView( 64 | child: Center( 65 | child: Column( 66 | crossAxisAlignment: CrossAxisAlignment.center, 67 | children: [ 68 | SingleChildScrollView( 69 | child: Column( 70 | children: [ 71 | enterDetails(), 72 | formInput(), 73 | GestureDetector( 74 | onTap: () { 75 | if (validateAndSave()) { 76 | setState(() { 77 | shows = 1; 78 | }); 79 | //showDataPage(); 80 | } 81 | }, 82 | child: Container( 83 | margin: EdgeInsets.all(70), 84 | width: 300, 85 | height: 40, 86 | //color:Colors.pink, 87 | decoration: BoxDecoration( 88 | color: Colors.pink, 89 | shape: BoxShape.rectangle, 90 | //borderRadius: BorderRadius.circular(10), 91 | borderRadius: 92 | BorderRadius.all(Radius.circular(25))), 93 | child: const Center( 94 | child: Text( 95 | 'View', 96 | style: TextStyle( 97 | color: Colors.white, 98 | fontWeight: FontWeight.bold, 99 | fontSize: 16), 100 | ), 101 | ), 102 | ), 103 | ), 104 | ], 105 | ), 106 | ), 107 | ], 108 | ), 109 | ), 110 | )), 111 | ); 112 | } 113 | 114 | Widget formInput() { 115 | return SingleChildScrollView( 116 | child: new Container( 117 | //padding: EdgeInsets.all(2.0), 118 | child: new Form( 119 | key: _formKey2, 120 | child: new ListView( 121 | shrinkWrap: true, 122 | children: [ 123 | subjCodeInput(), 124 | dateInput(), 125 | yearInput(), 126 | ], 127 | ), 128 | )), 129 | ); 130 | } 131 | 132 | Widget enterDetails() { 133 | return Padding( 134 | padding: const EdgeInsets.all(30.0), 135 | child: Container( 136 | padding: EdgeInsets.fromLTRB(2, 2, 2, 2), 137 | width: 280, 138 | height: 50, 139 | alignment: Alignment(80, 30), 140 | decoration: BoxDecoration( 141 | color: Colors.pink, 142 | shape: BoxShape.rectangle, 143 | //borderRadius: BorderRadius.circular(12), 144 | borderRadius: BorderRadius.only( 145 | bottomRight: Radius.circular(20), topLeft: Radius.circular(20)), 146 | ), 147 | child: const Center( 148 | child: Text( 149 | 'Enter Details', 150 | style: TextStyle( 151 | fontWeight: FontWeight.bold, color: Colors.white, fontSize: 18), 152 | ), 153 | ), 154 | ), 155 | ); 156 | } 157 | 158 | Widget subjCodeInput() { 159 | return Padding( 160 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 5.0), 161 | child: new TextFormField( 162 | maxLines: 1, 163 | textAlign: TextAlign.center, 164 | decoration: new InputDecoration( 165 | hintText: 'Enter Subject', 166 | ), 167 | keyboardType: TextInputType.text, 168 | autofocus: false, 169 | validator: (value) => value.isEmpty ? 'Enter Subject first' : null, 170 | onSaved: (value) => subject = value.trim(), 171 | ), 172 | ); 173 | } 174 | 175 | Widget dateInput() { 176 | return Padding( 177 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 0.0), 178 | child: new TextFormField( 179 | maxLines: 1, 180 | decoration: new InputDecoration( 181 | hintText: 'Enter Month', 182 | ), 183 | textAlign: TextAlign.center, 184 | keyboardType: TextInputType.datetime, 185 | autofocus: false, 186 | validator: (value) => value.isEmpty ? 'Enter Month first' : null, 187 | onSaved: (value) => month = value.trim(), 188 | ), 189 | ); 190 | } 191 | 192 | Widget yearInput() { 193 | return Padding( 194 | padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), 195 | child: new TextFormField( 196 | maxLines: 1, 197 | decoration: new InputDecoration( 198 | hintText: 'Enter Year', 199 | ), 200 | textAlign: TextAlign.center, 201 | keyboardType: TextInputType.number, 202 | autofocus: false, 203 | validator: (value) => value.isEmpty ? 'Enter Year first' : null, 204 | onSaved: (value) => year = value.trim(), 205 | ), 206 | ); 207 | } 208 | 209 | Widget showDataPage() { 210 | //Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => TeachDetails())); 211 | return Scaffold( 212 | body:Container( 213 | child: FutureBuilder( 214 | future: getData(), 215 | 216 | builder: (BuildContext context,AsyncSnapshot snapshot){ 217 | 218 | if(snapshot.data == null) 219 | { 220 | return Scaffold( 221 | body: Column( 222 | mainAxisAlignment: MainAxisAlignment.center, 223 | children: [ 224 | Container( 225 | alignment: Alignment.center, 226 | child: CircularProgressIndicator(), 227 | ), 228 | SizedBox(height: 10), 229 | Text('Loading'), 230 | ], 231 | ), 232 | ); 233 | //return Center(child: Container(child: Text('Loading Data',style: TextStyle(fontSize: 30,fontWeight: FontWeight.bold),),)); 234 | } 235 | 236 | return SingleChildScrollView( 237 | child: Column( 238 | children: [ 239 | DataTable( 240 | sortColumnIndex: 0, 241 | sortAscending: true, 242 | columns: [ 243 | DataColumn(label: Text('Name')), 244 | DataColumn(label: Text('Attended'),numeric: true) 245 | ], 246 | rows:snapshot.data.entries.map((entry){ 247 | return DataRow(cells:[ 248 | DataCell(Text(entry.key)), 249 | DataCell(Text(entry.value.toString())), 250 | ]); 251 | }).toList()), 252 | Center( 253 | child: Container( 254 | margin: EdgeInsets.fromLTRB(0, 20, 0,0), 255 | child: RaisedButton( 256 | color: Colors.indigo, 257 | textColor: Colors.white, 258 | onPressed: () { 259 | setState(() { 260 | shows = 0; 261 | }); 262 | }, 263 | child: Text('Return')), 264 | ), 265 | ), 266 | ], 267 | ), 268 | ); 269 | } 270 | ), 271 | ), 272 | ); 273 | } 274 | 275 | 276 | Future getData() async { 277 | var attendance = new Map(); 278 | int subCount = 0; 279 | String queryMonth = month.toString() + '.' + year.toString(); 280 | var j1; 281 | var users = await Firestore.instance.collection('users').getDocuments(); 282 | var idList = users.documents; 283 | for (int i = 0; i < idList.length; i++) { 284 | if (idList[i].data['role'] == 'student') { 285 | var y = await Firestore.instance.collection('users').document(idList[i].documentID).collection(subject).document(queryMonth).get(); 286 | for (int j = 1; j <= 30; j++) { 287 | if (j<10) j1 = j.toString().padLeft(2, '0'); else j1 = j.toString(); 288 | try { 289 | subCount+=y.data[j1]['count']; 290 | } 291 | catch(e){ 292 | continue; 293 | } 294 | } 295 | attendance[idList[i].data['Name']] = subCount; 296 | subCount = 0; 297 | } 298 | } 299 | //print(attendance); 300 | return attendance; 301 | } 302 | } -------------------------------------------------------------------------------- /lib/pages/teacher_login.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:miniproject/services/authentication.dart'; 3 | import "package:cloud_firestore/cloud_firestore.dart"; 4 | 5 | class TeacherLogin extends StatefulWidget { 6 | TeacherLogin({this.auth, this.loginCallback}); 7 | 8 | final BaseAuth auth; 9 | final VoidCallback loginCallback; 10 | 11 | @override 12 | State createState() => new _TeacherLoginState(); 13 | } 14 | 15 | class _TeacherLoginState extends State { 16 | final _formKey = new GlobalKey(); 17 | 18 | String _email; 19 | String _password; 20 | String _errorMessage; 21 | 22 | bool _isLoading; 23 | 24 | // Check if form is valid before perform login or signup 25 | bool validateAndSave() { 26 | final form = _formKey.currentState; 27 | if (form.validate()) { 28 | form.save(); 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | // Perform login or signup 35 | void validateAndSubmit() async { 36 | setState(() { 37 | _errorMessage = ""; 38 | _isLoading = true; 39 | }); 40 | if (validateAndSave()) { 41 | String userId = ""; 42 | try { 43 | userId = await widget.auth.signIn(_email, _password); 44 | var result = 45 | await Firestore.instance.collection('users').document(userId).get(); 46 | print(result['role']); 47 | if (result['role'] == "student") 48 | throw Exception("Only Teachers can login"); 49 | print('Signed in: $userId'); 50 | setState(() { 51 | _isLoading = false; 52 | }); 53 | 54 | if (userId.length > 0 && userId != null) { 55 | widget.loginCallback(); 56 | } 57 | } catch (e) { 58 | print('Error: $e'); 59 | setState(() { 60 | _isLoading = false; 61 | _errorMessage = e.message; 62 | _formKey.currentState.reset(); 63 | }); 64 | } 65 | } 66 | } 67 | 68 | @override 69 | void initState() { 70 | _errorMessage = ""; 71 | _isLoading = false; 72 | super.initState(); 73 | } 74 | 75 | void resetForm() { 76 | _formKey.currentState.reset(); 77 | _errorMessage = ""; 78 | } 79 | 80 | @override 81 | Widget build(BuildContext context) { 82 | return new Scaffold( 83 | appBar: new AppBar( 84 | backgroundColor: Colors.red, 85 | title: new Text( 86 | 'Login Here', 87 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold,color: Colors.white), 88 | ), 89 | ), 90 | body: Stack( 91 | children: [ 92 | _showForm(), 93 | _showCircularProgress(), 94 | ], 95 | )); 96 | } 97 | 98 | Widget _showCircularProgress() { 99 | if (_isLoading) { 100 | return Center(child: CircularProgressIndicator()); 101 | } 102 | return Container( 103 | height: 0.0, 104 | width: 0.0, 105 | ); 106 | } 107 | 108 | Widget _showForm() { 109 | return new Container( 110 | padding: EdgeInsets.all(16.0), 111 | child: new Form( 112 | key: _formKey, 113 | child: new ListView( 114 | shrinkWrap: true, 115 | children: [ 116 | showLogo(), 117 | showEmailInput(), 118 | showPasswordInput(), 119 | showPrimaryButton(), 120 | showErrorMessage(), 121 | ], 122 | ), 123 | )); 124 | } 125 | 126 | Widget showErrorMessage() { 127 | if (_errorMessage.length > 0 && _errorMessage != null) { 128 | return Padding( 129 | padding: const EdgeInsets.all(10.0), 130 | child: Center( 131 | child: new Text( 132 | _errorMessage, 133 | style: TextStyle( 134 | fontSize: 13.0, 135 | color: Colors.red, 136 | height: 1.0, 137 | fontWeight: FontWeight.w300), 138 | ), 139 | ), 140 | ); 141 | } else { 142 | return new Container( 143 | height: 0.0, 144 | ); 145 | } 146 | } 147 | 148 | Widget showLogo() { 149 | return new Hero( 150 | tag: 'hero', 151 | child: Padding( 152 | padding: EdgeInsets.fromLTRB(0.0, 25.0, 0.0, 0.0), 153 | child: CircleAvatar( 154 | backgroundColor: Colors.transparent, 155 | radius: 100.0, 156 | child: Image.asset('assets/Teacher.png'), 157 | ), 158 | ), 159 | ); 160 | } 161 | 162 | Widget showEmailInput() { 163 | return Padding( 164 | padding: const EdgeInsets.fromLTRB(0.0, 80.0, 0.0, 0.0), 165 | child: new TextFormField( 166 | maxLines: 1, 167 | keyboardType: TextInputType.emailAddress, 168 | autofocus: false, 169 | decoration: new InputDecoration( 170 | hintText: 'Email', 171 | icon: new Icon( 172 | Icons.mail, 173 | color: Colors.grey, 174 | )), 175 | validator: (value) => value.isEmpty ? 'Email can\'t be empty' : null, 176 | onSaved: (value) => _email = value.trim(), 177 | ), 178 | ); 179 | } 180 | 181 | Widget showPasswordInput() { 182 | return Padding( 183 | padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0), 184 | child: new TextFormField( 185 | maxLines: 1, 186 | obscureText: true, 187 | autofocus: false, 188 | decoration: new InputDecoration( 189 | hintText: 'Password', 190 | icon: new Icon( 191 | Icons.lock, 192 | color: Colors.grey, 193 | )), 194 | validator: (value) => value.isEmpty ? 'Password can\'t be empty' : null, 195 | onSaved: (value) => _password = value.trim(), 196 | ), 197 | ); 198 | } 199 | 200 | Widget showPrimaryButton() { 201 | return new Padding( 202 | padding: EdgeInsets.fromLTRB(0.0, 45.0, 0.0, 0.0), 203 | child: SizedBox( 204 | height: 40.0, 205 | child: new RaisedButton( 206 | elevation: 5.0, 207 | shape: new RoundedRectangleBorder( 208 | borderRadius: new BorderRadius.circular(30.0)), 209 | color: Colors.blueAccent, 210 | child: new Text('Login', 211 | style: new TextStyle(fontSize: 20.0, color: Colors.white)), 212 | onPressed: validateAndSubmit, 213 | ), 214 | )); 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /lib/pages/teacher_root_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:miniproject/pages/teacher_login.dart'; 3 | import 'package:miniproject/services/authentication.dart'; 4 | import 'package:miniproject/pages/teach_home_page.dart'; 5 | 6 | enum AuthStatus { 7 | NOT_DETERMINED, 8 | NOT_LOGGED_IN, 9 | LOGGED_IN, 10 | } 11 | 12 | class TeacherRootPage extends StatefulWidget { 13 | TeacherRootPage({this.auth}); 14 | 15 | final BaseAuth auth; 16 | 17 | @override 18 | State createState() => new _TeacherRootPageState(); 19 | } 20 | 21 | class _TeacherRootPageState extends State { 22 | AuthStatus authStatus = AuthStatus.NOT_DETERMINED; 23 | String _userId = ""; 24 | 25 | @override 26 | void initState() { 27 | super.initState(); 28 | widget.auth.getCurrentUser().then((user) { 29 | setState(() { 30 | if (user != null) { 31 | _userId = user?.uid; 32 | } 33 | authStatus = 34 | user?.uid == null ? AuthStatus.NOT_LOGGED_IN : AuthStatus.LOGGED_IN; 35 | }); 36 | }); 37 | } 38 | 39 | void loginCallback() { 40 | widget.auth.getCurrentUser().then((user) { 41 | setState(() { 42 | _userId = user.uid.toString(); 43 | }); 44 | }); 45 | setState(() { 46 | authStatus = AuthStatus.LOGGED_IN; 47 | }); 48 | } 49 | 50 | void logoutCallback() { 51 | setState(() { 52 | authStatus = AuthStatus.NOT_LOGGED_IN; 53 | _userId = ""; 54 | }); 55 | } 56 | 57 | Widget buildWaitingScreen() { 58 | return Scaffold( 59 | body: Container( 60 | alignment: Alignment.center, 61 | child: CircularProgressIndicator(), 62 | ), 63 | ); 64 | } 65 | 66 | @override 67 | Widget build(BuildContext context) { 68 | switch (authStatus) { 69 | case AuthStatus.NOT_DETERMINED: 70 | return buildWaitingScreen(); 71 | break; 72 | case AuthStatus.NOT_LOGGED_IN: 73 | return new TeacherLogin( 74 | auth: widget.auth, 75 | loginCallback: loginCallback, 76 | ); 77 | break; 78 | case AuthStatus.LOGGED_IN: 79 | if (_userId.length > 0 && _userId != null) { 80 | return new TeacherHomePage( 81 | userId: _userId, 82 | auth: widget.auth, 83 | logoutCallback: logoutCallback, 84 | ); 85 | } else 86 | return buildWaitingScreen(); 87 | break; 88 | default: 89 | return buildWaitingScreen(); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/services/authentication.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | 4 | abstract class BaseAuth { 5 | Future signIn(String email, String password); 6 | 7 | Future signUp(String email, String password); //sign up method nu 8 | 9 | Future getCurrentUser(); 10 | 11 | Future sendEmailVerification();//nu 12 | 13 | Future signOut(); 14 | 15 | Future isEmailVerified(); //nu 16 | } 17 | 18 | class Auth implements BaseAuth { 19 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance; 20 | 21 | Future signIn(String email, String password) async { 22 | AuthResult result = await _firebaseAuth.signInWithEmailAndPassword( 23 | email: email, password: password); 24 | FirebaseUser user = result.user; 25 | return user.uid; 26 | } 27 | 28 | Future signUp(String email, String password) async { 29 | AuthResult result = await _firebaseAuth.createUserWithEmailAndPassword( 30 | email: email, password: password); 31 | FirebaseUser user = result.user; 32 | return user.uid; 33 | } 34 | 35 | Future getCurrentUser() async { 36 | FirebaseUser user = await _firebaseAuth.currentUser(); 37 | return user; 38 | } 39 | 40 | Future signOut() async { 41 | return _firebaseAuth.signOut(); 42 | } 43 | 44 | Future sendEmailVerification() async { 45 | FirebaseUser user = await _firebaseAuth.currentUser(); 46 | user.sendEmailVerification(); 47 | } 48 | 49 | Future isEmailVerified() async { 50 | FirebaseUser user = await _firebaseAuth.currentUser(); 51 | return user.isEmailVerified; 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | asn1lib: 19 | dependency: transitive 20 | description: 21 | name: asn1lib 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "0.5.15" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.4.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.5" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.2" 46 | clock: 47 | dependency: transitive 48 | description: 49 | name: clock 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.1" 53 | cloud_firestore: 54 | dependency: "direct main" 55 | description: 56 | name: cloud_firestore 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.13.4+2" 60 | cloud_firestore_platform_interface: 61 | dependency: transitive 62 | description: 63 | name: cloud_firestore_platform_interface 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.1.0" 67 | cloud_firestore_web: 68 | dependency: transitive 69 | description: 70 | name: cloud_firestore_web 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.1.1+2" 74 | collection: 75 | dependency: transitive 76 | description: 77 | name: collection 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.14.11" 81 | convert: 82 | dependency: transitive 83 | description: 84 | name: convert 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "2.1.1" 88 | crypto: 89 | dependency: transitive 90 | description: 91 | name: crypto 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "2.1.3" 95 | cupertino_icons: 96 | dependency: "direct main" 97 | description: 98 | name: cupertino_icons 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "0.1.3" 102 | encrypt: 103 | dependency: "direct main" 104 | description: 105 | name: encrypt 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "4.0.0" 109 | firebase: 110 | dependency: transitive 111 | description: 112 | name: firebase 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "7.3.0" 116 | firebase_auth: 117 | dependency: "direct main" 118 | description: 119 | name: firebase_auth 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "0.14.0+9" 123 | firebase_core: 124 | dependency: transitive 125 | description: 126 | name: firebase_core 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "0.4.4+3" 130 | firebase_core_platform_interface: 131 | dependency: transitive 132 | description: 133 | name: firebase_core_platform_interface 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "1.0.4" 137 | firebase_core_web: 138 | dependency: transitive 139 | description: 140 | name: firebase_core_web 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "0.1.1+2" 144 | firebase_database: 145 | dependency: "direct main" 146 | description: 147 | name: firebase_database 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "3.1.3" 151 | flutter: 152 | dependency: "direct main" 153 | description: flutter 154 | source: sdk 155 | version: "0.0.0" 156 | flutter_test: 157 | dependency: "direct dev" 158 | description: flutter 159 | source: sdk 160 | version: "0.0.0" 161 | flutter_web_plugins: 162 | dependency: transitive 163 | description: flutter 164 | source: sdk 165 | version: "0.0.0" 166 | http: 167 | dependency: transitive 168 | description: 169 | name: http 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "0.12.0+4" 173 | http_parser: 174 | dependency: transitive 175 | description: 176 | name: http_parser 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "3.1.4" 180 | image: 181 | dependency: transitive 182 | description: 183 | name: image 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "2.1.4" 187 | js: 188 | dependency: transitive 189 | description: 190 | name: js 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "0.6.1+1" 194 | matcher: 195 | dependency: transitive 196 | description: 197 | name: matcher 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.12.6" 201 | meta: 202 | dependency: transitive 203 | description: 204 | name: meta 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.1.8" 208 | path: 209 | dependency: transitive 210 | description: 211 | name: path 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "1.6.4" 215 | pedantic: 216 | dependency: transitive 217 | description: 218 | name: pedantic 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.8.0+1" 222 | petitparser: 223 | dependency: transitive 224 | description: 225 | name: petitparser 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "2.4.0" 229 | plugin_platform_interface: 230 | dependency: transitive 231 | description: 232 | name: plugin_platform_interface 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.0.2" 236 | pointycastle: 237 | dependency: transitive 238 | description: 239 | name: pointycastle 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.0.2" 243 | qr: 244 | dependency: transitive 245 | description: 246 | name: qr 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "1.2.0" 250 | qr_flutter: 251 | dependency: "direct main" 252 | description: 253 | name: qr_flutter 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "3.2.0" 257 | qrscan: 258 | dependency: "direct main" 259 | description: 260 | name: qrscan 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "0.2.17" 264 | quiver: 265 | dependency: transitive 266 | description: 267 | name: quiver 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "2.0.5" 271 | sky_engine: 272 | dependency: transitive 273 | description: flutter 274 | source: sdk 275 | version: "0.0.99" 276 | source_span: 277 | dependency: transitive 278 | description: 279 | name: source_span 280 | url: "https://pub.dartlang.org" 281 | source: hosted 282 | version: "1.5.5" 283 | stack_trace: 284 | dependency: transitive 285 | description: 286 | name: stack_trace 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "1.9.3" 290 | stream_channel: 291 | dependency: transitive 292 | description: 293 | name: stream_channel 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "2.0.0" 297 | string_scanner: 298 | dependency: transitive 299 | description: 300 | name: string_scanner 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "1.0.5" 304 | term_glyph: 305 | dependency: transitive 306 | description: 307 | name: term_glyph 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "1.1.0" 311 | test_api: 312 | dependency: transitive 313 | description: 314 | name: test_api 315 | url: "https://pub.dartlang.org" 316 | source: hosted 317 | version: "0.2.11" 318 | typed_data: 319 | dependency: transitive 320 | description: 321 | name: typed_data 322 | url: "https://pub.dartlang.org" 323 | source: hosted 324 | version: "1.1.6" 325 | vector_math: 326 | dependency: transitive 327 | description: 328 | name: vector_math 329 | url: "https://pub.dartlang.org" 330 | source: hosted 331 | version: "2.0.8" 332 | xml: 333 | dependency: transitive 334 | description: 335 | name: xml 336 | url: "https://pub.dartlang.org" 337 | source: hosted 338 | version: "3.5.0" 339 | sdks: 340 | dart: ">=2.7.0 <3.0.0" 341 | flutter: ">=1.12.13+hotfix.4 <2.0.0" 342 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: miniproject 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | firebase_auth: ^0.14.0+5 21 | firebase_database: ^3.0.7 22 | cloud_firestore: ^0.13.4+2 23 | qr_flutter: ^3.2.0 24 | encrypt: ^4.0.0 25 | flutter: 26 | sdk: flutter 27 | 28 | 29 | # The following adds the Cupertino Icons font to your application. 30 | # Use with the CupertinoIcons class for iOS style icons. 31 | cupertino_icons: ^0.1.2 32 | qrscan: ^0.2.17 33 | 34 | dev_dependencies: 35 | flutter_test: 36 | sdk: flutter 37 | 38 | 39 | # For information on the generic Dart part of this file, see the 40 | # following page: https://dart.dev/tools/pub/pubspec 41 | 42 | # The following section is specific to Flutter. 43 | flutter: 44 | 45 | # The following line ensures that the Material Icons font is 46 | # included with your application, so that you can use the icons in 47 | # the material Icons class. 48 | uses-material-design: true 49 | 50 | # To add assets to your application, add an assets section, like this: 51 | assets: 52 | - assets/Teacher.png 53 | - assets/Student.png 54 | 55 | # - images/a_dot_ham.jpeg 56 | 57 | # An image asset can refer to one or more resolution-specific "variants", see 58 | # https://flutter.dev/assets-and-images/#resolution-aware. 59 | 60 | # For details regarding adding assets from package dependencies, see 61 | # https://flutter.dev/assets-and-images/#from-packages 62 | 63 | # To add custom fonts to your application, add a fonts section here, 64 | # in this "flutter" section. Each entry in this list should have a 65 | # "family" key with the font family name, and a "fonts" key with a 66 | # list giving the asset and other descriptors for the font. For 67 | # example: 68 | # fonts: 69 | # - family: Schyler 70 | # fonts: 71 | # - asset: fonts/Schyler-Regular.ttf 72 | # - asset: fonts/Schyler-Italic.ttf 73 | # style: italic 74 | # - family: Trajan Pro 75 | # fonts: 76 | # - asset: fonts/TrajanPro.ttf 77 | # - asset: fonts/TrajanPro_Bold.ttf 78 | # weight: 700 79 | # 80 | # For details regarding fonts from package dependencies, 81 | # see https://flutter.dev/custom-fonts/#from-packages 82 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:miniproject/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------