├── .flutter-plugins ├── .flutter-plugins-dependencies ├── .gitattributes ├── .metadata ├── .packages ├── Cloud ├── .firebaserc ├── .gitignore ├── firebase.json └── functions │ ├── .eslintrc.json │ ├── .gitignore │ ├── index.js │ ├── package-lock.json │ └── package.json ├── LICENSE.md ├── README.md ├── _config.yml ├── android ├── .gradle │ ├── 5.4.1 │ │ ├── executionHistory │ │ │ ├── executionHistory.bin │ │ │ └── executionHistory.lock │ │ ├── fileChanges │ │ │ └── last-build.bin │ │ ├── fileContent │ │ │ └── fileContent.lock │ │ ├── fileHashes │ │ │ ├── fileHashes.bin │ │ │ ├── fileHashes.lock │ │ │ └── resourceHashesCache.bin │ │ ├── gc.properties │ │ └── javaCompile │ │ │ ├── classAnalysis.bin │ │ │ ├── jarAnalysis.bin │ │ │ ├── javaCompile.lock │ │ │ └── taskHistory.bin │ ├── buildOutputCleanup │ │ ├── buildOutputCleanup.lock │ │ ├── cache.properties │ │ └── outputFiles.bin │ └── vcs-1 │ │ └── gc.properties ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ ├── example │ │ │ │ └── com │ │ │ │ │ └── geo_attendance_system │ │ │ │ │ ├── Application.java │ │ │ │ │ └── MainActivity.java │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── plugins │ │ │ │ └── GeneratedPluginRegistrant.java │ │ └── 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.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle ├── assets ├── back.jpg ├── fonts │ ├── Bitter-Bold.ttf │ ├── Bitter-Regular.ttf │ ├── Poppins-Black.otf │ ├── Poppins-BlackItalic.otf │ ├── Poppins-Bold.otf │ ├── Poppins-BoldItalic.otf │ ├── Poppins-ExtraBold.otf │ ├── Poppins-ExtraBoldItalic.otf │ ├── Poppins-ExtraLight.otf │ ├── Poppins-ExtraLightItalic.otf │ ├── Poppins-Italic.otf │ ├── Poppins-Light.otf │ ├── Poppins-LightItalic.otf │ ├── Poppins-Medium.otf │ ├── Poppins-MediumItalic.otf │ ├── Poppins-Regular.otf │ ├── Poppins-SemiBold.otf │ ├── Poppins-SemiBoldItalic.otf │ ├── Poppins-Thin.otf │ ├── Poppins-ThinItalic.otf │ ├── SIL Open Font License.txt │ └── Sansation-Bold.ttf ├── gif │ ├── close.gif │ ├── loading-gif.gif │ ├── no_entry.gif │ └── tick.gif ├── github │ ├── calendar.jpg │ ├── dashboard.jpg │ ├── drawer.jpg │ ├── landing.jpg │ ├── leave_make.jpg │ ├── leave_status.jpg │ ├── login.jpg │ ├── make_attendance.jpg │ └── mark_attendance.jpg ├── icons │ ├── Logo-splash.png │ ├── attendance_recorder.png │ ├── attendance_summary.png │ ├── icons8-attendance-48.png │ ├── icons8-leave-64.png │ ├── icons8-location-64.png │ ├── icons8-process-100.png │ ├── leave_application.png │ ├── leave_status.png │ └── navigation-drawer.png └── logo │ ├── logo-white.png │ ├── logo.png │ └── profile.jpg ├── geofencing ├── .flutter-plugins ├── .flutter-plugins-dependencies ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── flutter │ │ │ └── plugins │ │ │ └── GeneratedPluginRegistrant.java │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── io │ │ └── flutter │ │ └── plugins │ │ └── geofencing │ │ ├── GeofencingBroadcastReceiver.kt │ │ ├── GeofencingPlugin.kt │ │ ├── GeofencingRebootBroadcastReceiver.kt │ │ ├── GeofencingService.kt │ │ └── IsolateHolderService.kt ├── ios │ ├── .gitignore │ ├── Assets │ │ └── .gitkeep │ ├── Classes │ │ ├── GeofencingPlugin.h │ │ └── GeofencingPlugin.m │ ├── Flutter │ │ └── flutter_export_environment.sh │ └── geofencing.podspec ├── lib │ ├── geofencing.dart │ └── src │ │ ├── callback_dispatcher.dart │ │ ├── geofencing.dart │ │ ├── location.dart │ │ └── platform_settings.dart └── pubspec.yaml ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ ├── Generated.xcconfig │ ├── Release.xcconfig │ └── flutter_export_environment.sh ├── 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 │ ├── GeneratedPluginRegistrant.h │ ├── GeneratedPluginRegistrant.m │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── main.dart └── src │ ├── app.dart │ ├── models │ ├── AttendaceList.dart │ ├── leave.dart │ ├── office.dart │ └── user.dart │ ├── services │ ├── attendance_mark.dart │ ├── authentication.dart │ ├── check_file.dart │ ├── current_date.dart │ ├── fetch_IMEI.dart │ ├── fetch_attendance.dart │ ├── fetch_leaves.dart │ ├── fetch_offices.dart │ ├── fetch_pending_leaves.dart │ ├── fetch_user.dart │ └── geofence.dart │ └── ui │ ├── constants │ ├── attendance_type.dart │ ├── colors.dart │ ├── dashboard_tile_info.dart │ ├── geofence_controls.dart │ ├── leave_type.dart │ └── strings.dart │ ├── pages │ ├── attendance_recorder.dart │ ├── attendance_summary.dart │ ├── choose_office.dart │ ├── dashboard.dart │ ├── homepage.dart │ ├── leave_application.dart │ ├── leave_status.dart │ ├── login.dart │ ├── pending_approval_manager.dart │ ├── profile_page.dart │ └── splash_screen.dart │ └── widgets │ ├── Info_dialog_box.dart │ ├── attendance_Marker_buttons.dart │ ├── dashboard_tile.dart │ ├── form_card.dart │ ├── loader_dialog.dart │ └── socialicons.dart ├── pubspec.lock └── pubspec.yaml /.flutter-plugins: -------------------------------------------------------------------------------- 1 | # This is a generated file; do not edit or check into version control. 2 | device_id=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\device_id-0.2.0\\ 3 | device_info=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\device_info-0.4.1+2\\ 4 | firebase_auth=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\firebase_auth-0.14.0+9\\ 5 | firebase_core=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\firebase_core-0.4.2+1\\ 6 | firebase_database=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\firebase_database-3.1.0\\ 7 | firebase_messaging=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\firebase_messaging-6.0.1\\ 8 | flutter_local_notifications=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\flutter_local_notifications-0.8.4+3\\ 9 | geofencing=F:\\HR-Management-and-Geo-Attendance-System\\HR-Management-and-Geo-Attendance-System-master\\geofencing\\ 10 | google_maps_flutter=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\google_maps_flutter-0.5.21+12\\ 11 | location=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\location-2.3.5\\ 12 | permission_handler=D:\\flutter\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\permission_handler-4.0.0\\ 13 | -------------------------------------------------------------------------------- /.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_id","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\device_id-0.2.0\\\\","dependencies":[]},{"name":"device_info","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\device_info-0.4.1+2\\\\","dependencies":[]},{"name":"firebase_auth","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-0.14.0+9\\\\","dependencies":["firebase_core"]},{"name":"firebase_core","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-0.4.2+1\\\\","dependencies":[]},{"name":"firebase_database","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_database-3.1.0\\\\","dependencies":["firebase_core"]},{"name":"firebase_messaging","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-6.0.1\\\\","dependencies":[]},{"name":"flutter_local_notifications","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_local_notifications-0.8.4+3\\\\","dependencies":[]},{"name":"geofencing","path":"F:\\\\HR-Management-and-Geo-Attendance-System\\\\HR-Management-and-Geo-Attendance-System-master\\\\geofencing\\\\","dependencies":[]},{"name":"google_maps_flutter","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.21+12\\\\","dependencies":[]},{"name":"location","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.3.5\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.0.0\\\\","dependencies":[]}],"android":[{"name":"device_id","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\device_id-0.2.0\\\\","dependencies":[]},{"name":"device_info","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\device_info-0.4.1+2\\\\","dependencies":[]},{"name":"firebase_auth","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-0.14.0+9\\\\","dependencies":["firebase_core"]},{"name":"firebase_core","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-0.4.2+1\\\\","dependencies":[]},{"name":"firebase_database","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_database-3.1.0\\\\","dependencies":["firebase_core"]},{"name":"firebase_messaging","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-6.0.1\\\\","dependencies":[]},{"name":"flutter_local_notifications","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_local_notifications-0.8.4+3\\\\","dependencies":[]},{"name":"geofencing","path":"F:\\\\HR-Management-and-Geo-Attendance-System\\\\HR-Management-and-Geo-Attendance-System-master\\\\geofencing\\\\","dependencies":[]},{"name":"google_maps_flutter","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.21+12\\\\","dependencies":[]},{"name":"location","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.3.5\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-4.0.0\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"device_id","dependencies":[]},{"name":"device_info","dependencies":[]},{"name":"firebase_auth","dependencies":["firebase_core"]},{"name":"firebase_core","dependencies":[]},{"name":"firebase_database","dependencies":["firebase_core"]},{"name":"firebase_messaging","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"geofencing","dependencies":[]},{"name":"google_maps_flutter","dependencies":[]},{"name":"location","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2020-07-16 12:14:03.226075","version":"1.17.5"} -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.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: 20e59316b8b8474554b38493b8ca888794b0234a 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.packages: -------------------------------------------------------------------------------- 1 | # Generated by pub on 2020-07-11 16:38:53.272576. 2 | archive:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib/ 3 | args:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib/ 4 | async:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.4.1/lib/ 5 | boolean_selector:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.0.0/lib/ 6 | calendarro:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/calendarro-1.1.2/lib/ 7 | charcode:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.3/lib/ 8 | collection:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12/lib/ 9 | convert:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.1.1/lib/ 10 | crypto:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.1.4/lib/ 11 | cupertino_icons:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/ 12 | device_id:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/device_id-0.2.0/lib/ 13 | device_info:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-0.4.1+2/lib/ 14 | firebase_auth:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+9/lib/ 15 | firebase_core:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.2+1/lib/ 16 | firebase_core_platform_interface:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_platform_interface-1.0.0/lib/ 17 | firebase_database:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_database-3.1.0/lib/ 18 | firebase_messaging:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-6.0.1/lib/ 19 | flutter:file:///D:/flutter/flutter/packages/flutter/lib/ 20 | flutter_datetime_picker:file:///D:/flutter/flutter/.pub-cache/git/flutter_datetime_picker-cfcc7f49fbcb86022f10e7eea7473a96cd68d507/lib/ 21 | flutter_local_notifications:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-0.8.4+3/lib/ 22 | flutter_screenutil:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_screenutil-0.4.6/lib/ 23 | flutter_sparkline:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sparkline-0.1.0/lib/ 24 | flutter_spinkit:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-3.1.0/lib/ 25 | flutter_staggered_grid_view:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_staggered_grid_view-0.3.0/lib/ 26 | flutter_test:file:///D:/flutter/flutter/packages/flutter_test/lib/ 27 | geofencing:geofencing/lib/ 28 | google_maps_flutter:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.5.21+12/lib/ 29 | grouped_buttons:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/grouped_buttons-1.0.4/lib/ 30 | image:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/image-2.1.12/lib/ 31 | intl:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.16.0/lib/ 32 | location:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/location-2.3.5/lib/ 33 | matcher:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.6/lib/ 34 | meta:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.8/lib/ 35 | path:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.4/lib/ 36 | permission_handler:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.0.0/lib/ 37 | petitparser:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/petitparser-2.4.0/lib/ 38 | platform:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/platform-2.2.1/lib/ 39 | quiver:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.1.3/lib/ 40 | quiver_hashcode:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/quiver_hashcode-2.0.0/lib/ 41 | simple_gesture_detector:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/simple_gesture_detector-0.1.4/lib/ 42 | sky_engine:file:///D:/flutter/flutter/bin/cache/pkg/sky_engine/lib/ 43 | source_span:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.7.0/lib/ 44 | splashscreen:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/splashscreen-1.2.0/lib/ 45 | stack_trace:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/ 46 | stream_channel:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.0.0/lib/ 47 | string_scanner:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5/lib/ 48 | table_calendar:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/table_calendar-2.2.1/lib/ 49 | term_glyph:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0/lib/ 50 | test_api:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.15/lib/ 51 | typed_data:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/ 52 | vector_math:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/ 53 | xml:file:///D:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/xml-3.6.1/lib/ 54 | geo_attendance_system:lib/ 55 | -------------------------------------------------------------------------------- /Cloud/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "location-based-attendanc-34f95" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Cloud/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | firebase-debug.log* 8 | 9 | # Firebase cache 10 | .firebase/ 11 | 12 | # Firebase config 13 | 14 | # Uncomment this if you'd like others to create their own Firebase project. 15 | # For a team working on the same Firebase project(s), it is recommended to leave 16 | # it commented so all members can deploy to the same project(s) in .firebaserc. 17 | # .firebaserc 18 | 19 | # Runtime data 20 | pids 21 | *.pid 22 | *.seed 23 | *.pid.lock 24 | 25 | # Directory for instrumented libs generated by jscoverage/JSCover 26 | lib-cov 27 | 28 | # Coverage directory used by tools like istanbul 29 | coverage 30 | 31 | # nyc test coverage 32 | .nyc_output 33 | 34 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 35 | .grunt 36 | 37 | # Bower dependency directory (https://bower.io/) 38 | bower_components 39 | 40 | # node-waf configuration 41 | .lock-wscript 42 | 43 | # Compiled binary addons (http://nodejs.org/api/addons.html) 44 | build/Release 45 | 46 | # Dependency directories 47 | node_modules/ 48 | 49 | # Optional npm cache directory 50 | .npm 51 | 52 | # Optional eslint cache 53 | .eslintcache 54 | 55 | # Optional REPL history 56 | .node_repl_history 57 | 58 | # Output of 'npm pack' 59 | *.tgz 60 | 61 | # Yarn Integrity file 62 | .yarn-integrity 63 | 64 | # dotenv environment variables file 65 | .env 66 | -------------------------------------------------------------------------------- /Cloud/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "functions": { 3 | "predeploy": [ 4 | "npm --prefix \"$RESOURCE_DIR\" run lint" 5 | ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Cloud/functions/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | // Required for certain syntax usages 4 | "ecmaVersion": 2017 5 | }, 6 | "plugins": [ 7 | "promise" 8 | ], 9 | "extends": "eslint:recommended", 10 | "rules": { 11 | // Removed rule "disallow the use of console" from recommended eslint rules 12 | "no-console": "off", 13 | 14 | // Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules 15 | "no-regex-spaces": "off", 16 | 17 | // Removed rule "disallow the use of debugger" from recommended eslint rules 18 | "no-debugger": "off", 19 | 20 | // Removed rule "disallow unused variables" from recommended eslint rules 21 | "no-unused-vars": "off", 22 | 23 | // Removed rule "disallow mixed spaces and tabs for indentation" from recommended eslint rules 24 | "no-mixed-spaces-and-tabs": "off", 25 | 26 | // Removed rule "disallow the use of undeclared variables unless mentioned in /*global */ comments" from recommended eslint rules 27 | "no-undef": "off", 28 | 29 | // Warn against template literal placeholder syntax in regular strings 30 | "no-template-curly-in-string": 1, 31 | 32 | // Warn if return statements do not either always or never specify values 33 | "consistent-return": 1, 34 | 35 | // Warn if no return statements in callbacks of array methods 36 | "array-callback-return": 1, 37 | 38 | // Require the use of === and !== 39 | "eqeqeq": 2, 40 | 41 | // Disallow the use of alert, confirm, and prompt 42 | "no-alert": 2, 43 | 44 | // Disallow the use of arguments.caller or arguments.callee 45 | "no-caller": 2, 46 | 47 | // Disallow null comparisons without type-checking operators 48 | "no-eq-null": 2, 49 | 50 | // Disallow the use of eval() 51 | "no-eval": 2, 52 | 53 | // Warn against extending native types 54 | "no-extend-native": 1, 55 | 56 | // Warn against unnecessary calls to .bind() 57 | "no-extra-bind": 1, 58 | 59 | // Warn against unnecessary labels 60 | "no-extra-label": 1, 61 | 62 | // Disallow leading or trailing decimal points in numeric literals 63 | "no-floating-decimal": 2, 64 | 65 | // Warn against shorthand type conversions 66 | "no-implicit-coercion": 1, 67 | 68 | // Warn against function declarations and expressions inside loop statements 69 | "no-loop-func": 1, 70 | 71 | // Disallow new operators with the Function object 72 | "no-new-func": 2, 73 | 74 | // Warn against new operators with the String, Number, and Boolean objects 75 | "no-new-wrappers": 1, 76 | 77 | // Disallow throwing literals as exceptions 78 | "no-throw-literal": 2, 79 | 80 | // Require using Error objects as Promise rejection reasons 81 | "prefer-promise-reject-errors": 2, 82 | 83 | // Enforce “for” loop update clause moving the counter in the right direction 84 | "for-direction": 2, 85 | 86 | // Enforce return statements in getters 87 | "getter-return": 2, 88 | 89 | // Disallow await inside of loops 90 | "no-await-in-loop": 2, 91 | 92 | // Disallow comparing against -0 93 | "no-compare-neg-zero": 2, 94 | 95 | // Warn against catch clause parameters from shadowing variables in the outer scope 96 | "no-catch-shadow": 1, 97 | 98 | // Disallow identifiers from shadowing restricted names 99 | "no-shadow-restricted-names": 2, 100 | 101 | // Enforce return statements in callbacks of array methods 102 | "callback-return": 2, 103 | 104 | // Require error handling in callbacks 105 | "handle-callback-err": 2, 106 | 107 | // Warn against string concatenation with __dirname and __filename 108 | "no-path-concat": 1, 109 | 110 | // Prefer using arrow functions for callbacks 111 | "prefer-arrow-callback": 1, 112 | 113 | // Return inside each then() to create readable and reusable Promise chains. 114 | // Forces developers to return console logs and http calls in promises. 115 | "promise/always-return": 2, 116 | 117 | //Enforces the use of catch() on un-returned promises 118 | "promise/catch-or-return": 2, 119 | 120 | // Warn against nested then() or catch() statements 121 | "promise/no-nesting": 1 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Cloud/functions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /Cloud/functions/index.js: -------------------------------------------------------------------------------- 1 | const functions = require("firebase-functions"); 2 | const admin = require("firebase-admin"); 3 | 4 | admin.initializeApp(functions.config().firebase); 5 | 6 | //Now we're going to create a function that listens to when a 'Notifications' node changes and send a notificcation 7 | //to all devices subscribed to a topic 8 | 9 | exports.sendNotification = functions.database 10 | .ref("leaves/{uid}/{key}") 11 | .onUpdate((change, context) => { 12 | //This will be the notification model that we push to firebase 13 | 14 | const before = change.before; // DataSnapshot before the change 15 | const after = change.after; 16 | 17 | console.log(context.params.uid); 18 | 19 | var request = after.val(); 20 | 21 | const payload = { 22 | notification: { 23 | title: "Update on your Leave Status", 24 | body: `Your Leave has been ${request.status}.` 25 | // icon: follower.photoURL 26 | }, 27 | data: { 28 | sound: "default", 29 | click_action: "FLUTTER_NOTIFICATION_CLICK" 30 | } 31 | }; 32 | 33 | if (request.withdrawalStatus === 0) { 34 | var token; 35 | admin 36 | .database() 37 | .ref("users/" + context.params.uid + "/notificationToken") 38 | .once("value") 39 | .then(allToken => { 40 | if (allToken.val()) { 41 | console.log("token available"); 42 | console.log("Token ID: " + allToken.val()); 43 | 44 | setTimeout(() => { 45 | admin 46 | .messaging() 47 | .sendToDevice(allToken.val(), payload) 48 | .then(response => { 49 | console.log("Token " + token); 50 | console.log("Successfully sent message: ", response); 51 | return true; 52 | }) 53 | .catch(error => { 54 | console.log("Error sending message: ", error); 55 | return false; 56 | }); 57 | }, 2000); 58 | } else { 59 | console.log("No token available"); 60 | } 61 | return true; 62 | }) 63 | .catch(error => { 64 | console.log(error); 65 | return false; 66 | }); 67 | } 68 | //The topic variable can be anything from a username, to a uid 69 | //I find this approach much better than using the refresh token 70 | //as you can subscribe to someone's phone number, username, or some other unique identifier 71 | //to communicate between 72 | 73 | //Now let's move onto the code, but before that, let's push this to firebase 74 | }); 75 | //And this is it for building notifications to multiple devices from or to one. 76 | -------------------------------------------------------------------------------- /Cloud/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "scripts": { 5 | "lint": "eslint .", 6 | "serve": "firebase serve --only functions", 7 | "shell": "firebase functions:shell", 8 | "start": "npm run shell", 9 | "deploy": "firebase deploy --only functions", 10 | "logs": "firebase functions:log" 11 | }, 12 | "engines": { 13 | "node": "8" 14 | }, 15 | "dependencies": { 16 | "firebase-admin": "^8.6.0", 17 | "firebase-functions": "^3.3.0" 18 | }, 19 | "devDependencies": { 20 | "eslint": "^5.12.0", 21 | "eslint-plugin-promise": "^4.0.1", 22 | "firebase-functions-test": "^0.1.6" 23 | }, 24 | "private": true 25 | } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Geo-Location-Attendance-System 2 | 3 | This is Full Functional App Coded in Dart, FLutter. I am using FireBase for Authentication and DataBase of Attendance. 4 | 5 | Currently this is for College Students, But We Can Mold This App For Any Purpose. For exmaple, for Schools, Shops, Firms, etc. 6 | 7 | Like [Madhav Pruthi](https://github.com/MadhavPruthi) Did it in His Project for HR, My this Project is Inspired by him. 8 | 9 | [His HR Project](https://github.com/MadhavPruthi/HR-Management-and-Geo-Attendance-System) 10 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /android/.gradle/5.4.1/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /android/.gradle/5.4.1/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /android/.gradle/5.4.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/.gradle/5.4.1/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/fileContent/fileContent.lock -------------------------------------------------------------------------------- /android/.gradle/5.4.1/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /android/.gradle/5.4.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin -------------------------------------------------------------------------------- /android/.gradle/5.4.1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/gc.properties -------------------------------------------------------------------------------- /android/.gradle/5.4.1/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /android/.gradle/5.4.1/javaCompile/jarAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin -------------------------------------------------------------------------------- /android/.gradle/5.4.1/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /android/.gradle/5.4.1/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/5.4.1/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /android/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /android/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Sat Jul 11 16:09:39 IST 2020 2 | gradle.version=5.4.1 3 | -------------------------------------------------------------------------------- /android/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /android/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "example.com.geo_attendance_system" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test:runner:1.1.0' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 61 | } 62 | 63 | apply plugin: 'com.google.gms.google-services' 64 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "221418337703", 4 | "firebase_url": "https://location-based-attendanc-34f95.firebaseio.com", 5 | "project_id": "location-based-attendanc-34f95", 6 | "storage_bucket": "location-based-attendanc-34f95.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:221418337703:android:150b2d5cc56f5f01cf7282", 12 | "android_client_info": { 13 | "package_name": "example.com.geo_attendance_system" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "221418337703-pbo2mq33vto2mh93tbrdpuj5aj03r4en.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyDWCXhBHHUThStRDoGlaALmyDhnKJmK9Ug" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "221418337703-pbo2mq33vto2mh93tbrdpuj5aj03r4en.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 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /android/app/src/main/java/example/com/geo_attendance_system/Application.java: -------------------------------------------------------------------------------- 1 | package example.com.geo_attendance_system; 2 | 3 | import io.flutter.app.FlutterApplication; 4 | import io.flutter.app.FlutterFragmentActivity; 5 | import io.flutter.plugin.common.PluginRegistry; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | import io.flutter.plugins.geofencing.GeofencingService; 8 | 9 | public class Application extends FlutterApplication implements PluginRegistry.PluginRegistrantCallback { 10 | @Override 11 | public void onCreate() { 12 | super.onCreate(); 13 | GeofencingService.setPluginRegistrant(this); 14 | } 15 | 16 | @Override 17 | public void registerWith(PluginRegistry registry) { 18 | GeneratedPluginRegistrant.registerWith(registry); 19 | } 20 | } -------------------------------------------------------------------------------- /android/app/src/main/java/example/com/geo_attendance_system/MainActivity.java: -------------------------------------------------------------------------------- 1 | package example.com.geo_attendance_system; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | import com.notrait.deviceid.DeviceIdPlugin; 5 | import io.flutter.plugins.deviceinfo.DeviceInfoPlugin; 6 | import io.flutter.plugins.firebaseauth.FirebaseAuthPlugin; 7 | import io.flutter.plugins.firebase.core.FirebaseCorePlugin; 8 | import io.flutter.plugins.firebase.database.FirebaseDatabasePlugin; 9 | import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin; 10 | import com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin; 11 | import io.flutter.plugins.geofencing.GeofencingPlugin; 12 | import io.flutter.plugins.googlemaps.GoogleMapsPlugin; 13 | import com.lyokone.location.LocationPlugin; 14 | import com.baseflow.permissionhandler.PermissionHandlerPlugin; 15 | 16 | /** 17 | * Generated file. Do not edit. 18 | */ 19 | public final class GeneratedPluginRegistrant { 20 | public static void registerWith(PluginRegistry registry) { 21 | if (alreadyRegisteredWith(registry)) { 22 | return; 23 | } 24 | DeviceIdPlugin.registerWith(registry.registrarFor("com.notrait.deviceid.DeviceIdPlugin")); 25 | DeviceInfoPlugin.registerWith(registry.registrarFor("io.flutter.plugins.deviceinfo.DeviceInfoPlugin")); 26 | FirebaseAuthPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebaseauth.FirebaseAuthPlugin")); 27 | FirebaseCorePlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebase.core.FirebaseCorePlugin")); 28 | FirebaseDatabasePlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebase.database.FirebaseDatabasePlugin")); 29 | FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin")); 30 | FlutterLocalNotificationsPlugin.registerWith(registry.registrarFor("com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin")); 31 | GeofencingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.geofencing.GeofencingPlugin")); 32 | GoogleMapsPlugin.registerWith(registry.registrarFor("io.flutter.plugins.googlemaps.GoogleMapsPlugin")); 33 | LocationPlugin.registerWith(registry.registrarFor("com.lyokone.location.LocationPlugin")); 34 | PermissionHandlerPlugin.registerWith(registry.registrarFor("com.baseflow.permissionhandler.PermissionHandlerPlugin")); 35 | } 36 | 37 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 38 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 39 | if (registry.hasPlugin(key)) { 40 | return true; 41 | } 42 | registry.registrarFor(key); 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.3.0' 9 | classpath 'com.google.gms:google-services:4.2.0' 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | android.enableR8=true 6 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /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.4.1-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/local.properties: -------------------------------------------------------------------------------- 1 | sdk.dir=C:\\Users\\Dell\\AppData\\Local\\Android\\sdk 2 | flutter.sdk=D:\\flutter\\flutter 3 | flutter.buildMode=release 4 | flutter.versionName=1.0.0 5 | flutter.versionCode=1 -------------------------------------------------------------------------------- /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/back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/back.jpg -------------------------------------------------------------------------------- /assets/fonts/Bitter-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Bitter-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Bitter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Bitter-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Black.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-BlackItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-BlackItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Bold.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-BoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-BoldItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-ExtraBold.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ExtraBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-ExtraBoldItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-ExtraLight.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ExtraLightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-ExtraLightItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Italic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Light.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-LightItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-LightItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Medium.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-MediumItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-MediumItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Regular.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-SemiBold.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-SemiBoldItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-SemiBoldItalic.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-Thin.otf -------------------------------------------------------------------------------- /assets/fonts/Poppins-ThinItalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Poppins-ThinItalic.otf -------------------------------------------------------------------------------- /assets/fonts/SIL Open Font License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Indian Type Foundry (info@indiantypefoundry.com). 2 | 3 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 4 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 5 | 6 | ----------------------------------------------------------- 7 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 8 | ----------------------------------------------------------- 9 | 10 | PREAMBLE 11 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 12 | 13 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 14 | 15 | DEFINITIONS 16 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 17 | 18 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 19 | 20 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 21 | 22 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 23 | 24 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 25 | 26 | PERMISSION & CONDITIONS 27 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 28 | 29 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 30 | 31 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 32 | 33 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 34 | 35 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 36 | 37 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 38 | 39 | TERMINATION 40 | This license becomes null and void if any of the above conditions are not met. 41 | 42 | DISCLAIMER 43 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /assets/fonts/Sansation-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/fonts/Sansation-Bold.ttf -------------------------------------------------------------------------------- /assets/gif/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/gif/close.gif -------------------------------------------------------------------------------- /assets/gif/loading-gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/gif/loading-gif.gif -------------------------------------------------------------------------------- /assets/gif/no_entry.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/gif/no_entry.gif -------------------------------------------------------------------------------- /assets/gif/tick.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/gif/tick.gif -------------------------------------------------------------------------------- /assets/github/calendar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/calendar.jpg -------------------------------------------------------------------------------- /assets/github/dashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/dashboard.jpg -------------------------------------------------------------------------------- /assets/github/drawer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/drawer.jpg -------------------------------------------------------------------------------- /assets/github/landing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/landing.jpg -------------------------------------------------------------------------------- /assets/github/leave_make.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/leave_make.jpg -------------------------------------------------------------------------------- /assets/github/leave_status.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/leave_status.jpg -------------------------------------------------------------------------------- /assets/github/login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/login.jpg -------------------------------------------------------------------------------- /assets/github/make_attendance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/make_attendance.jpg -------------------------------------------------------------------------------- /assets/github/mark_attendance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/github/mark_attendance.jpg -------------------------------------------------------------------------------- /assets/icons/Logo-splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/Logo-splash.png -------------------------------------------------------------------------------- /assets/icons/attendance_recorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/attendance_recorder.png -------------------------------------------------------------------------------- /assets/icons/attendance_summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/attendance_summary.png -------------------------------------------------------------------------------- /assets/icons/icons8-attendance-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/icons8-attendance-48.png -------------------------------------------------------------------------------- /assets/icons/icons8-leave-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/icons8-leave-64.png -------------------------------------------------------------------------------- /assets/icons/icons8-location-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/icons8-location-64.png -------------------------------------------------------------------------------- /assets/icons/icons8-process-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/icons8-process-100.png -------------------------------------------------------------------------------- /assets/icons/leave_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/leave_application.png -------------------------------------------------------------------------------- /assets/icons/leave_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/leave_status.png -------------------------------------------------------------------------------- /assets/icons/navigation-drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/icons/navigation-drawer.png -------------------------------------------------------------------------------- /assets/logo/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/logo/logo-white.png -------------------------------------------------------------------------------- /assets/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/logo/logo.png -------------------------------------------------------------------------------- /assets/logo/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/assets/logo/profile.jpg -------------------------------------------------------------------------------- /geofencing/.flutter-plugins: -------------------------------------------------------------------------------- 1 | # This is a generated file; do not edit or check into version control. 2 | geofencing=F:\\Geo-Attendance-System\\Geo Location App\\geofencing\\ 3 | -------------------------------------------------------------------------------- /geofencing/.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"geofencing","path":"F:\\\\Geo-Attendance-System\\\\Geo Location App\\\\geofencing\\\\","dependencies":[]}],"android":[{"name":"geofencing","path":"F:\\\\Geo-Attendance-System\\\\Geo Location App\\\\geofencing\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"geofencing","dependencies":[]}],"date_created":"2020-08-28 08:47:26.026310","version":"1.20.0-7.3.pre"} -------------------------------------------------------------------------------- /geofencing/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | pubspec.lock 7 | 8 | build/ 9 | -------------------------------------------------------------------------------- /geofencing/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /geofencing/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /geofencing/README.md: -------------------------------------------------------------------------------- 1 | What is geofencing? 2 | [here](https://developer.android.com/training/location/geofencing) 3 | 4 | # Geofencing 5 | 6 | A sample geofencing plugin with background execution support for Flutter. 7 | 8 | ## Getting Started 9 | This plugin works on both Android and iOS. Follow the instructions in the following sections for the 10 | platforms which are to be targeted. 11 | 12 | ### Android 13 | 14 | Add the following lines to your `AndroidManifest.xml` to register the background service for 15 | geofencing: 16 | 17 | ```xml 18 | 20 | 22 | ``` 23 | 24 | Also request the correct permissions for geofencing: 25 | 26 | ```xml 27 | 28 | ``` 29 | 30 | Finally, create either `Application.kt` or `Application.java` in the same directory as `MainActivity`. 31 | 32 | For `Application.kt`, use the following: 33 | 34 | ```kotlin 35 | class Application : FlutterApplication(), PluginRegistrantCallback { 36 | override fun onCreate() { 37 | super.onCreate(); 38 | GeofencingService.setPluginRegistrant(this); 39 | } 40 | 41 | override fun registerWith(registry: PluginRegistry) { 42 | GeneratedPluginRegistrant.registerWith(registry); 43 | } 44 | } 45 | ``` 46 | 47 | For `Application.java`, use the following: 48 | 49 | ```java 50 | public class Application extends FlutterApplication implements PluginRegistrantCallback { 51 | @Override 52 | public void onCreate() { 53 | super.onCreate(); 54 | GeofencingService.setPluginRegistrant(this); 55 | } 56 | 57 | @Override 58 | public void registerWith(PluginRegistry registry) { 59 | GeneratedPluginRegistrant.registerWith(registry); 60 | } 61 | } 62 | ``` 63 | 64 | Which must also be referenced in `AndroidManifest.xml`: 65 | 66 | ```xml 67 | 78 | NSLocationAlwaysAndWhenInUseUsageDescription 79 | YOUR DESCRIPTION HERE 80 | NSLocationWhenInUseUsageDescription 81 | YOUR DESCRIPTION HERE 82 | ... 83 | ``` 84 | 85 | And request the correct permissions for geofencing: 86 | 87 | ```xml 88 | 89 | ... 90 | Main 91 | UIRequiredDeviceCapabilities 92 | 93 | location-services 94 | gps 95 | armv7 96 | 97 | UIBackgroundModes 98 | 99 | location 100 | 101 | ... 102 | 103 | ``` 104 | 105 | ### Need Help? 106 | 107 | For help getting started with Flutter, view our online 108 | [documentation](https://flutter.io/). 109 | 110 | For help on editing plugin code, view the [documentation](https://flutter.io/developing-packages/#edit-plugin-package). 111 | -------------------------------------------------------------------------------- /geofencing/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /geofencing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | import io.flutter.plugins.geofencing.GeofencingPlugin; 5 | 6 | /** 7 | * Generated file. Do not edit. 8 | */ 9 | public final class GeneratedPluginRegistrant { 10 | public static void registerWith(PluginRegistry registry) { 11 | if (alreadyRegisteredWith(registry)) { 12 | return; 13 | } 14 | GeofencingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.geofencing.GeofencingPlugin")); 15 | } 16 | 17 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 18 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 19 | if (registry.hasPlugin(key)) { 20 | return true; 21 | } 22 | registry.registrarFor(key); 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /geofencing/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'io.flutter.plugins.geofencing' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.3.50' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.5.1' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 36 | } 37 | lintOptions { 38 | disable 'InvalidPackage' 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 44 | implementation "com.google.android.gms:play-services-location:17.+" 45 | } 46 | -------------------------------------------------------------------------------- /geofencing/android/gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | org.gradle.jvmargs=-Xmx1536M 4 | -------------------------------------------------------------------------------- /geofencing/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'geofencing' 2 | -------------------------------------------------------------------------------- /geofencing/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /geofencing/android/src/main/kotlin/io/flutter/plugins/geofencing/GeofencingBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package io.flutter.plugins.geofencing 6 | 7 | import android.content.BroadcastReceiver 8 | import android.content.Context 9 | import android.content.Intent 10 | import android.util.Log 11 | import io.flutter.view.FlutterMain 12 | 13 | 14 | class GeofencingBroadcastReceiver : BroadcastReceiver() { 15 | companion object { 16 | private const val TAG = "GeofencingBroadcastReceiver" 17 | } 18 | override fun onReceive(context: Context, intent: Intent) { 19 | FlutterMain.ensureInitializationComplete(context, null) 20 | GeofencingService.enqueueWork(context, intent) 21 | } 22 | } -------------------------------------------------------------------------------- /geofencing/android/src/main/kotlin/io/flutter/plugins/geofencing/GeofencingRebootBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package io.flutter.plugins.geofencing; 6 | 7 | import android.content.BroadcastReceiver; 8 | import android.content.Context; 9 | import android.content.Intent; 10 | import android.util.Log; 11 | 12 | class GeofencingRebootBroadcastReceiver : BroadcastReceiver() { 13 | override fun onReceive(context: Context, intent: Intent) { 14 | if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { 15 | Log.e("GEOFENCING REBOOT", "Reregistering geofences!") 16 | GeofencingPlugin.reRegisterAfterReboot(context) 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /geofencing/android/src/main/kotlin/io/flutter/plugins/geofencing/GeofencingService.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package io.flutter.plugins.geofencing 6 | 7 | import android.content.Context 8 | import android.content.Intent 9 | import android.os.Handler 10 | import android.util.Log 11 | import androidx.core.app.JobIntentService 12 | import io.flutter.plugin.common.MethodChannel 13 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 14 | import io.flutter.plugin.common.MethodChannel.Result 15 | import io.flutter.plugin.common.MethodCall 16 | import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback 17 | import io.flutter.view.FlutterCallbackInformation 18 | import io.flutter.view.FlutterMain 19 | import io.flutter.view.FlutterNativeView 20 | import io.flutter.view.FlutterRunArguments 21 | import java.util.ArrayDeque 22 | import java.util.concurrent.atomic.AtomicBoolean 23 | import java.util.UUID 24 | 25 | import com.google.android.gms.location.GeofencingEvent 26 | 27 | class GeofencingService : MethodCallHandler, JobIntentService() { 28 | private val queue = ArrayDeque>() 29 | private lateinit var mBackgroundChannel: MethodChannel 30 | private lateinit var mContext: Context 31 | 32 | companion object { 33 | @JvmStatic 34 | private val TAG = "GeofencingService" 35 | @JvmStatic 36 | private val JOB_ID = UUID.randomUUID().mostSignificantBits.toInt() 37 | @JvmStatic 38 | private var sBackgroundFlutterView: FlutterNativeView? = null 39 | @JvmStatic 40 | private val sServiceStarted = AtomicBoolean(false) 41 | 42 | @JvmStatic 43 | private lateinit var sPluginRegistrantCallback: PluginRegistrantCallback 44 | 45 | @JvmStatic 46 | fun enqueueWork(context: Context, work: Intent) { 47 | enqueueWork(context, GeofencingService::class.java, JOB_ID, work) 48 | } 49 | 50 | @JvmStatic 51 | fun setPluginRegistrant(callback: PluginRegistrantCallback) { 52 | sPluginRegistrantCallback = callback 53 | } 54 | } 55 | 56 | private fun startGeofencingService(context: Context) { 57 | synchronized(sServiceStarted) { 58 | mContext = context 59 | if (sBackgroundFlutterView == null) { 60 | val callbackHandle = context.getSharedPreferences( 61 | GeofencingPlugin.SHARED_PREFERENCES_KEY, 62 | Context.MODE_PRIVATE) 63 | .getLong(GeofencingPlugin.CALLBACK_DISPATCHER_HANDLE_KEY, 0) 64 | 65 | val callbackInfo = FlutterCallbackInformation.lookupCallbackInformation(callbackHandle) 66 | if (callbackInfo == null) { 67 | Log.e(TAG, "Fatal: failed to find callback") 68 | return 69 | } 70 | Log.i(TAG, "Starting GeofencingService...") 71 | sBackgroundFlutterView = FlutterNativeView(context, true) 72 | 73 | val registry = sBackgroundFlutterView!!.pluginRegistry 74 | sPluginRegistrantCallback.registerWith(registry) 75 | val args = FlutterRunArguments() 76 | args.bundlePath = FlutterMain.findAppBundlePath(context) 77 | args.entrypoint = callbackInfo.callbackName 78 | args.libraryPath = callbackInfo.callbackLibraryPath 79 | 80 | sBackgroundFlutterView!!.runFromBundle(args) 81 | IsolateHolderService.setBackgroundFlutterView(sBackgroundFlutterView) 82 | } 83 | } 84 | mBackgroundChannel = MethodChannel(sBackgroundFlutterView, 85 | "plugins.flutter.io/geofencing_plugin_background") 86 | mBackgroundChannel.setMethodCallHandler(this) 87 | } 88 | 89 | override fun onMethodCall(call: MethodCall, result: Result) { 90 | when(call.method) { 91 | "GeofencingService.initialized" -> { 92 | synchronized(sServiceStarted) { 93 | while (!queue.isEmpty()) { 94 | mBackgroundChannel.invokeMethod("", queue.remove()) 95 | } 96 | sServiceStarted.set(true) 97 | } 98 | } 99 | "GeofencingService.promoteToForeground" -> { 100 | mContext.startForegroundService(Intent(mContext, IsolateHolderService::class.java)) 101 | } 102 | "GeofencingService.demoteToBackground" -> { 103 | val intent = Intent(mContext, IsolateHolderService::class.java) 104 | intent.setAction(IsolateHolderService.ACTION_SHUTDOWN) 105 | mContext.startForegroundService(intent) 106 | } 107 | else -> result.notImplemented() 108 | } 109 | result.success(null) 110 | } 111 | 112 | override fun onCreate() { 113 | super.onCreate() 114 | startGeofencingService(this) 115 | } 116 | 117 | override fun onHandleWork(intent: Intent) { 118 | val callbackHandle = intent.getLongExtra(GeofencingPlugin.CALLBACK_HANDLE_KEY, 0) 119 | val geofencingEvent = GeofencingEvent.fromIntent(intent) 120 | if (geofencingEvent.hasError()) { 121 | Log.e(TAG, "Geofencing error: ${geofencingEvent.errorCode}") 122 | return 123 | } 124 | 125 | // Get the transition type. 126 | val geofenceTransition = geofencingEvent.geofenceTransition 127 | 128 | // Get the geofences that were triggered. A single event can trigger 129 | // multiple geofences. 130 | val triggeringGeofences = geofencingEvent.triggeringGeofences.map { 131 | it.requestId 132 | } 133 | 134 | val location = geofencingEvent.triggeringLocation 135 | val locationList = listOf(location.latitude, 136 | location.longitude) 137 | val geofenceUpdateList = listOf(callbackHandle, 138 | triggeringGeofences, 139 | locationList, 140 | geofenceTransition) 141 | 142 | synchronized(sServiceStarted) { 143 | if (!sServiceStarted.get()) { 144 | // Queue up geofencing events while background isolate is starting 145 | queue.add(geofenceUpdateList) 146 | } else { 147 | // Callback method name is intentionally left blank. 148 | Handler(mContext.mainLooper).post { mBackgroundChannel.invokeMethod("", geofenceUpdateList) } 149 | } 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /geofencing/android/src/main/kotlin/io/flutter/plugins/geofencing/IsolateHolderService.kt: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package io.flutter.plugins.geofencing 6 | 7 | import android.app.NotificationChannel 8 | import android.app.NotificationManager 9 | import android.app.Service 10 | import android.content.Context 11 | import android.content.Intent 12 | import android.os.IBinder 13 | import android.os.PowerManager 14 | import androidx.core.app.NotificationCompat 15 | import io.flutter.view.FlutterNativeView 16 | 17 | class IsolateHolderService : Service() { 18 | companion object { 19 | @JvmStatic 20 | val ACTION_SHUTDOWN = "SHUTDOWN" 21 | @JvmStatic 22 | private val WAKELOCK_TAG = "IsolateHolderService::WAKE_LOCK" 23 | @JvmStatic 24 | private val TAG = "IsolateHolderService" 25 | @JvmStatic 26 | private var sBackgroundFlutterView: FlutterNativeView? = null 27 | 28 | @JvmStatic 29 | fun setBackgroundFlutterView(view: FlutterNativeView?) { 30 | sBackgroundFlutterView = view 31 | } 32 | } 33 | 34 | override fun onBind(p0: Intent) : IBinder? { 35 | return null; 36 | } 37 | 38 | override fun onCreate() { 39 | super.onCreate() 40 | val CHANNEL_ID = "geofencing_plugin_channel" 41 | val channel = NotificationChannel(CHANNEL_ID, 42 | "Flutter Geofencing Plugin", 43 | NotificationManager.IMPORTANCE_LOW) 44 | val imageId = getResources().getIdentifier("ic_launcher", "mipmap", getPackageName()) 45 | 46 | (getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).createNotificationChannel(channel) 47 | val notification = NotificationCompat.Builder(this, CHANNEL_ID) 48 | .setContentTitle("Almost home!") 49 | .setContentText("Within 1KM of home. Fine location tracking enabled.") 50 | .setSmallIcon(imageId) 51 | .setPriority(NotificationCompat.PRIORITY_LOW) 52 | .build() 53 | 54 | (getSystemService(Context.POWER_SERVICE) as PowerManager).run { 55 | newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKELOCK_TAG).apply { 56 | setReferenceCounted(false) 57 | acquire() 58 | } 59 | } 60 | startForeground(1, notification) 61 | } 62 | 63 | override fun onStartCommand(intent: Intent, flags: Int, startId: Int) : Int { 64 | if (intent.getAction() == ACTION_SHUTDOWN) { 65 | (getSystemService(Context.POWER_SERVICE) as PowerManager).run { 66 | newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKELOCK_TAG).apply { 67 | if (isHeld()) { 68 | release() 69 | } 70 | } 71 | } 72 | stopForeground(true) 73 | stopSelf() 74 | } 75 | return START_STICKY; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /geofencing/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | -------------------------------------------------------------------------------- /geofencing/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/geofencing/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /geofencing/ios/Classes/GeofencingPlugin.h: -------------------------------------------------------------------------------- 1 | #ifndef GeofencingPlugin_h 2 | #define GeofencingPlugin_h 3 | 4 | #import 5 | 6 | #import 7 | 8 | @interface GeofencingPlugin : NSObject 9 | 10 | @end 11 | #endif 12 | -------------------------------------------------------------------------------- /geofencing/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=D:\flutter\flutter" 4 | export "FLUTTER_APPLICATION_PATH=F:\Geo-Attendance-System\Geo Location App\geofencing" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "OTHER_LDFLAGS=$(inherited) -framework Flutter" 9 | export "FLUTTER_FRAMEWORK_DIR=D:\flutter\flutter\bin\cache\artifacts\engine\ios" 10 | export "FLUTTER_BUILD_NAME=0.0.1" 11 | export "FLUTTER_BUILD_NUMBER=0.0.1" 12 | export "DART_OBFUSCATION=false" 13 | export "TRACK_WIDGET_CREATION=false" 14 | export "TREE_SHAKE_ICONS=false" 15 | export "PACKAGE_CONFIG=.packages" 16 | -------------------------------------------------------------------------------- /geofencing/ios/geofencing.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'geofencing' 6 | s.version = '0.0.1' 7 | s.summary = 'A new flutter plugin project.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'Your Company' => 'email@example.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | 19 | s.ios.deployment_target = '8.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /geofencing/lib/geofencing.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | export 'package:geofencing/src/geofencing.dart' 6 | hide geofenceEventToInt, intToGeofenceEvent; 7 | export 'package:geofencing/src/location.dart' hide locationFromList; 8 | export 'package:geofencing/src/platform_settings.dart' 9 | hide platformSettingsToArgs; 10 | -------------------------------------------------------------------------------- /geofencing/lib/src/callback_dispatcher.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:ui'; 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter/services.dart'; 9 | 10 | import 'package:geofencing/src/geofencing.dart'; 11 | import 'package:geofencing/src/location.dart'; 12 | 13 | void callbackDispatcher() { 14 | const MethodChannel _backgroundChannel = 15 | MethodChannel('plugins.flutter.io/geofencing_plugin_background'); 16 | WidgetsFlutterBinding.ensureInitialized(); 17 | 18 | _backgroundChannel.setMethodCallHandler((MethodCall call) async { 19 | final List args = call.arguments; 20 | final Function callback = PluginUtilities.getCallbackFromHandle( 21 | CallbackHandle.fromRawHandle(args[0])); 22 | assert(callback != null); 23 | final List triggeringGeofences = args[1].cast(); 24 | final List locationList = []; 25 | // 0.0 becomes 0 somewhere during the method call, resulting in wrong 26 | // runtime type (int instead of double). This is a simple way to get 27 | // around casting in another complicated manner. 28 | args[2] 29 | .forEach((dynamic e) => locationList.add(double.parse(e.toString()))); 30 | final Location triggeringLocation = locationFromList(locationList); 31 | final GeofenceEvent event = intToGeofenceEvent(args[3]); 32 | callback(triggeringGeofences, triggeringLocation, event); 33 | }); 34 | _backgroundChannel.invokeMethod('GeofencingService.initialized'); 35 | } 36 | -------------------------------------------------------------------------------- /geofencing/lib/src/geofencing.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'dart:async'; 6 | import 'dart:io'; 7 | import 'dart:ui'; 8 | 9 | import 'package:flutter/services.dart'; 10 | 11 | import 'package:geofencing/src/callback_dispatcher.dart'; 12 | import 'package:geofencing/src/location.dart'; 13 | import 'package:geofencing/src/platform_settings.dart'; 14 | 15 | const int _kEnterEvent = 1; 16 | const int _kExitEvent = 2; 17 | const int _kDwellEvent = 4; 18 | 19 | /// Valid geofencing events. 20 | /// 21 | /// Note: `GeofenceEvent.dwell` is not supported on iOS. 22 | enum GeofenceEvent { enter, exit, dwell } 23 | 24 | // Internal. 25 | int geofenceEventToInt(GeofenceEvent e) { 26 | switch (e) { 27 | case GeofenceEvent.enter: 28 | return _kEnterEvent; 29 | case GeofenceEvent.exit: 30 | return _kExitEvent; 31 | case GeofenceEvent.dwell: 32 | return _kDwellEvent; 33 | default: 34 | throw UnimplementedError(); 35 | } 36 | } 37 | 38 | // TODO(bkonyi): handle event masks 39 | // Internal. 40 | GeofenceEvent intToGeofenceEvent(int e) { 41 | switch (e) { 42 | case _kEnterEvent: 43 | return GeofenceEvent.enter; 44 | case _kExitEvent: 45 | return GeofenceEvent.exit; 46 | case _kDwellEvent: 47 | return GeofenceEvent.dwell; 48 | default: 49 | throw UnimplementedError(); 50 | } 51 | } 52 | 53 | /// A circular region which represents a geofence. 54 | class GeofenceRegion { 55 | /// The ID associated with the geofence. 56 | /// 57 | /// This ID is used to identify the geofence and is required to delete a 58 | /// specific geofence. 59 | final String id; 60 | 61 | /// The location of the geofence. 62 | final Location location; 63 | 64 | /// The radius around `location` that will be considered part of the geofence. 65 | final double radius; 66 | 67 | /// The types of geofence events to listen for. 68 | /// 69 | /// Note: `GeofenceEvent.dwell` is not supported on iOS. 70 | final List triggers; 71 | 72 | /// Android specific settings for a geofence. 73 | final AndroidGeofencingSettings androidSettings; 74 | 75 | GeofenceRegion( 76 | this.id, double latitude, double longitude, this.radius, this.triggers, 77 | {AndroidGeofencingSettings androidSettings}) 78 | : location = Location(latitude, longitude), 79 | androidSettings = (androidSettings ?? AndroidGeofencingSettings()); 80 | 81 | List _toArgs() { 82 | final int triggerMask = triggers.fold( 83 | 0, (int trigger, GeofenceEvent e) => (geofenceEventToInt(e) | trigger)); 84 | final List args = [ 85 | id, 86 | location.latitude, 87 | location.longitude, 88 | radius, 89 | triggerMask 90 | ]; 91 | if (Platform.isAndroid) { 92 | args.addAll(platformSettingsToArgs(androidSettings)); 93 | } 94 | return args; 95 | } 96 | } 97 | 98 | class GeofencingManager { 99 | static const MethodChannel _channel = 100 | MethodChannel('plugins.flutter.io/geofencing_plugin'); 101 | static const MethodChannel _background = 102 | MethodChannel('plugins.flutter.io/geofencing_plugin_background'); 103 | 104 | /// Initialize the plugin and request relevant permissions from the user. 105 | static Future initialize() async { 106 | final CallbackHandle callback = 107 | PluginUtilities.getCallbackHandle(callbackDispatcher); 108 | await _channel.invokeMethod('GeofencingPlugin.initializeService', 109 | [callback.toRawHandle()]); 110 | } 111 | 112 | /// Promote the geofencing service to a foreground service. 113 | /// 114 | /// Will throw an exception if called anywhere except for a geofencing 115 | /// callback. 116 | static Future promoteToForeground() async => 117 | await _background.invokeMethod('GeofencingService.promoteToForeground'); 118 | 119 | /// Demote the geofencing service from a foreground service to a background 120 | /// service. 121 | /// 122 | /// Will throw an exception if called anywhere except for a geofencing 123 | /// callback. 124 | static Future demoteToBackground() async => 125 | await _background.invokeMethod('GeofencingService.demoteToBackground'); 126 | 127 | /// Register for geofence events for a [GeofenceRegion]. 128 | /// 129 | /// `region` is the geofence region to register with the system. 130 | /// `callback` is the method to be called when a geofence event associated 131 | /// with `region` occurs. 132 | /// 133 | /// Note: `GeofenceEvent.dwell` is not supported on iOS. If the 134 | /// `GeofenceRegion` provided only requests notifications for a 135 | /// `GeofenceEvent.dwell` trigger on iOS, `UnsupportedError` is thrown. 136 | static Future registerGeofence( 137 | GeofenceRegion region, 138 | void Function(List id, Location location, GeofenceEvent event) 139 | callback) async { 140 | if (Platform.isIOS && 141 | region.triggers.contains(GeofenceEvent.dwell) && 142 | (region.triggers.length == 1)) { 143 | throw UnsupportedError("iOS does not support 'GeofenceEvent.dwell'"); 144 | } 145 | final List args = [ 146 | PluginUtilities.getCallbackHandle(callback).toRawHandle() 147 | ]; 148 | args.addAll(region._toArgs()); 149 | await _channel.invokeMethod('GeofencingPlugin.registerGeofence', args); 150 | } 151 | 152 | /// Stop receiving geofence events for a given [GeofenceRegion]. 153 | static Future removeGeofence(GeofenceRegion region) async => 154 | (region == null) ? false : await removeGeofenceById(region.id); 155 | 156 | /// Stop receiving geofence events for an identifier associated with a 157 | /// geofence region. 158 | static Future removeGeofenceById(String id) async => await _channel 159 | .invokeMethod('GeofencingPlugin.removeGeofence', [id]); 160 | } 161 | -------------------------------------------------------------------------------- /geofencing/lib/src/location.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Internal. 6 | Location locationFromList(List l) => Location._fromList(l); 7 | 8 | /// A simple representation of a geographic location. 9 | class Location { 10 | final double latitude; 11 | final double longitude; 12 | 13 | const Location(this.latitude, this.longitude); 14 | 15 | Location._fromList(List l) 16 | : assert(l.length == 2), 17 | latitude = l[0], 18 | longitude = l[1]; 19 | 20 | @override 21 | String toString() => '($latitude, $longitude)'; 22 | } 23 | -------------------------------------------------------------------------------- /geofencing/lib/src/platform_settings.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:geofencing/src/geofencing.dart'; 6 | 7 | // Internal. 8 | List platformSettingsToArgs(AndroidGeofencingSettings s) => 9 | s._toArgs(); 10 | 11 | class AndroidGeofencingSettings { 12 | List initialTrigger; 13 | int expirationDuration; 14 | int loiteringDelay; 15 | int notificationResponsiveness; 16 | 17 | AndroidGeofencingSettings( 18 | {this.initialTrigger = const [GeofenceEvent.enter], 19 | this.loiteringDelay = 0, 20 | this.expirationDuration = -1, 21 | this.notificationResponsiveness = 0}); 22 | 23 | List _toArgs() { 24 | final int initTriggerMask = initialTrigger.fold( 25 | 0, (int trigger, GeofenceEvent e) => (geofenceEventToInt(e) | trigger)); 26 | return [ 27 | initTriggerMask, 28 | expirationDuration, 29 | loiteringDelay, 30 | notificationResponsiveness 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /geofencing/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: geofencing 2 | description: A geofencing plugin for Flutter applications. 3 | version: 0.0.1 4 | author: Ben Konyi 5 | homepage: https://github.com/flutter/plugins 6 | 7 | environment: 8 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | 15 | flutter: 16 | plugin: 17 | androidPackage: io.flutter.plugins.geofencing 18 | pluginClass: GeofencingPlugin -------------------------------------------------------------------------------- /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/Generated.xcconfig: -------------------------------------------------------------------------------- 1 | // This is a generated file; do not edit or check into version control. 2 | FLUTTER_ROOT=D:\flutter\flutter 3 | FLUTTER_APPLICATION_PATH=F:\HR-Management-and-Geo-Attendance-System\HR-Management-and-Geo-Attendance-System-master 4 | FLUTTER_TARGET=lib\main.dart 5 | FLUTTER_BUILD_DIR=build 6 | SYMROOT=${SOURCE_ROOT}/../build\ios 7 | OTHER_LDFLAGS=$(inherited) -framework Flutter 8 | FLUTTER_FRAMEWORK_DIR=D:\flutter\flutter\bin\cache\artifacts\engine\ios 9 | FLUTTER_BUILD_NAME=1.0.0 10 | FLUTTER_BUILD_NUMBER=1 11 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=D:\flutter\flutter" 4 | export "FLUTTER_APPLICATION_PATH=F:\HR-Management-and-Geo-Attendance-System\HR-Management-and-Geo-Attendance-System-master" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "OTHER_LDFLAGS=$(inherited) -framework Flutter" 9 | export "FLUTTER_FRAMEWORK_DIR=D:\flutter\flutter\bin\cache\artifacts\engine\ios" 10 | export "FLUTTER_BUILD_NAME=1.0.0" 11 | export "FLUTTER_BUILD_NUMBER=1" 12 | -------------------------------------------------------------------------------- /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: [UIApplicationLaunchOptionsKey: 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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Siddhant-K-code/Geo-Location-Attendance-System/61ae5005aa5e2eea743cf174e5e514c1fe58adb1/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/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GeneratedPluginRegistrant_h 6 | #define GeneratedPluginRegistrant_h 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface GeneratedPluginRegistrant : NSObject 13 | + (void)registerWithRegistry:(NSObject*)registry; 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | #endif /* GeneratedPluginRegistrant_h */ 18 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #import "GeneratedPluginRegistrant.h" 6 | 7 | #if __has_include() 8 | #import 9 | #else 10 | @import device_id; 11 | #endif 12 | 13 | #if __has_include() 14 | #import 15 | #else 16 | @import device_info; 17 | #endif 18 | 19 | #if __has_include() 20 | #import 21 | #else 22 | @import firebase_auth; 23 | #endif 24 | 25 | #if __has_include() 26 | #import 27 | #else 28 | @import firebase_core; 29 | #endif 30 | 31 | #if __has_include() 32 | #import 33 | #else 34 | @import firebase_database; 35 | #endif 36 | 37 | #if __has_include() 38 | #import 39 | #else 40 | @import firebase_messaging; 41 | #endif 42 | 43 | #if __has_include() 44 | #import 45 | #else 46 | @import flutter_local_notifications; 47 | #endif 48 | 49 | #if __has_include() 50 | #import 51 | #else 52 | @import geofencing; 53 | #endif 54 | 55 | #if __has_include() 56 | #import 57 | #else 58 | @import google_maps_flutter; 59 | #endif 60 | 61 | #if __has_include() 62 | #import 63 | #else 64 | @import location; 65 | #endif 66 | 67 | #if __has_include() 68 | #import 69 | #else 70 | @import permission_handler; 71 | #endif 72 | 73 | @implementation GeneratedPluginRegistrant 74 | 75 | + (void)registerWithRegistry:(NSObject*)registry { 76 | [DeviceIdPlugin registerWithRegistrar:[registry registrarForPlugin:@"DeviceIdPlugin"]]; 77 | [FLTDeviceInfoPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTDeviceInfoPlugin"]]; 78 | [FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]]; 79 | [FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]]; 80 | [FLTFirebaseDatabasePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseDatabasePlugin"]]; 81 | [FLTFirebaseMessagingPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseMessagingPlugin"]]; 82 | [FlutterLocalNotificationsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterLocalNotificationsPlugin"]]; 83 | [GeofencingPlugin registerWithRegistrar:[registry registrarForPlugin:@"GeofencingPlugin"]]; 84 | [FLTGoogleMapsPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTGoogleMapsPlugin"]]; 85 | [LocationPlugin registerWithRegistrar:[registry registrarForPlugin:@"LocationPlugin"]]; 86 | [PermissionHandlerPlugin registerWithRegistrar:[registry registrarForPlugin:@"PermissionHandlerPlugin"]]; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /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 | geo_attendance_system 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:geo_attendance_system/src/app.dart'; 3 | 4 | void main() { 5 | runApp(App()); 6 | } 7 | -------------------------------------------------------------------------------- /lib/src/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:geo_attendance_system/src/services/authentication.dart'; 3 | 4 | import 'package:geo_attendance_system/src/ui/pages/splash_screen.dart'; 5 | 6 | class App extends StatelessWidget { 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | 12 | theme: ThemeData.light(), 13 | home: Scaffold(body: SplashScreenWidget(auth: new Auth())), 14 | debugShowCheckedModeBanner: false, 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/models/AttendaceList.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_database/firebase_database.dart'; 2 | import 'package:geo_attendance_system/src/ui/constants/attendance_type.dart'; 3 | 4 | class AttendanceList { 5 | DateTime dateTime; 6 | List attendanceList; 7 | final _databaseReference = FirebaseDatabase.instance.reference(); 8 | 9 | AttendanceList({this.dateTime, this.attendanceList}); 10 | 11 | DateTime get date { 12 | return dateTime; 13 | } 14 | 15 | List get listOfAttendance { 16 | return attendanceList; 17 | } 18 | 19 | AttendanceList.fromJson( 20 | dynamic dataSnapshot, String selectedDate, Map map) { 21 | List attendanceList = []; 22 | 23 | if (dataSnapshot != null) { 24 | dataSnapshot.cast().forEach((key, value) { 25 | attendanceType type = (key.toString().split('-')[0] == "in") 26 | ? attendanceType.IN 27 | : (key.toString().split('-')[0] == "out" 28 | ? attendanceType.OUT 29 | : attendanceType.UNDETERMINED); 30 | String formattedString = selectedDate.split("-").reversed.join("-"); 31 | formattedString = formattedString + " ${value["time"]}"; 32 | DateTime time = DateTime.parse(formattedString); 33 | 34 | attendanceList.add( 35 | Attendance(type: type, time: time, office: map[value["office"]])); 36 | }); 37 | } 38 | this.attendanceList = attendanceList; 39 | } 40 | } 41 | 42 | class Attendance { 43 | attendanceType type; 44 | DateTime time; 45 | String office; 46 | 47 | Attendance({this.type, this.time, this.office}); 48 | } 49 | -------------------------------------------------------------------------------- /lib/src/models/leave.dart: -------------------------------------------------------------------------------- 1 | import '../ui/constants/leave_type.dart'; 2 | 3 | class Leave { 4 | String key; 5 | DateTime appliedDate; 6 | DateTime fromDate; 7 | DateTime toDate; 8 | LeaveStatus status; 9 | bool withdrawalStatus; 10 | String message; 11 | LeaveType type; 12 | String name; 13 | String userUid; 14 | 15 | Leave( 16 | {this.name, 17 | this.key, 18 | this.appliedDate, 19 | this.fromDate, 20 | this.toDate, 21 | this.type, 22 | this.status, 23 | this.withdrawalStatus, 24 | this.message, 25 | this.userUid 26 | }); 27 | 28 | factory Leave.fromJson(String key, Map parsedJson) { 29 | return Leave( 30 | key: key, 31 | appliedDate: formattedProperDateTime(parsedJson['appliedDate']), 32 | fromDate: formattedProperDateTime(parsedJson['fromDate']), 33 | toDate: formattedProperDateTime(parsedJson['toDate']), 34 | type: getType(parsedJson['type']), 35 | status: getStatus(parsedJson['status']), 36 | withdrawalStatus: (0 != parsedJson['withdrawalStatus']), 37 | message: parsedJson['message'] == "" ? "none" : parsedJson['message'], 38 | ); 39 | } 40 | } 41 | 42 | DateTime formattedProperDateTime(String date) { 43 | return DateTime.parse( 44 | date.toString().split("-").reversed.join("-").toString() + " 01:00:00"); 45 | } 46 | 47 | LeaveType getType(String type) { 48 | if (type == "al") { 49 | return LeaveType.al; 50 | } 51 | if (type == "cl") { 52 | return LeaveType.cl; 53 | } 54 | if (type == "ml") { 55 | return LeaveType.ml; 56 | } 57 | return LeaveType.undetermined; 58 | } 59 | 60 | LeaveStatus getStatus(String status) { 61 | if (status == "approved") { 62 | return LeaveStatus.approved; 63 | } 64 | if (status == "pending") { 65 | return LeaveStatus.pending; 66 | } 67 | if (status == "rejected") { 68 | return LeaveStatus.rejected; 69 | } 70 | return LeaveStatus.undetermined; 71 | } 72 | -------------------------------------------------------------------------------- /lib/src/models/office.dart: -------------------------------------------------------------------------------- 1 | class Office { 2 | String key; 3 | double latitude; 4 | double longitude; 5 | String name; 6 | double radius; 7 | 8 | Office({this.key, this.name, this.latitude, this.longitude, this.radius}); 9 | 10 | double get getLatitude { 11 | return latitude; 12 | } 13 | 14 | double get getLongitude { 15 | return longitude; 16 | } 17 | 18 | String get getName { 19 | return name; 20 | } 21 | 22 | double get getRadius { 23 | return radius; 24 | } 25 | 26 | String get getKey { 27 | return key; 28 | } 29 | 30 | factory Office.fromJson(String key, Map parsedJson) { 31 | return Office( 32 | key: key, 33 | latitude: parsedJson['latitude'], 34 | longitude: parsedJson['longitude'], 35 | name: parsedJson['name'], 36 | radius: parsedJson['radius']); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/models/user.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_database/firebase_database.dart'; 2 | 3 | import 'office.dart'; 4 | 5 | enum Gender { Male, Female, Other } 6 | 7 | enum SkillCategory { 8 | // TODO 9 | Unskilled, 10 | Skilled 11 | } 12 | 13 | enum EmployeeFunction { 14 | // TODO 15 | ADD_HERE 16 | } 17 | 18 | enum EmployeeSubFunction { 19 | // TODO 20 | ADD_HERE 21 | } 22 | 23 | enum Grade { 24 | // TODO 25 | ADD_HERE 26 | } 27 | 28 | enum Designation { 29 | // TODO 30 | ADD_HERE 31 | } 32 | 33 | enum Nationality { 34 | Afghan, 35 | Albanian, 36 | Algerian, 37 | American, 38 | Andorran, 39 | Angolan, 40 | Antiguans, 41 | Argentinean, 42 | Armenian, 43 | Australian, 44 | Austrian, 45 | Azerbaijani, 46 | Bahamian, 47 | Bahraini, 48 | Bangladeshi, 49 | Barbadian, 50 | Barbudans, 51 | Batswana, 52 | Belarusian, 53 | Belgian, 54 | Belizean, 55 | Beninese, 56 | Bhutanese, 57 | Bolivian, 58 | Bosnian, 59 | Brazilian, 60 | British, 61 | Bruneian, 62 | Bulgarian, 63 | Burkinabe, 64 | Burmese, 65 | Burundian, 66 | Cambodian, 67 | Cameroonian, 68 | Canadian, 69 | Cape, 70 | Verdean, 71 | Central_African, 72 | Chadian, 73 | Chilean, 74 | Chinese, 75 | Colombian, 76 | Comoran, 77 | Congolese, 78 | Costa_Rican, 79 | Croatian, 80 | Cuban, 81 | Cypriot, 82 | Czech, 83 | Danish, 84 | Djibouti, 85 | Dominican, 86 | Dutch, 87 | East_Timorese, 88 | Ecuadorean, 89 | Egyptian, 90 | Emirian, 91 | Equatorial_Guinean, 92 | Eritrean, 93 | Estonian, 94 | Ethiopian, 95 | Fijian, 96 | Filipino, 97 | Finnish, 98 | French, 99 | Gabonese, 100 | Gambian, 101 | Georgian, 102 | German, 103 | Ghanaian, 104 | Greek, 105 | Grenadian, 106 | Guatemalan, 107 | Guinea_Bissauan, 108 | Guinean, 109 | Guyanese, 110 | Haitian, 111 | Herzegovinian, 112 | Honduran, 113 | Hungarian, 114 | I_Kiribati, 115 | Icelander, 116 | Indian, 117 | Indonesian, 118 | Iranian, 119 | Iraqi, 120 | Irish, 121 | Israeli, 122 | Italian, 123 | Ivorian, 124 | Jamaican, 125 | Japanese, 126 | Jordanian, 127 | Kazakhstani, 128 | Kenyan, 129 | Kittian_and_Nevisian, 130 | Kuwaiti, 131 | Kyrgyz, 132 | Laotian, 133 | Latvian, 134 | Lebanese, 135 | Liberian, 136 | Libyan, 137 | Liechtensteiner, 138 | Lithuanian, 139 | Luxembourger, 140 | Macedonian, 141 | Malagasy, 142 | Malawian, 143 | Malaysian, 144 | Maldivian, 145 | Malian, 146 | Maltese, 147 | Marshallese, 148 | Mauritanian, 149 | Mauritian, 150 | Mexican, 151 | Micronesian, 152 | Moldovan, 153 | Monacan, 154 | Mongolian, 155 | Moroccan, 156 | Mosotho, 157 | Motswana, 158 | Mozambican, 159 | Namibian, 160 | Nauruan, 161 | Nepalese, 162 | New_Zealander, 163 | Ni_Vanuatu, 164 | Nicaraguan, 165 | Nigerian, 166 | Nigerien, 167 | North_Korean, 168 | Northern_Irish, 169 | Norwegian, 170 | Omani, 171 | Pakistani, 172 | Palauan, 173 | Panamanian, 174 | Papua_New_Guinean, 175 | Paraguayan, 176 | Peruvian, 177 | Polish, 178 | Portuguese, 179 | Qatari, 180 | Romanian, 181 | Russian, 182 | Rwandan, 183 | Saint_Lucian, 184 | Salvadoran, 185 | Samoan, 186 | San_Marinese, 187 | Sao_Tomean, 188 | Saudi, 189 | Scottish, 190 | Senegalese, 191 | Serbian, 192 | Seychellois, 193 | Sierra_Leonean, 194 | Singaporean, 195 | Slovakian, 196 | Slovenian, 197 | Solomon_Islander, 198 | Somali, 199 | South_African, 200 | South_Korean, 201 | Spanish, 202 | Sri_Lankan, 203 | Sudanese, 204 | Surinamer, 205 | Swazi, 206 | Swedish, 207 | Swiss, 208 | Syrian, 209 | Taiwanese, 210 | Tajik, 211 | Tanzanian, 212 | Thai, 213 | Togolese, 214 | Tongan, 215 | Trinidadian_or_Tobagonian, 216 | Tunisian, 217 | Turkish, 218 | Tuvaluan, 219 | Ugandan, 220 | Ukrainian, 221 | Uruguayan, 222 | Uzbekistani, 223 | Venezuelan, 224 | Vietnamese, 225 | Welsh, 226 | Yemenite, 227 | Zambian, 228 | Zimbabwean 229 | } 230 | 231 | enum MaritalStatus { 232 | Unmarried, 233 | Married, 234 | ItsComplicated, 235 | } 236 | 237 | enum Religion { 238 | African_Traditional, 239 | Agnostic, 240 | Atheist, 241 | Bahai, 242 | Buddhism, 243 | Cao_Dai, 244 | Chinese_traditional_religion, 245 | Christianity, 246 | Hinduism, 247 | Islam, 248 | Jainism, 249 | Juche, 250 | Judaism, 251 | Neo_Paganism, 252 | Non_religious, 253 | Rastafarianism, 254 | Secular, 255 | Shinto, 256 | Sikhism, 257 | Spiritism, 258 | Tenrikyo, 259 | Unitarian_Universalism, 260 | Zoroastrianism, 261 | Primal_indigenous, 262 | Other 263 | } 264 | 265 | enum Entity { 266 | //TODO 267 | ADD_HERE 268 | } 269 | 270 | enum BloodGroup { 271 | A_positive, 272 | A_negative, 273 | B_positive, 274 | B_negative, 275 | AB_positive, 276 | O_positive, 277 | O_negative 278 | } 279 | 280 | enum EmployeeType { Trainee, Manager } 281 | 282 | enum Role { 283 | // TODO 284 | ADD_HERE 285 | } 286 | 287 | class Employee { 288 | String uID; 289 | String employeeID; 290 | String firstName; 291 | String middleName; 292 | String lastName; 293 | String officeEmail; 294 | String alternateEmail; 295 | String contactNumber; 296 | DateTime dateOfBirth; 297 | DateTime joiningDate; 298 | String residentialAddress; 299 | Gender gender; 300 | int retirementAge; 301 | 302 | Office joiningUnit; 303 | SkillCategory skillCategory; 304 | 305 | EmployeeFunction employeeFunction; 306 | EmployeeSubFunction employeeSubFunction; 307 | 308 | Grade grade; 309 | String designation; 310 | 311 | MaritalStatus maritalStatus; 312 | Religion religion; 313 | 314 | Nationality nationality; 315 | 316 | Entity entity; 317 | BloodGroup bloodGroup; 318 | 319 | EmployeeType employeeType; 320 | Employee reviewPerson; 321 | 322 | Role role; 323 | 324 | Employee( 325 | {this.employeeID, 326 | this.firstName, 327 | this.middleName, 328 | this.lastName, 329 | this.residentialAddress, 330 | this.contactNumber, 331 | this.officeEmail, 332 | this.alternateEmail, 333 | this.dateOfBirth, 334 | this.joiningDate, 335 | this.gender, 336 | this.retirementAge, 337 | this.joiningUnit, 338 | this.skillCategory, 339 | this.employeeFunction, 340 | this.employeeSubFunction, 341 | this.grade, 342 | this.designation, 343 | this.maritalStatus, 344 | this.religion, 345 | this.nationality, 346 | this.entity, 347 | this.bloodGroup, 348 | this.employeeType, 349 | this.reviewPerson, 350 | this.role}); 351 | 352 | Employee.fromSnapshot(DataSnapshot snapshot) 353 | : uID = snapshot.value["UID"], 354 | employeeID = snapshot.value["employeeID"], 355 | firstName = snapshot.value["firstName"], 356 | middleName = snapshot.value["middleName"], 357 | lastName = snapshot.value["lastName"], 358 | officeEmail = snapshot.value["officeEmail"], 359 | alternateEmail = snapshot.value["alternateEmail"], 360 | dateOfBirth = snapshot.value["dateOfBirth"], 361 | joiningDate = snapshot.value["joiningDate"], 362 | gender = snapshot.value["gender"], 363 | retirementAge = snapshot.value["retirementAge"], 364 | joiningUnit = snapshot.value["joiningUnit"], 365 | skillCategory = snapshot.value["skillCategory"], 366 | employeeFunction = snapshot.value["employeeFunction"], 367 | employeeSubFunction = snapshot.value["employeeSubFunction"], 368 | grade = snapshot.value["grade"], 369 | designation = snapshot.value["designation"], 370 | maritalStatus = snapshot.value["maritalStatus"], 371 | religion = snapshot.value["religion"], 372 | nationality = snapshot.value["nationality"], 373 | entity = snapshot.value["entity"], 374 | bloodGroup = snapshot.value["bloodGroup"], 375 | employeeType = snapshot.value["employeeType"], 376 | reviewPerson = snapshot.value["reviewPerson"], 377 | role = snapshot.value["role"]; 378 | 379 | toJson() { 380 | return { 381 | "employeeID": employeeID, 382 | "firstName": firstName, 383 | "middleName": middleName, 384 | "lastName": lastName, 385 | "officeEmail": officeEmail, 386 | "alternateEmail": alternateEmail, 387 | "dateOfBirth": dateOfBirth, 388 | "joiningDate": joiningDate, 389 | "gender": gender, 390 | "retirementAge": retirementAge, 391 | "joiningUnit": joiningUnit, 392 | "skillCategory": skillCategory, 393 | "employeeFunction": employeeFunction, 394 | "employeeSubFunction": employeeSubFunction, 395 | "grade": grade, 396 | "designation": designation, 397 | "maritalStatus": maritalStatus, 398 | "religion": religion, 399 | "nationality": nationality, 400 | "entity": entity, 401 | "bloodGroup": bloodGroup, 402 | "employeeType": employeeType, 403 | "reviewPerson": reviewPerson, 404 | "role": role, 405 | }; 406 | } 407 | } 408 | -------------------------------------------------------------------------------- /lib/src/services/attendance_mark.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:geo_attendance_system/src/models/office.dart'; 4 | import 'package:geo_attendance_system/src/ui/widgets/Info_dialog_box.dart'; 5 | import 'package:location/location.dart'; 6 | 7 | import 'current_date.dart'; 8 | import 'fetch_attendance.dart'; 9 | import 'geofence.dart'; 10 | 11 | String findLatestIn(listOfAttendanceIterable) { 12 | List finalList = listOfAttendanceIterable 13 | .where((attendance) => attendance.toString().substring(0, 2) == "in") 14 | .toList(); 15 | 16 | if (finalList.length == 0) return ""; 17 | 18 | finalList.sort((a, b) { 19 | String time1 = a.toString().split("-")[1]; 20 | String time2 = b.toString().split("-")[1]; 21 | return time1.compareTo(time2); 22 | }); 23 | 24 | return finalList.last.toString().split("-")[1]; 25 | } 26 | 27 | String findLatestOut(listOfAttendanceIterable) { 28 | List finalList = listOfAttendanceIterable 29 | .where((attendance) => attendance.toString().substring(0, 3) == "out") 30 | .toList(); 31 | 32 | if (finalList.length == 0) return ""; 33 | 34 | finalList.sort((a, b) { 35 | String time1 = a.toString().split("-")[1]; 36 | String time2 = b.toString().split("-")[1]; 37 | return time1.compareTo(time2); 38 | }); 39 | 40 | return finalList.last.toString().split("-")[1]; 41 | } 42 | 43 | String findFirstIn(listOfAttendanceIterable) { 44 | List finalList = listOfAttendanceIterable 45 | .where((attendance) => attendance.toString().substring(0, 2) == "in") 46 | .toList(); 47 | 48 | if (finalList.length == 0) return ""; 49 | finalList.sort((a, b) { 50 | String time1 = a.toString().split("-")[1]; 51 | String time2 = b.toString().split("-")[1]; 52 | return time1.compareTo(time2); 53 | }); 54 | 55 | return finalList.first.toString().split("-")[1]; 56 | } 57 | 58 | String findFirstOut(listOfAttendanceIterable) { 59 | List finalList = listOfAttendanceIterable 60 | .where((attendance) => attendance.toString().substring(0, 3) == "out") 61 | .toList(); 62 | 63 | if (finalList.length == 0) return ""; 64 | 65 | finalList.sort((a, b) { 66 | String time1 = a.toString().split("-")[1]; 67 | String time2 = b.toString().split("-")[1]; 68 | return time1.compareTo(time2); 69 | }); 70 | 71 | return finalList.first.toString().split("-")[1]; 72 | } 73 | 74 | bool checkSuccessiveIn(listOfAttendanceIterable) { 75 | if (listOfAttendanceIterable.length > 0) { 76 | String lastOut = findLatestOut(listOfAttendanceIterable); 77 | String lastIn = findLatestIn(listOfAttendanceIterable); 78 | 79 | if (lastIn == "" || (lastOut != "" && lastIn.compareTo(lastOut) <= 0)) 80 | return true; 81 | else 82 | return false; 83 | } 84 | return true; 85 | } 86 | 87 | bool checkSuccessiveOut(listOfAttendanceIterable) { 88 | if (listOfAttendanceIterable.length > 0) { 89 | String lastOut = findLatestOut(listOfAttendanceIterable); 90 | String lastIn = findLatestIn(listOfAttendanceIterable); 91 | 92 | if (lastOut == "" || (lastIn != "" && lastOut.compareTo(lastIn) <= 0)) 93 | return true; 94 | else 95 | return false; 96 | } 97 | return true; 98 | } 99 | 100 | void markInAttendance(BuildContext context, Office office, 101 | LocationData currentPosition, FirebaseUser user) async { 102 | Future.delayed(Duration(seconds: 1), () { 103 | DateTime dateToday = getTodayDate(); 104 | AttendanceDatabase.getAttendanceOfParticularDateBasedOnUID( 105 | user.uid, dateToday) 106 | .then((snapshot) { 107 | Navigator.of(context, rootNavigator: true).pop('dialog'); 108 | bool isFeasible = true; 109 | String errorMessage = ""; 110 | if (snapshot != null) { 111 | var listOfAttendanceIterable = snapshot.keys; 112 | if (listOfAttendanceIterable.length > 0 && 113 | !checkSuccessiveIn(listOfAttendanceIterable)) { 114 | isFeasible = false; 115 | errorMessage = "Not Allowed to Mark In Successively"; 116 | } 117 | } 118 | 119 | if (isFeasible && 120 | (GeoFenceClass.geofenceState == "GeofenceEvent.dwell" || 121 | GeoFenceClass.geofenceState == "GeofenceEvent.enter")) { 122 | AttendanceDatabase.markAttendance(user.uid, dateToday, office, "in") 123 | .then((_) { 124 | showDialogTemplate( 125 | context, 126 | "Attendance Info", 127 | "Marked \nStatus: ${GeoFenceClass.geofenceState}", 128 | "assets/gif/tick.gif", 129 | Color.fromRGBO(51, 205, 187, 1.0), 130 | "Great"); 131 | }); 132 | } else { 133 | if (isFeasible) errorMessage = "Out of the alloted Location!"; 134 | showDialogTemplate( 135 | context, 136 | "Attendance Info", 137 | "$errorMessage\nStatus: ${GeoFenceClass.geofenceState}", 138 | "assets/gif/close.gif", 139 | Color.fromRGBO(200, 71, 108, 1.0), 140 | "Oops!"); 141 | } 142 | }); 143 | }); 144 | } 145 | 146 | void markOutAttendance(BuildContext context, Office office, 147 | LocationData currentPosition, FirebaseUser user) async { 148 | Future.delayed(Duration(seconds: 1), () { 149 | DateTime dateToday = getTodayDate(); 150 | AttendanceDatabase.getAttendanceOfParticularDateBasedOnUID( 151 | user.uid, dateToday) 152 | .then((snapshot) { 153 | Navigator.of(context, rootNavigator: true).pop('dialog'); 154 | bool isFeasible = true; 155 | String errorMessage = ""; 156 | 157 | if (snapshot != null) { 158 | var listOfAttendanceIterable = snapshot.keys; 159 | if (listOfAttendanceIterable.length > 0 && 160 | !checkSuccessiveOut(listOfAttendanceIterable)) { 161 | isFeasible = false; 162 | errorMessage = "Not Allowed to Mark Out Successively"; 163 | } else if (listOfAttendanceIterable.length == 0) { 164 | isFeasible = false; 165 | errorMessage = "No IN-Entry Found!"; 166 | } 167 | } else { 168 | isFeasible = false; 169 | errorMessage = "No IN-Entry Found!"; 170 | } 171 | 172 | if (isFeasible && 173 | (GeoFenceClass.geofenceState == "GeofenceEvent.dwell" || 174 | GeoFenceClass.geofenceState == "GeofenceEvent.enter")) { 175 | AttendanceDatabase.markAttendance(user.uid, dateToday, office, "out") 176 | .then((_) { 177 | showDialogTemplate( 178 | context, 179 | "Attendance Info", 180 | "Marked \nStatus: ${GeoFenceClass.geofenceState}", 181 | "assets/gif/tick.gif", 182 | Color.fromRGBO(51, 205, 187, 1.0), 183 | "Great"); 184 | }); 185 | } else { 186 | if (isFeasible) errorMessage = "Out of the alloted Location!"; 187 | showDialogTemplate( 188 | context, 189 | "Attendance Info", 190 | "$errorMessage\nStatus: ${GeoFenceClass.geofenceState}", 191 | "assets/gif/close.gif", 192 | Color.fromRGBO(200, 71, 108, 1.0), 193 | "Oops!"); 194 | } 195 | }); 196 | }); 197 | } 198 | -------------------------------------------------------------------------------- /lib/src/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); 8 | 9 | Future getCurrentUser(); 10 | 11 | Future sendEmailVerification(); 12 | 13 | Future signOut(); 14 | 15 | Future isEmailVerified(); 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; 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 | } -------------------------------------------------------------------------------- /lib/src/services/check_file.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:isolate'; 3 | import 'dart:ui'; 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:geofencing/geofencing.dart'; 7 | 8 | 9 | class MyApp extends StatefulWidget { 10 | @override 11 | _MyAppState createState() => _MyAppState(); 12 | } 13 | 14 | class _MyAppState extends State { 15 | String geofenceState = 'N/A'; 16 | double latitude = 31.1471305; 17 | double longitude = 75.34121789999999; 18 | double radius = 150.0; 19 | 20 | 21 | ReceivePort port = ReceivePort(); 22 | final List triggers = [ 23 | GeofenceEvent.enter, 24 | GeofenceEvent.dwell, 25 | GeofenceEvent.exit 26 | ]; 27 | final AndroidGeofencingSettings androidSettings = AndroidGeofencingSettings( 28 | initialTrigger: [ 29 | GeofenceEvent.enter, 30 | GeofenceEvent.exit, 31 | GeofenceEvent.dwell 32 | ], 33 | loiteringDelay: 1000 * 60); 34 | 35 | @override 36 | void initState() { 37 | super.initState(); 38 | IsolateNameServer.registerPortWithName( 39 | port.sendPort, 'geofencing_send_port'); 40 | port.listen((dynamic data) { 41 | print('Event: $data'); 42 | setState(() { 43 | geofenceState = data; 44 | }); 45 | }); 46 | initPlatformState(); 47 | } 48 | 49 | static void callback(List ids, Location l, GeofenceEvent e) async { 50 | print('Fences: $ids Location $l Event: $e'); 51 | final SendPort send = 52 | IsolateNameServer.lookupPortByName('geofencing_send_port'); 53 | send?.send(e.toString()); 54 | } 55 | 56 | // Platform messages are asynchronous, so we initialize in an async method. 57 | Future initPlatformState() async { 58 | print('Initializing...'); 59 | await GeofencingManager.initialize(); 60 | print('Initialization done'); 61 | } 62 | 63 | String numberValidator(String value) { 64 | if (value == null) { 65 | return null; 66 | } 67 | final num a = num.tryParse(value); 68 | if (a == null) { 69 | return '"$value" is not a valid number'; 70 | } 71 | return null; 72 | } 73 | 74 | @override 75 | Widget build(BuildContext context) { 76 | return MaterialApp( 77 | home: Scaffold( 78 | appBar: AppBar( 79 | title: const Text('Flutter Geofencing Example'), 80 | ), 81 | body: Container( 82 | padding: const EdgeInsets.all(20.0), 83 | child: Column( 84 | mainAxisAlignment: MainAxisAlignment.center, 85 | children: [ 86 | Text('Current state: $geofenceState'), 87 | Center( 88 | child: RaisedButton( 89 | child: const Text('Register'), 90 | onPressed: () { 91 | if (latitude == null) { 92 | setState(() => latitude = 0.0); 93 | } 94 | if (longitude == null) { 95 | setState(() => longitude = 0.0); 96 | } 97 | if (radius == null) { 98 | setState(() => radius = 0.0); 99 | } 100 | GeofencingManager.registerGeofence( 101 | GeofenceRegion( 102 | 'mtv', latitude, longitude, radius, triggers, 103 | androidSettings: androidSettings), 104 | callback); 105 | }, 106 | ), 107 | ), 108 | Center( 109 | child: RaisedButton( 110 | child: const Text('Unregister'), 111 | onPressed: () => 112 | GeofencingManager.removeGeofenceById('mtv')), 113 | ), 114 | TextField( 115 | decoration: const InputDecoration( 116 | hintText: 'Latitude', 117 | ), 118 | keyboardType: TextInputType.number, 119 | controller: 120 | TextEditingController(text: latitude.toString()), 121 | onChanged: (String s) { 122 | latitude = double.tryParse(s); 123 | }, 124 | ), 125 | TextField( 126 | decoration: 127 | const InputDecoration(hintText: 'Longitude'), 128 | keyboardType: TextInputType.number, 129 | controller: 130 | TextEditingController(text: longitude.toString()), 131 | onChanged: (String s) { 132 | longitude = double.tryParse(s); 133 | }), 134 | TextField( 135 | decoration: const InputDecoration(hintText: 'Radius'), 136 | keyboardType: TextInputType.number, 137 | controller: 138 | TextEditingController(text: radius.toString()), 139 | onChanged: (String s) { 140 | radius = double.tryParse(s); 141 | }), 142 | ]))), 143 | ); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /lib/src/services/current_date.dart: -------------------------------------------------------------------------------- 1 | DateTime getTodayDate() { 2 | DateTime dateToday = DateTime( 3 | DateTime.now().year, 4 | DateTime.now().month, 5 | DateTime.now().day, 6 | DateTime.now().hour, 7 | DateTime.now().minute, 8 | DateTime.now().second); 9 | return dateToday; 10 | } 11 | -------------------------------------------------------------------------------- /lib/src/services/fetch_IMEI.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:device_info/device_info.dart'; 4 | import 'package:flutter/services.dart'; 5 | 6 | Future> getDeviceDetails() async { 7 | String deviceName; 8 | String deviceVersion; 9 | String identifier; 10 | final DeviceInfoPlugin deviceInfoPlugin = new DeviceInfoPlugin(); 11 | try { 12 | if (Platform.isAndroid) { 13 | var build = await deviceInfoPlugin.androidInfo; 14 | deviceName = build.model; 15 | deviceVersion = build.version.toString(); 16 | identifier = build.androidId; //UUID for Android 17 | } else if (Platform.isIOS) { 18 | var data = await deviceInfoPlugin.iosInfo; 19 | deviceName = data.name; 20 | deviceVersion = data.systemVersion; 21 | identifier = data.identifierForVendor; //UUID for iOS 22 | } 23 | } on PlatformException { 24 | print('Failed to get platform version'); 25 | } 26 | 27 | //if (!mounted) return; 28 | return [deviceName, deviceVersion, identifier]; 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/services/fetch_attendance.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_database/firebase_database.dart'; 4 | import 'package:geo_attendance_system/src/models/AttendaceList.dart'; 5 | import 'package:geo_attendance_system/src/models/office.dart'; 6 | 7 | String getDoubleDigit(String value) { 8 | if (value.length >= 2) return value; 9 | return "0" + value; 10 | } 11 | 12 | String getFormattedDate(DateTime day) { 13 | String formattedDate = getDoubleDigit(day.day.toString()) + 14 | "-" + 15 | getDoubleDigit(day.month.toString()) + 16 | "-" + 17 | getDoubleDigit(day.year.toString()); 18 | return formattedDate; 19 | } 20 | 21 | String getFormattedTime(DateTime day) { 22 | String time = getDoubleDigit(day.hour.toString()) + 23 | ":" + 24 | getDoubleDigit(day.minute.toString()) + 25 | ":" + 26 | getDoubleDigit(day.second.toString()); 27 | 28 | return time; 29 | } 30 | 31 | class AttendanceDatabase { 32 | static final _databaseReference = FirebaseDatabase.instance.reference(); 33 | static final AttendanceDatabase _instance = AttendanceDatabase._internal(); 34 | 35 | factory AttendanceDatabase() { 36 | return _instance; 37 | } 38 | 39 | AttendanceDatabase._internal(); 40 | 41 | static Future getAttendanceBasedOnUID(String uid) async { 42 | DataSnapshot dataSnapshot = 43 | await _databaseReference.child("Attendance").child(uid).once(); 44 | return dataSnapshot; 45 | } 46 | 47 | static Future getAttendanceOfParticularDateBasedOnUID( 48 | String uid, DateTime dateTime) async { 49 | DataSnapshot snapshot = await getAttendanceBasedOnUID(uid); 50 | String formattedDate = getFormattedDate(dateTime); 51 | return snapshot.value == null ? null : snapshot.value[formattedDate]; 52 | } 53 | 54 | static Future> getOfficeFromID() async { 55 | DataSnapshot dataSnapshot = 56 | await _databaseReference.child("location").once(); 57 | Map map = new Map(); 58 | 59 | dataSnapshot.value.forEach((key, value) { 60 | map[key] = value["name"]; 61 | }); 62 | return map; 63 | } 64 | 65 | static Future getAttendanceListOfParticularDateBasedOnUID( 66 | String uid, DateTime dateTime) async { 67 | var snapshot = await getAttendanceOfParticularDateBasedOnUID(uid, dateTime); 68 | var mapOfOffice = await getOfficeFromID(); 69 | AttendanceList attendanceList = AttendanceList.fromJson( 70 | snapshot, getFormattedDate(dateTime), mapOfOffice); 71 | attendanceList.dateTime = dateTime; 72 | 73 | return attendanceList != null ? attendanceList : []; 74 | } 75 | 76 | static Future markAttendance( 77 | String uid, DateTime dateTime, Office office, String markType) async { 78 | String time = getFormattedTime(dateTime); 79 | String date = getFormattedDate(dateTime); 80 | var json = { 81 | "office": office.getKey, 82 | "time": time, 83 | }; 84 | String markChild = markType + "-" + time; 85 | return _databaseReference 86 | .reference() 87 | .child("Attendance") 88 | .child(uid) 89 | .child(date) 90 | .child(markChild) 91 | .update(json); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/src/services/fetch_leaves.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_database/firebase_database.dart'; 4 | import 'package:geo_attendance_system/src/models/leave.dart'; 5 | 6 | class LeaveDatabase { 7 | final _databaseReference = FirebaseDatabase.instance.reference(); 8 | static final LeaveDatabase _instance = LeaveDatabase._internal(); 9 | 10 | factory LeaveDatabase() { 11 | return _instance; 12 | } 13 | 14 | LeaveDatabase._internal(); 15 | 16 | // Future getLeavesBasedOnUID(String uid) async { 17 | // DataSnapshot dataSnapshot = await _databaseReference.child("users").once(); 18 | // final userInfo = dataSnapshot.value[uid]; 19 | // final office = userInfo["alloted_office"]; 20 | // 21 | // dataSnapshot = await _databaseReference.child("location").once(); 22 | // final findOffice = dataSnapshot.value[office]; 23 | // final name = findOffice["name"]; 24 | // final latitude = findOffice["latitude"]; 25 | // final longitude = findOffice["longitude"]; 26 | // final radius = findOffice["radius"].toDouble(); 27 | // return Leave( 28 | // key: office, 29 | // name: name, 30 | // latitude: latitude, 31 | // longitude: longitude, 32 | // radius: radius); 33 | // } 34 | 35 | Future> getLeaveListBasedOnUID(String uid) async { 36 | DataSnapshot dataSnapshot = 37 | await _databaseReference.child("leaves").child(uid).once(); 38 | List result = []; 39 | if (dataSnapshot == null || dataSnapshot.value == null) return result; 40 | 41 | var officeMap = dataSnapshot.value; 42 | officeMap.forEach((key, map) { 43 | result.add(Leave.fromJson(key, map.cast())); 44 | }); 45 | 46 | return result; 47 | } 48 | 49 | Future withDrawLeave(String key, String uid) async { 50 | var json = {"withdrawalStatus": 1}; 51 | _databaseReference.child("leaves").child(uid).child(key).update(json); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/src/services/fetch_offices.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_database/firebase_database.dart'; 4 | import 'package:geo_attendance_system/src/models/office.dart'; 5 | 6 | class OfficeDatabase { 7 | final _databaseReference = FirebaseDatabase.instance.reference(); 8 | static final OfficeDatabase _instance = OfficeDatabase._internal(); 9 | 10 | factory OfficeDatabase() { 11 | return _instance; 12 | } 13 | 14 | OfficeDatabase._internal(); 15 | 16 | Future getOfficeBasedOnUID(String uid) async { 17 | DataSnapshot dataSnapshot = await _databaseReference.child("users").once(); 18 | final userInfo = dataSnapshot.value[uid]; 19 | final office = userInfo["alloted_office"]; 20 | 21 | dataSnapshot = await _databaseReference.child("location").once(); 22 | final findOffice = dataSnapshot.value[office]; 23 | final latitude = findOffice["latitude"]; 24 | final longitude = findOffice["longitude"]; 25 | final name = findOffice["name"]; 26 | final radius = 27 | findOffice["radius"] == null ? 200.0 : findOffice["radius"].toDouble(); 28 | 29 | return Office( 30 | key: office, 31 | latitude: latitude, 32 | longitude: longitude, 33 | name: name, 34 | radius: radius); 35 | } 36 | 37 | Future> getOfficeList() async { 38 | DataSnapshot dataSnapshot = await _databaseReference.once(); 39 | Completer> completer; 40 | final officeList = dataSnapshot.value["location"]; 41 | List result = []; 42 | 43 | var officeMap = officeList; 44 | officeMap.forEach((key, map) { 45 | result.add(Office.fromJson(key, map.cast())); 46 | }); 47 | 48 | return result; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/services/fetch_pending_leaves.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_database/firebase_database.dart'; 4 | import 'package:geo_attendance_system/src/models/leave.dart'; 5 | import 'package:geo_attendance_system/src/ui/constants/leave_type.dart'; 6 | 7 | import 'fetch_leaves.dart'; 8 | 9 | class ReviewLeaveDatabase { 10 | final _databaseReference = FirebaseDatabase.instance.reference(); 11 | static final ReviewLeaveDatabase _instance = ReviewLeaveDatabase._internal(); 12 | final LeaveDatabase leaveDatabase = new LeaveDatabase(); 13 | 14 | factory ReviewLeaveDatabase() { 15 | return _instance; 16 | } 17 | 18 | ReviewLeaveDatabase._internal(); 19 | 20 | Future listOfAllLeaves() async { 21 | DataSnapshot dataSnapshot = await _databaseReference.child("leaves").once(); 22 | return dataSnapshot.value; 23 | } 24 | 25 | Future listOfAllUsers() async { 26 | DataSnapshot dataSnapshot = await _databaseReference.child("users").once(); 27 | return dataSnapshot.value; 28 | } 29 | 30 | Future> getLeaveListBasedOnUID(String uid) async { 31 | DataSnapshot dataSnapshot = 32 | await _databaseReference.child("Managers").child(uid).once(); 33 | List result = []; 34 | if (dataSnapshot == null) return result; 35 | var dataMap = dataSnapshot.value; 36 | var listOfUsers = await listOfAllUsers(); 37 | var listOfLeaves = await listOfAllLeaves(); 38 | 39 | if (dataMap != null) 40 | dataMap.forEach((uid, map) { 41 | print("UID " + uid.toString()); 42 | String nameOfUser = listOfUsers[uid]["Name"]; 43 | 44 | if (listOfLeaves != null && listOfLeaves[uid] != null) 45 | listOfLeaves[uid].forEach((leaveId, leaveMap) { 46 | Leave _leave = 47 | Leave.fromJson(leaveId, leaveMap.cast()); 48 | _leave.name = nameOfUser; 49 | _leave.userUid = uid; 50 | result.add(_leave); 51 | }); 52 | }); 53 | 54 | return result; 55 | } 56 | 57 | Future approveLeave( 58 | String key, String uid, int days, LeaveType leaveType) async { 59 | DataSnapshot dataSnapshot = await _databaseReference 60 | .child("users") 61 | .child(uid) 62 | .child("leaves") 63 | .child(getLeaveType(leaveType)) 64 | .once(); 65 | await _databaseReference.child("users").child(uid).child("leaves").update({ 66 | getLeaveType(leaveType): (dataSnapshot.value - days), 67 | }); 68 | var json = {"status": "approved"}; 69 | await _databaseReference.child("leaves").child(uid).child(key).update(json); 70 | } 71 | 72 | Future rejectLeave( 73 | String key, String uid) async { 74 | var json = {"status": "rejected"}; 75 | await _databaseReference.child("leaves").child(uid).child(key).update(json); 76 | print("done"); 77 | } 78 | } 79 | 80 | String getLeaveType(LeaveType leaveType) { 81 | switch (leaveType) { 82 | case LeaveType.al: 83 | return "al"; 84 | break; 85 | 86 | case LeaveType.ml: 87 | return "ml"; 88 | break; 89 | 90 | case LeaveType.cl: 91 | return "cl"; 92 | break; 93 | 94 | case LeaveType.undetermined: 95 | return "al"; 96 | break; 97 | } 98 | return "al"; 99 | } 100 | -------------------------------------------------------------------------------- /lib/src/services/fetch_user.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_database/firebase_database.dart'; 4 | import 'package:geo_attendance_system/src/models/user.dart'; 5 | 6 | class UserDatabase { 7 | static final _databaseReference = FirebaseDatabase.instance.reference(); 8 | static final UserDatabase _instance = UserDatabase._internal(); 9 | 10 | factory UserDatabase() { 11 | return _instance; 12 | } 13 | 14 | UserDatabase._internal(); 15 | 16 | static Future getDetailsFromUID(String uid) async { 17 | DataSnapshot dataSnapshot = 18 | await _databaseReference.child("users").child(uid).once(); 19 | final profile = dataSnapshot.value; 20 | return Employee( 21 | employeeID: profile["UID"].toString(), 22 | firstName: profile["Name"], 23 | contactNumber: profile["PhoneNumber"].toString(), 24 | residentialAddress: profile["Address"], 25 | designation: profile["designation"]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/services/geofence.dart: -------------------------------------------------------------------------------- 1 | import 'dart:isolate'; 2 | import 'dart:ui'; 3 | 4 | import 'package:geo_attendance_system/src/ui/constants/geofence_controls.dart'; 5 | import 'package:geo_attendance_system/src/ui/constants/strings.dart'; 6 | import 'package:geofencing/geofencing.dart'; 7 | 8 | ReceivePort port = ReceivePort(); 9 | 10 | class GeoFenceClass { 11 | static final GeoFenceClass _singleton = GeoFenceClass._internal(); 12 | static final isolateSpawn = 13 | IsolateNameServer.registerPortWithName(port.sendPort, geofence_port_name); 14 | static String geofenceState = 'Unknown'; 15 | 16 | GeoFenceClass._internal(); 17 | 18 | factory GeoFenceClass() { 19 | return _singleton; 20 | } 21 | 22 | static Future startListening(double latitude, double longitude, 23 | [double radius = radius_geofence]) async { 24 | await GeofencingManager.registerGeofence( 25 | GeofenceRegion(fence_id, latitude, longitude, radius, triggers, 26 | androidSettings: androidSettings), 27 | callback); 28 | print(isolateSpawn); 29 | 30 | try { 31 | port.listen((dynamic data) { 32 | GeoFenceClass.geofenceState = data; 33 | print('Event: $data'); 34 | }); 35 | } catch (e) { 36 | print("Exception Occured: $e"); 37 | } 38 | } 39 | 40 | static void callback(List ids, Location l, GeofenceEvent e) async { 41 | print('Fences: $ids Location $l Event: $e'); 42 | final SendPort send = 43 | IsolateNameServer.lookupPortByName(geofence_port_name); 44 | send?.send(e.toString()); 45 | } 46 | 47 | static void closePort() { 48 | port.close(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/ui/constants/attendance_type.dart: -------------------------------------------------------------------------------- 1 | enum attendanceType { IN, OUT, UNDETERMINED } 2 | 3 | -------------------------------------------------------------------------------- /lib/src/ui/constants/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const dashBoardColor = Color.fromRGBO(105, 106, 183, 1); 4 | const splashScreenColorBottom = Color.fromRGBO(105, 106, 183, 1); 5 | const splashScreenColorTop = Color.fromRGBO(105, 106, 183, 1); 6 | const appbarcolor = Color.fromRGBO(105, 106, 183, 1); 7 | const leaveCardcolor = Color(0xFF8685E5); 8 | const globalIconColor = Color(0xFFFF5252); 9 | -------------------------------------------------------------------------------- /lib/src/ui/constants/dashboard_tile_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | import '../pages/attendance_recorder.dart'; 6 | import '../pages/attendance_summary.dart'; 7 | import '../pages/leave_application.dart'; 8 | import '../pages/leave_status.dart'; 9 | 10 | void attendanceSummaryCallback(BuildContext context, FirebaseUser user) { 11 | Navigator.push( 12 | context, 13 | CupertinoPageRoute( 14 | builder: (context) => AttendanceSummary( 15 | title: "Attendance Summary", 16 | user: user, 17 | )), 18 | ); 19 | } 20 | 21 | void attendanceRecorderCallback(BuildContext context, FirebaseUser user) { 22 | Navigator.push( 23 | context, 24 | CupertinoPageRoute( 25 | builder: (context) => AttendanceRecorderWidget(user: user))); 26 | } 27 | 28 | void leaveApplicationCallback(BuildContext context, FirebaseUser user) { 29 | Navigator.push( 30 | context, 31 | CupertinoPageRoute( 32 | builder: (context) => LeaveApplicationWidget( 33 | title: "Leave Application", 34 | user: user, 35 | ))); 36 | } 37 | 38 | void leaveStatusCallback(BuildContext context, FirebaseUser user) { 39 | Navigator.push( 40 | context, 41 | CupertinoPageRoute( 42 | builder: (context) => LeaveStatusWidget( 43 | title: "Leave Status", 44 | user: user, 45 | ))); 46 | } 47 | 48 | List infoAboutTiles = [ 49 | [ 50 | "assets/icons/attendance_recorder.png", 51 | "Attendance Recorder", 52 | "Mark your In and Out Time", 53 | attendanceRecorderCallback 54 | ], 55 | [ 56 | "assets/icons/attendance_summary.png", 57 | "Attendance Summary", 58 | "Check your previous record", 59 | attendanceSummaryCallback 60 | ], 61 | [ 62 | "assets/icons/leave_application.png", 63 | "Leaves Application", 64 | "Management", 65 | leaveApplicationCallback 66 | ], 67 | [ 68 | "assets/icons/leave_status.png", 69 | "Leaves Status", 70 | "Check pending status of leaves", 71 | leaveStatusCallback 72 | ], 73 | ]; 74 | -------------------------------------------------------------------------------- /lib/src/ui/constants/geofence_controls.dart: -------------------------------------------------------------------------------- 1 | import 'package:geofencing/geofencing.dart'; 2 | 3 | final List triggers = [ 4 | GeofenceEvent.enter, 5 | GeofenceEvent.dwell, 6 | GeofenceEvent.exit 7 | ]; 8 | final AndroidGeofencingSettings androidSettings = AndroidGeofencingSettings( 9 | initialTrigger: [ 10 | GeofenceEvent.enter, 11 | GeofenceEvent.exit, 12 | GeofenceEvent.dwell 13 | ], 14 | loiteringDelay: 60*1000); 15 | -------------------------------------------------------------------------------- /lib/src/ui/constants/leave_type.dart: -------------------------------------------------------------------------------- 1 | enum LeaveStatus { approved, pending, rejected, undetermined } 2 | enum LeaveType { ml, al, cl, undetermined } 3 | -------------------------------------------------------------------------------- /lib/src/ui/constants/strings.dart: -------------------------------------------------------------------------------- 1 | const String fence_id = "geofence_app_id"; 2 | const double radius_geofence = 150; 3 | const String geofence_port_name = "geofence_port"; 4 | -------------------------------------------------------------------------------- /lib/src/ui/pages/attendance_recorder.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:ui'; 3 | 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/services.dart'; 7 | import 'package:geo_attendance_system/src/services/attendance_mark.dart'; 8 | import 'package:geo_attendance_system/src/services/fetch_offices.dart'; 9 | import 'package:geo_attendance_system/src/services/geofence.dart'; 10 | import 'package:geo_attendance_system/src/ui/constants/colors.dart'; 11 | import 'package:geo_attendance_system/src/ui/widgets/attendance_Marker_buttons.dart'; 12 | import 'package:geo_attendance_system/src/ui/widgets/loader_dialog.dart'; 13 | import 'package:google_maps_flutter/google_maps_flutter.dart'; 14 | import 'package:location/location.dart'; 15 | 16 | class AttendanceRecorderWidget extends StatefulWidget { 17 | final FirebaseUser user; 18 | 19 | AttendanceRecorderWidget({this.user}); 20 | 21 | @override 22 | AttendanceRecorderWidgetState createState() => 23 | AttendanceRecorderWidgetState(); 24 | } 25 | 26 | class AttendanceRecorderWidgetState extends State { 27 | Completer _controller = Completer(); 28 | 29 | double zoomVal = 5.0; 30 | OfficeDatabase officeDatabase = new OfficeDatabase(); 31 | 32 | // ignore: unused_field 33 | StreamSubscription _locationSubscription; 34 | LocationData _currentLocation; 35 | LocationData _startLocation; 36 | Set _markers = {}; 37 | Set _circles = new Set(); 38 | 39 | Location _locationService = new Location(); 40 | bool _permission = false; 41 | String error; 42 | CameraPosition _currentCameraPosition; 43 | var rMin; 44 | var rMax; 45 | var direction = 1; 46 | var _radius; 47 | 48 | @override 49 | void initState() { 50 | super.initState(); 51 | initPlatformState(); 52 | } 53 | 54 | @override 55 | void dispose() { 56 | super.dispose(); 57 | if (_locationSubscription != null) _locationSubscription.cancel(); 58 | } 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | return Scaffold( 63 | appBar: AppBar( 64 | backgroundColor: appbarcolor, 65 | automaticallyImplyLeading: false, 66 | leading: new IconButton( 67 | icon: new Icon(Icons.arrow_back_ios, color: Colors.white), 68 | onPressed: () => Navigator.of(context).pop(), 69 | ), 70 | //shape: RoundedRectangleBorder( 71 | // borderRadius: BorderRadius.circular(20.0), 72 | // ), 73 | title: Text( 74 | "Mark your Attendance", 75 | style: TextStyle( 76 | color: Colors.white, 77 | fontFamily: "Poppins-Medium", 78 | fontSize: 17, 79 | letterSpacing: .6, 80 | fontWeight: FontWeight.bold), 81 | ), 82 | elevation: 0.8, 83 | centerTitle: true, 84 | bottomOpacity: 0, 85 | ), 86 | body: Stack( 87 | children: [ 88 | googleMap(context), 89 | buildContainer(context), 90 | ], 91 | ), 92 | ); 93 | } 94 | 95 | Widget googleMap(BuildContext context) { 96 | double _initialLat = 30.677515; 97 | double _initialLong = 76.743902; 98 | double _initialZoom = 15; 99 | return Container( 100 | height: MediaQuery.of(context).size.height, 101 | width: MediaQuery.of(context).size.width, 102 | child: GoogleMap( 103 | mapType: MapType.normal, 104 | myLocationEnabled: true, 105 | circles: _circles, 106 | initialCameraPosition: CameraPosition( 107 | target: LatLng(_initialLat, _initialLong), zoom: _initialZoom), 108 | markers: _markers, 109 | onMapCreated: (GoogleMapController controller) { 110 | _controller.complete(controller); 111 | officeDatabase.getOfficeBasedOnUID(widget.user.uid).then((office) { 112 | setState(() { 113 | rMax = office.radius; 114 | rMin = 3 * office.radius / 5; 115 | _radius = office.radius; 116 | Timer.periodic(new Duration(milliseconds: 100), (timer) { 117 | var radius = 118 | _circles.isEmpty ? office.radius : _circles.first.radius; 119 | 120 | if ((radius > rMax) || (radius < rMin)) { 121 | direction *= -1; 122 | } 123 | var _par = (radius / _radius) - 0.2; 124 | var radiusFinal = radius + direction * 10; 125 | if (!mounted) { 126 | timer.cancel(); 127 | return; 128 | } 129 | setState(() { 130 | _circles.clear(); 131 | _circles.add(Circle( 132 | circleId: CircleId("GeoFenceCircle"), 133 | center: LatLng(office.latitude, office.longitude), 134 | radius: radiusFinal, 135 | strokeColor: Colors.blueGrey, 136 | strokeWidth: 5, 137 | fillColor: Colors.blueGrey.withOpacity(0.6 * _par), 138 | )); 139 | }); 140 | // circleOption.fillOpacity = 0.6 * _par; 141 | 142 | // circle.setOptions(circleOption); 143 | }); 144 | }); 145 | }); 146 | }, 147 | ), 148 | ); 149 | } 150 | 151 | buildContainer(BuildContext context) { 152 | return Padding( 153 | padding: const EdgeInsets.all(80.0), 154 | child: Align( 155 | alignment: Alignment.bottomCenter, 156 | child: Row( 157 | mainAxisSize: MainAxisSize.min, 158 | children: [ 159 | inOutButton("IN", Colors.green, _callMarkInFunction), 160 | Spacer(flex: 20), 161 | inOutButton("OUT", Colors.orangeAccent, _callMarkOutFunction), 162 | ], 163 | ), 164 | ), 165 | ); 166 | } 167 | 168 | void _callMarkInFunction() { 169 | if (GeoFenceClass.geofenceState == 'Unknown') { 170 | showDialog( 171 | context: context, 172 | child: Dialog( 173 | child: Container( 174 | height: 150, 175 | decoration: BoxDecoration( 176 | color: Colors.blueAccent[100], 177 | ), 178 | child: Center( 179 | child: Text( 180 | "Kindly retry after some time!", 181 | style: TextStyle(color: Colors.black, fontSize: 22), 182 | )), 183 | ), 184 | )); 185 | } else { 186 | onLoadingDialog(context); 187 | officeDatabase.getOfficeBasedOnUID(widget.user.uid).then((office) { 188 | markInAttendance(context, office, _currentLocation, widget.user); 189 | }); 190 | } 191 | } 192 | 193 | void _callMarkOutFunction() { 194 | if (GeoFenceClass.geofenceState == 'Unknown') { 195 | showDialog( 196 | context: context, 197 | child: Dialog( 198 | child: Container( 199 | height: 150, 200 | decoration: BoxDecoration( 201 | color: Colors.blueAccent[100], 202 | ), 203 | child: Center( 204 | child: Text( 205 | "Kindly retry after some time!", 206 | style: TextStyle(color: Colors.black45, fontSize: 22), 207 | )), 208 | ), 209 | )); 210 | } else { 211 | onLoadingDialog(context); 212 | officeDatabase.getOfficeBasedOnUID(widget.user.uid).then((office) { 213 | markOutAttendance(context, office, _currentLocation, widget.user); 214 | }); 215 | } 216 | } 217 | 218 | Future _gotoLocation(double lat, double long) async { 219 | final GoogleMapController controller = await _controller.future; 220 | controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition( 221 | target: LatLng(lat, long), zoom: 15, tilt: 50.0, bearing: 45.0))); 222 | } 223 | 224 | initPlatformState() async { 225 | await _locationService.changeSettings( 226 | accuracy: LocationAccuracy.BALANCED, interval: 1000); 227 | 228 | LocationData location; 229 | // Platform messages may fail, so we use a try/catch PlatformException. 230 | try { 231 | bool serviceStatus = await _locationService.serviceEnabled(); 232 | print("Service status: $serviceStatus"); 233 | if (serviceStatus) { 234 | _permission = await _locationService.requestPermission(); 235 | print("Permission: $_permission"); 236 | if (_permission) { 237 | location = await _locationService.getLocation(); 238 | 239 | _locationSubscription = _locationService 240 | .onLocationChanged() 241 | .listen((LocationData result) async { 242 | _currentCameraPosition = CameraPosition( 243 | target: LatLng(result.latitude, result.longitude), 244 | zoom: 16, 245 | tilt: 50.0, 246 | bearing: 45.0); 247 | 248 | final GoogleMapController controller = await _controller.future; 249 | controller.animateCamera( 250 | CameraUpdate.newCameraPosition(_currentCameraPosition)); 251 | if (mounted) { 252 | setState(() { 253 | _currentLocation = result; 254 | _markers.clear(); 255 | _markers.add(Marker( 256 | markerId: MarkerId("Current Location"), 257 | position: LatLng(result.latitude, result.longitude))); 258 | }); 259 | } 260 | }); 261 | } 262 | } else { 263 | bool serviceStatusResult = await _locationService.requestService(); 264 | print("Service status activated after request: $serviceStatusResult"); 265 | if (serviceStatusResult) { 266 | initPlatformState(); 267 | } 268 | } 269 | } on PlatformException catch (e) { 270 | print(e); 271 | if (e.code == 'PERMISSION_DENIED') { 272 | error = e.message; 273 | } else if (e.code == 'SERVICE_STATUS_ERROR') { 274 | error = e.message; 275 | } 276 | location = null; 277 | } 278 | 279 | setState(() { 280 | _startLocation = location; 281 | }); 282 | } 283 | } 284 | -------------------------------------------------------------------------------- /lib/src/ui/pages/choose_office.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //Widget dropDownMenuOffices() { 4 | // OfficeDatabase officeDatabase = new OfficeDatabase(); 5 | // return FutureBuilder( 6 | // future: officeDatabase.getOfficeList(), 7 | // builder: (BuildContext context, AsyncSnapshot snapshot) { 8 | // if (snapshot.connectionState == ConnectionState.done) { 9 | // if (snapshot.data != null) { 10 | // return Container( 11 | // padding: EdgeInsets.symmetric(horizontal: 20), 12 | // child: InputDecorator( 13 | // decoration: InputDecoration( 14 | // border: OutlineInputBorder( 15 | // borderRadius: BorderRadius.circular(5.0))), 16 | // child: DropdownButtonHideUnderline( 17 | // child: DropdownButton( 18 | // value: _selected, 19 | // hint: Text('Select Office'), 20 | // items: snapshot.data 21 | // .map>((Office office) { 22 | // return DropdownMenuItem( 23 | // child: Text(office.name), 24 | // value: office, 25 | // ); 26 | // }).toList(), 27 | // onChanged: (value) { 28 | // setState(() { 29 | // _selected = value; 30 | // }); 31 | // }, 32 | // ), 33 | // ), 34 | // ), 35 | // ); 36 | // } else 37 | // return Text("${snapshot.error}"); 38 | // } else { 39 | // return LinearProgressIndicator(); 40 | // } 41 | // }, 42 | // ); 43 | //} 44 | 45 | class ChooseOfficeWidget extends StatefulWidget { 46 | @override 47 | State createState() { 48 | return ChooseOfficeWidgetState(); 49 | } 50 | } 51 | 52 | class ChooseOfficeWidgetState extends State { 53 | int _currentIndex = 0; 54 | final List _children = []; 55 | 56 | void onTabTapped(int index) { 57 | setState(() { 58 | _currentIndex = index; 59 | }); 60 | } 61 | 62 | @override 63 | Widget build(BuildContext context) { 64 | return Scaffold( 65 | appBar: AppBar( 66 | title: Text("Choose your office"), 67 | leading: Icon(Icons.bookmark_border), 68 | ), 69 | bottomNavigationBar: BottomNavigationBar( 70 | onTap: onTabTapped, 71 | currentIndex: _currentIndex, 72 | items: [ 73 | new BottomNavigationBarItem( 74 | icon: Icon(Icons.home), 75 | title: Text('Home'), 76 | ), 77 | new BottomNavigationBarItem( 78 | icon: Icon(Icons.mail), 79 | title: Text('Messages'), 80 | ), 81 | new BottomNavigationBarItem( 82 | icon: Icon(Icons.person), title: Text('Profile')) 83 | ], 84 | ), 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/src/ui/pages/homepage.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:firebase_database/firebase_database.dart'; 3 | import 'package:firebase_messaging/firebase_messaging.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 7 | import 'package:geo_attendance_system/src/models/office.dart'; 8 | import 'package:geo_attendance_system/src/services/fetch_offices.dart'; 9 | import 'package:geo_attendance_system/src/ui/constants/colors.dart'; 10 | import 'package:geo_attendance_system/src/ui/constants/strings.dart'; 11 | import 'package:geo_attendance_system/src/ui/pages/dashboard.dart'; 12 | import 'package:geofencing/geofencing.dart'; 13 | import 'package:permission_handler/permission_handler.dart'; 14 | 15 | import '../../services/geofence.dart'; 16 | 17 | class HomePage extends StatefulWidget { 18 | final FirebaseUser user; 19 | 20 | HomePage({this.user}); 21 | 22 | @override 23 | _HomePageState createState() => new _HomePageState(); 24 | } 25 | 26 | class _HomePageState extends State 27 | with SingleTickerProviderStateMixin { 28 | AnimationController controller; 29 | 30 | OfficeDatabase officeDatabase = new OfficeDatabase(); 31 | final _databaseReference = FirebaseDatabase.instance.reference(); 32 | var geoFenceActive = false; 33 | var result; 34 | String error; 35 | Office allotedOffice; 36 | final PermissionHandler _permissionHandler = PermissionHandler(); 37 | FirebaseMessaging firebaseMessaging = new FirebaseMessaging(); 38 | FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; 39 | 40 | Future _initializeGeoFence() async { 41 | try { 42 | result = await _permissionHandler 43 | .requestPermissions([PermissionGroup.location]); 44 | switch (result[PermissionGroup.location]) { 45 | case PermissionStatus.granted: 46 | GeofencingManager.initialize().then((_) { 47 | officeDatabase.getOfficeBasedOnUID(widget.user.uid).then((office) { 48 | print(office.latitude); 49 | GeoFenceClass.startListening( 50 | office.latitude, office.longitude, office.radius); 51 | setState(() { 52 | geoFenceActive = true; 53 | allotedOffice = office; 54 | }); 55 | }); 56 | }); 57 | break; 58 | case PermissionStatus.denied: 59 | print("DENIED"); 60 | break; 61 | case PermissionStatus.disabled: 62 | // do something 63 | break; 64 | case PermissionStatus.restricted: 65 | // do something 66 | break; 67 | case PermissionStatus.unknown: 68 | // do something 69 | break; 70 | default: 71 | } 72 | } on PlatformException catch (e) { 73 | print(e); 74 | if (e.code == 'PERMISSION_DENIED') { 75 | error = e.message; 76 | } else if (e.code == 'SERVICE_STATUS_ERROR') { 77 | error = e.message; 78 | } 79 | } 80 | } 81 | 82 | void showDialogNotification(BuildContext context, String text) { 83 | Dialog simpleDialog = Dialog( 84 | shape: RoundedRectangleBorder( 85 | borderRadius: BorderRadius.circular(12.0), 86 | ), 87 | child: Container( 88 | height: 300.0, 89 | width: 300.0, 90 | child: Column( 91 | mainAxisAlignment: MainAxisAlignment.center, 92 | children: [ 93 | Padding( 94 | padding: EdgeInsets.all(15.0), 95 | child: Text( 96 | text, 97 | textAlign: TextAlign.center, 98 | style: TextStyle( 99 | color: Colors.blue, 100 | fontFamily: "poppins-medium", 101 | fontSize: 18), 102 | ), 103 | ), 104 | Padding( 105 | padding: const EdgeInsets.only(left: 10, right: 10, top: 50), 106 | child: Row( 107 | mainAxisAlignment: MainAxisAlignment.center, 108 | crossAxisAlignment: CrossAxisAlignment.end, 109 | children: [ 110 | RaisedButton( 111 | color: Colors.blue, 112 | onPressed: () { 113 | Navigator.of(context).pop(); 114 | }, 115 | child: Text( 116 | 'Okay', 117 | style: TextStyle(fontSize: 18.0, color: Colors.white), 118 | ), 119 | ), 120 | ], 121 | ), 122 | ), 123 | ], 124 | ), 125 | ), 126 | ); 127 | showDialog( 128 | context: context, builder: (BuildContext context) => simpleDialog); 129 | } 130 | 131 | @override 132 | void initState() { 133 | super.initState(); 134 | 135 | firebaseMessaging.configure(onLaunch: (Map msg) { 136 | print(" onLaunch called ${(msg)}"); 137 | }, onResume: (Map msg) { 138 | print(" onResume called ${(msg)}"); 139 | }, onMessage: (Map msg) { 140 | showDialogNotification(context, msg["notification"]["body"]); 141 | }); 142 | firebaseMessaging.requestNotificationPermissions( 143 | const IosNotificationSettings(sound: true, alert: true, badge: true)); 144 | firebaseMessaging.onIosSettingsRegistered 145 | .listen((IosNotificationSettings setting) { 146 | print('IOS Setting Registed'); 147 | }); 148 | 149 | firebaseMessaging.getToken().then((token) { 150 | _databaseReference.child("users").child(widget.user.uid).update({ 151 | "notificationToken": token, 152 | }); 153 | }); 154 | _initializeGeoFence(); 155 | 156 | controller = new AnimationController( 157 | vsync: this, duration: new Duration(milliseconds: 300), value: 1.0); 158 | } 159 | 160 | @override 161 | void dispose() { 162 | super.dispose(); 163 | controller.dispose(); 164 | GeoFenceClass.closePort(); 165 | GeofencingManager.removeGeofenceById(fence_id); 166 | } 167 | 168 | bool get isPanelVisible { 169 | final AnimationStatus status = controller.status; 170 | return status == AnimationStatus.completed || 171 | status == AnimationStatus.forward; 172 | } 173 | 174 | @override 175 | Widget build(BuildContext context) { 176 | return new Scaffold( 177 | appBar: new AppBar( 178 | title: Padding( 179 | padding: const EdgeInsets.only(left: 35.0), 180 | child: new Text( 181 | "DASHBOARD", 182 | style: TextStyle( 183 | fontSize: 25.0, 184 | fontFamily: "Poppins-Medium", 185 | fontWeight: FontWeight.w200), 186 | ), 187 | ), 188 | elevation: 0.0, 189 | backgroundColor: dashBoardColor, 190 | leading: new IconButton( 191 | onPressed: () { 192 | double velocity = 2.0; 193 | controller.fling(velocity: isPanelVisible ? -velocity : velocity); 194 | }, 195 | icon: new AnimatedIcon( 196 | icon: AnimatedIcons.close_menu, 197 | progress: controller.view, 198 | ), 199 | ), 200 | ), 201 | body: geoFenceActive == false 202 | ? Container( 203 | decoration: BoxDecoration( 204 | gradient: LinearGradient( 205 | colors: const [ 206 | splashScreenColorBottom, 207 | splashScreenColorTop 208 | ], 209 | begin: Alignment.bottomCenter, 210 | end: Alignment.topRight, 211 | ), 212 | ), 213 | child: Column(children: [ 214 | LinearProgressIndicator( 215 | valueColor: new AlwaysStoppedAnimation( 216 | splashScreenColorBottom), 217 | ), 218 | Padding( 219 | padding: const EdgeInsets.all(40.0), 220 | child: Text( 221 | "Please Wait..\nwhile we are setting up things", 222 | style: TextStyle( 223 | color: Colors.white, 224 | fontSize: 22, 225 | fontWeight: FontWeight.w700), 226 | textAlign: TextAlign.center, 227 | ), 228 | ) 229 | ])) 230 | : new Dashboard( 231 | controller: controller, 232 | user: widget.user, 233 | )); 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /lib/src/ui/pages/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 5 | import 'package:flutter_spinkit/flutter_spinkit.dart'; 6 | import 'package:geo_attendance_system/src/services/authentication.dart'; 7 | import 'package:geo_attendance_system/src/ui/constants/colors.dart'; 8 | import 'package:geo_attendance_system/src/ui/pages/homepage.dart'; 9 | import 'package:geo_attendance_system/src/ui/pages/login.dart'; 10 | 11 | enum AuthStatus { 12 | NOT_DETERMINED, 13 | NOT_LOGGED_IN, 14 | LOGGED_IN, 15 | } 16 | 17 | class SplashScreenWidget extends StatefulWidget { 18 | SplashScreenWidget({this.auth}); 19 | 20 | final BaseAuth auth; 21 | 22 | @override 23 | _SplashScreenState createState() => _SplashScreenState(); 24 | } 25 | 26 | class _SplashScreenState extends State { 27 | AuthStatus authStatus = AuthStatus.NOT_DETERMINED; 28 | String _userId = ""; 29 | 30 | 31 | void initState() { 32 | super.initState(); 33 | 34 | 35 | Timer(Duration(seconds: 3), () { 36 | widget.auth.getCurrentUser().then((user) { 37 | setState(() { 38 | if (user != null) { 39 | _userId = user?.uid; 40 | } 41 | 42 | authStatus = user?.uid == null 43 | ? AuthStatus.NOT_LOGGED_IN 44 | : AuthStatus.LOGGED_IN; 45 | 46 | MaterialPageRoute loginRoute = new MaterialPageRoute( 47 | builder: (BuildContext context) => Login(auth: new Auth())); 48 | MaterialPageRoute homePageRoute = new MaterialPageRoute( 49 | builder: (BuildContext context) => HomePage(user: user)); 50 | 51 | if (authStatus == AuthStatus.LOGGED_IN) { 52 | Navigator.pushReplacement(context, homePageRoute); 53 | } else { 54 | if (authStatus == AuthStatus.NOT_LOGGED_IN) 55 | Navigator.pushReplacement(context, loginRoute); 56 | } 57 | }); 58 | }); 59 | }); 60 | } 61 | 62 | 63 | 64 | @override 65 | Widget build(BuildContext context) { 66 | return Scaffold( 67 | body: Container( 68 | decoration: BoxDecoration( 69 | gradient: LinearGradient( 70 | colors: const [splashScreenColorBottom, splashScreenColorTop], 71 | begin: Alignment.bottomCenter, 72 | end: Alignment.topRight, 73 | ), 74 | ), 75 | child: Center( 76 | child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ 77 | Image.asset( 78 | "assets/logo/logo-white.png", 79 | height: 150, 80 | ), 81 | Container( 82 | padding: const EdgeInsets.only(top: 80), 83 | child: SpinKitThreeBounce( 84 | color: Colors.white, 85 | size: 30.0, 86 | ), 87 | ), 88 | ]), 89 | ), 90 | ), 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/src/ui/widgets/Info_dialog_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void showDialogTemplate(BuildContext context, String title, String subtitle, 4 | String gif, Color color, String buttonText) { 5 | showDialog( 6 | context: context, 7 | builder: (BuildContext context) { 8 | return Container( 9 | height: 40, 10 | child: AlertDialog( 11 | backgroundColor: color, 12 | shape: 13 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)), 14 | title: Text( 15 | title, 16 | style: TextStyle(color: Colors.white), 17 | ), 18 | content: Column( 19 | mainAxisSize: MainAxisSize.min, 20 | children: [ 21 | Image.asset( 22 | gif, 23 | width: 175, 24 | ), 25 | Text(subtitle, style: TextStyle(color: Colors.white60)), 26 | ], 27 | ), 28 | actions: [ 29 | FlatButton( 30 | child: Text( 31 | buttonText, 32 | style: TextStyle(fontSize: 18.0, color: Colors.white), 33 | ), 34 | onPressed: () { 35 | Navigator.of(context).pop(); 36 | }, 37 | ), 38 | ], 39 | ), 40 | ); 41 | }, 42 | ); 43 | } -------------------------------------------------------------------------------- /lib/src/ui/widgets/attendance_Marker_buttons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Widget inOutButton(String buttonText, Color color, Function() callback) { 4 | return InkWell( 5 | child: Container( 6 | width: 60, 7 | height: 50, 8 | decoration: BoxDecoration( 9 | borderRadius: BorderRadius.circular(10.0), 10 | border: Border.all(color: color, width: 5),), 11 | child: Material( 12 | color: Colors.transparent, 13 | child: InkWell( 14 | onTap: () { 15 | callback(); 16 | }, 17 | child: Center( 18 | child: Text(buttonText, 19 | style: TextStyle( 20 | color: color, 21 | fontFamily: "Poppins-Bold", 22 | fontSize: 20, 23 | letterSpacing: 1.0, 24 | fontWeight: FontWeight.w900 25 | )), 26 | ), 27 | ), 28 | ), 29 | ), 30 | ); 31 | } -------------------------------------------------------------------------------- /lib/src/ui/widgets/dashboard_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:geo_attendance_system/src/ui/constants/colors.dart'; 4 | 5 | Widget buildTile(String icon, String title, String subtitle, 6 | BuildContext context, FirebaseUser user, 7 | [Function(BuildContext, FirebaseUser) onTap]) { 8 | return Material( 9 | elevation: 10.0, 10 | shadowColor: dashBoardColor, 11 | borderRadius: BorderRadius.circular(12.0), 12 | color: Colors.white,/*Color.fromRGBO(51, 51, 102, 1),*/ 13 | child: InkWell( 14 | onTap: onTap != null 15 | ? () { 16 | onTap(context, user); 17 | } // Implement here onTap function 18 | : () => print("Not yet set"), 19 | child: Padding( 20 | padding: const EdgeInsets.all(24.0), 21 | child: Column( 22 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 23 | crossAxisAlignment: CrossAxisAlignment.center, 24 | children: [ 25 | Material( 26 | child: Padding( 27 | padding: const EdgeInsets.all(16.0), 28 | child: Image.asset( 29 | icon, 30 | height: 50, 31 | ), 32 | )), 33 | Text( 34 | title, 35 | style: TextStyle( 36 | color: Colors.black, 37 | fontWeight: FontWeight.w500, 38 | fontSize: 17.0), 39 | textAlign: TextAlign.center, 40 | ), 41 | Text( 42 | subtitle, 43 | style: TextStyle( 44 | color: Colors.black38, 45 | fontWeight: FontWeight.w700, 46 | fontSize: 13.0, 47 | ), 48 | textAlign: TextAlign.center, 49 | ), 50 | ]), 51 | ), 52 | )); 53 | } 54 | -------------------------------------------------------------------------------- /lib/src/ui/widgets/form_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | class FormCard extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return new Container( 8 | width: double.infinity, 9 | height: ScreenUtil.getInstance().setHeight(500), 10 | decoration: BoxDecoration( 11 | color: Colors.white, 12 | borderRadius: BorderRadius.circular(8.0), 13 | boxShadow: [ 14 | BoxShadow( 15 | color: Colors.black12, 16 | offset: Offset(0.0, 15.0), 17 | blurRadius: 15.0), 18 | BoxShadow( 19 | color: Colors.black12, 20 | offset: Offset(0.0, -10.0), 21 | blurRadius: 10.0), 22 | ]), 23 | child: Padding( 24 | padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 16.0), 25 | child: Column( 26 | crossAxisAlignment: CrossAxisAlignment.start, 27 | children: [ 28 | Text("Login", 29 | style: TextStyle( 30 | fontSize: ScreenUtil.getInstance().setSp(45), 31 | fontFamily: "Poppins-Bold", 32 | letterSpacing: .6)), 33 | SizedBox( 34 | height: ScreenUtil.getInstance().setHeight(30), 35 | ), 36 | Text("Username", 37 | style: TextStyle( 38 | fontFamily: "Poppins-Medium", 39 | fontSize: ScreenUtil.getInstance().setSp(26))), 40 | TextField( 41 | decoration: InputDecoration( 42 | hintText: "username", 43 | hintStyle: TextStyle(color: Colors.grey, fontSize: 12.0)), 44 | ), 45 | SizedBox( 46 | height: ScreenUtil.getInstance().setHeight(30), 47 | ), 48 | Text("Password", 49 | style: TextStyle( 50 | fontFamily: "Poppins-Medium", 51 | fontSize: ScreenUtil.getInstance().setSp(26))), 52 | TextField( 53 | obscureText: true, 54 | decoration: InputDecoration( 55 | hintText: "Password", 56 | hintStyle: TextStyle(color: Colors.grey, fontSize: 12.0)), 57 | ), 58 | SizedBox( 59 | height: ScreenUtil.getInstance().setHeight(35), 60 | ), 61 | Row( 62 | mainAxisAlignment: MainAxisAlignment.end, 63 | children: [ 64 | Text( 65 | "Forgot Password?", 66 | style: TextStyle( 67 | color: Colors.blue, 68 | fontFamily: "Poppins-Medium", 69 | fontSize: ScreenUtil.getInstance().setSp(28)), 70 | ) 71 | ], 72 | ) 73 | ], 74 | ), 75 | ), 76 | ); 77 | } 78 | } -------------------------------------------------------------------------------- /lib/src/ui/widgets/loader_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | void onLoadingDialog(BuildContext context) { 5 | showDialog( 6 | context: context, 7 | barrierDismissible: false, 8 | builder: (BuildContext context) { 9 | return Container( 10 | height: 30, 11 | child: Dialog( 12 | shape: RoundedRectangleBorder( 13 | borderRadius: BorderRadius.all(Radius.circular(20.0))), 14 | child: new Row( 15 | mainAxisSize: MainAxisSize.min, 16 | children: [ 17 | Padding( 18 | padding: const EdgeInsets.all(15.0), 19 | child: Image.asset( 20 | "assets/gif/loading-gif.gif", 21 | width: 70, 22 | )), 23 | Padding( 24 | padding: const EdgeInsets.all(8.0), 25 | child: new Text( 26 | "LOADING", 27 | style: TextStyle( 28 | fontFamily: "Poppins-Bold", 29 | fontSize: 30, 30 | letterSpacing: .6, 31 | fontWeight: FontWeight.bold), 32 | ), 33 | ), 34 | ], 35 | ), 36 | )); 37 | }, 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/ui/widgets/socialicons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SocialIcon extends StatelessWidget { 4 | final List colors; 5 | final IconData iconData; 6 | final Function onPressed; 7 | SocialIcon({this.colors, this.iconData, this.onPressed}); 8 | @override 9 | Widget build(BuildContext context) { 10 | return new Padding( 11 | padding: EdgeInsets.only(left: 14.0), 12 | child: Container( 13 | width: 45.0, 14 | height: 45.0, 15 | decoration: BoxDecoration( 16 | shape: BoxShape.circle, 17 | gradient: LinearGradient(colors: colors, tileMode: TileMode.clamp)), 18 | child: RawMaterialButton( 19 | shape: CircleBorder(), 20 | onPressed: onPressed, 21 | child: Icon(iconData, color: Colors.white), 22 | ), 23 | ), 24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: geo_attendance_system 2 | description: Major 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.6.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | cupertino_icons: ^0.1.2 24 | splashscreen: any 25 | flutter_sparkline: any 26 | flutter_staggered_grid_view: any 27 | calendarro: ^1.0.0 28 | firebase_auth: any 29 | flutter_screenutil: ^0.4.2 30 | table_calendar: any 31 | firebase_database: any 32 | google_maps_flutter: ^0.5.21+8 33 | device_id: ^0.2.0 34 | location: ^2.3.5 35 | flutter_spinkit: ^3.1.0 36 | flutter_datetime_picker: 37 | git: 38 | url: https://github.com/derohimat/flutter_datetime_picker.git 39 | grouped_buttons: ^1.0.3 40 | permission_handler: "^4.0.0" 41 | device_info: ^0.4.1+2 42 | firebase_messaging: ^6.0.1 43 | flutter_local_notifications: 44 | 45 | geofencing: 46 | path: geofencing 47 | 48 | dev_dependencies: 49 | flutter_test: 50 | sdk: flutter 51 | 52 | flutter: 53 | uses-material-design: true 54 | 55 | assets: 56 | - assets/icons/ 57 | - assets/gif/loading-gif.gif 58 | - assets/gif/tick.gif 59 | - assets/gif/close.gif 60 | - assets/gif/no_entry.gif 61 | - assets/logo/logo.png 62 | - assets/back.jpg 63 | - assets/logo/logo-white.png 64 | - assets/logo/profile.jpg 65 | 66 | fonts: 67 | - family: Poppins-Bold 68 | fonts: 69 | - asset: assets/fonts/Poppins-Bold.otf 70 | 71 | - family: Poppins-Medium 72 | fonts: 73 | - asset: assets/fonts/Poppins-Medium.otf 74 | 75 | - family: Sansation-Bold 76 | fonts: 77 | - asset: assets/fonts/Sansation-Bold.ttf 78 | 79 | - family: Bitter 80 | fonts: 81 | - asset: assets/fonts/Bitter-Bold.ttf 82 | - asset: assets/fonts/Bitter-Regular.ttf 83 | --------------------------------------------------------------------------------