diff --git a/.firebaserc b/.firebaserc
new file mode 100644
index 00000000..13ca5b47
--- /dev/null
+++ b/.firebaserc
@@ -0,0 +1,5 @@
+{
+ "projects": {
+ "default": "eduryde"
+ }
+}
diff --git a/.gitignore b/.gitignore
index c9583676..e183c6d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,7 +8,6 @@
.buildlog/
.history
.svn/
-migrate_working_dir/
# IntelliJ related
*.iml
@@ -16,17 +15,13 @@ migrate_working_dir/
*.iws
.idea/
-# The .vscode folder contains launch configuration and tasks you configure in
-# VS Code which you may wish to be included in version control, so this line
-# is commented out by default.
-#.vscode/
-
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
+.packages
.pub-cache/
.pub/
/build/
@@ -41,124 +36,14 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
-android/.gitignore
-android/build.gradle
-android/gradle.properties
-android/settings.gradle
-android/app/build.gradle
-android/app/src/debug/AndroidManifest.xml
-android/app/src/main/AndroidManifest.xml
-android/app/src/main/java/com/getflutterfire/get_flutter_fire/MainActivity.java
-android/app/src/main/res/drawable/launch_background.xml
-android/app/src/main/res/drawable-v21/launch_background.xml
-android/app/src/main/res/mipmap-hdpi/ic_launcher.png
-android/app/src/main/res/mipmap-mdpi/ic_launcher.png
-android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
-android/app/src/main/res/values/styles.xml
-android/app/src/main/res/values-night/styles.xml
-android/app/src/profile/AndroidManifest.xml
-android/gradle/wrapper/gradle-wrapper.properties
-ios/.gitignore
-ios/Flutter/Debug.xcconfig
-ios/Flutter/Release.xcconfig
-ios/Runner/AppDelegate.swift
-ios/Runner/Runner-Bridging-Header.h
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
-ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
-ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
-ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
-ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
-ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
-ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
-ios/Runner/Base.lproj/LaunchScreen.storyboard
-ios/Runner/Base.lproj/Main.storyboard
-ios/Runner.xcodeproj/project.pbxproj
-ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
-ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
-ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
-ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
-ios/Runner.xcworkspace/contents.xcworkspacedata
-ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
-ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
-ios/RunnerTests/RunnerTests.swift
-linux/.gitignore
-linux/CMakeLists.txt
-linux/main.cc
-linux/my_application.cc
-linux/my_application.h
-linux/flutter/CMakeLists.txt
-linux/flutter/generated_plugin_registrant.cc
-linux/flutter/generated_plugin_registrant.h
-linux/flutter/generated_plugins.cmake
-macos/.gitignore
-macos/Flutter/Flutter-Debug.xcconfig
-macos/Flutter/Flutter-Release.xcconfig
-macos/Flutter/GeneratedPluginRegistrant.swift
-macos/Runner/AppDelegate.swift
-macos/Runner/DebugProfile.entitlements
-macos/Runner/MainFlutterWindow.swift
-macos/Runner/Release.entitlements
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
-macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
-macos/Runner/Base.lproj/MainMenu.xib
-macos/Runner/Configs/AppInfo.xcconfig
-macos/Runner/Configs/Debug.xcconfig
-macos/Runner/Configs/Release.xcconfig
-macos/Runner/Configs/Warnings.xcconfig
-macos/Runner.xcodeproj/project.pbxproj
-macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
-macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
-macos/Runner.xcworkspace/contents.xcworkspacedata
-macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
-macos/RunnerTests/RunnerTests.swift
-web/favicon.png
-web/index.html
-web/manifest.json
-web/icons/Icon-192.png
-web/icons/Icon-512.png
-web/icons/Icon-maskable-192.png
-web/icons/Icon-maskable-512.png
-windows/.gitignore
-windows/CMakeLists.txt
-windows/flutter/CMakeLists.txt
-windows/flutter/generated_plugin_registrant.cc
-windows/flutter/generated_plugin_registrant.h
-windows/flutter/generated_plugins.cmake
-windows/runner/CMakeLists.txt
-windows/runner/flutter_window.cpp
-windows/runner/flutter_window.h
-windows/runner/main.cpp
-windows/runner/resource.h
-windows/runner/runner.exe.manifest
-windows/runner/Runner.rc
-windows/runner/utils.cpp
-windows/runner/utils.h
-windows/runner/win32_window.cpp
-windows/runner/win32_window.h
-windows/runner/resources/app_icon.ico
-lib/firebase_options.dart
-pubspec.lock
-pubspec.lock
-server/functions/firebase_options.json
+
+# Entire build directories
+/build/
+/android/app/build/
+/ios/build/
+
+#Private files
+/lib/junkpages
+/lib/private/api_keys.dart
+/android/app/src/main/res/values/api_keys.xml
+/ios/ApiKey.plist
diff --git a/.hintrc b/.hintrc
deleted file mode 100644
index 156d7c50..00000000
--- a/.hintrc
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "extends": [
- "development"
- ],
- "hints": {
- "meta-viewport": "off",
- "axe/language": [
- "default",
- {
- "html-has-lang": "off"
- }
- ],
- "typescript-config/consistent-casing": "off",
- "typescript-config/strict": "off"
- }
-}
\ No newline at end of file
diff --git a/.metadata b/.metadata
deleted file mode 100644
index 784ce129..00000000
--- a/.metadata
+++ /dev/null
@@ -1,30 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled and should not be manually edited.
-
-version:
- revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
- channel: "stable"
-
-project_type: app
-
-# Tracks metadata for the flutter migrate command
-migration:
- platforms:
- - platform: root
- create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- - platform: web
- create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
-
- # User provided section
-
- # List of Local paths (relative to this file) that should be
- # ignored by the migrate tool.
- #
- # Files that are not part of the templates will be ignored by default.
- unmanaged_files:
- - 'lib/main.dart'
- - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index e0120650..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "java.compile.nullAnalysis.mode": "automatic",
- "java.configuration.updateBuildConfiguration": "interactive"
-}
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 6d272c3e..f288702d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,21 +1,674 @@
-MIT License
-
-Copyright (c) 2024 Anshuman Das
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/README.md b/README.md
index 451d649a..f7472069 100644
--- a/README.md
+++ b/README.md
@@ -1,132 +1,7 @@
-# get-flutter-fire
+# Eduryde
-This codebase provides a boilerplate code utilizing the following three technologies:
+An open source reverse ridesharing for college students, now rebuilt and refactored, using GetX and FlutterFire.
-1. Flutter 3.0 - For UX and uses Dart languange. See [https://flutter.dev/]
-2. GetX - State management for Flutter. See [https://github.com/jonataslaw/getx/tree/4.6.1]
-3. Firebase - For Backend as a Service. See [https://firebase.google.com/]
- 1. Easy Authentication flow
- 2. Server side functions
- 3. Remote Configurations which can be used for A/B testing
+# Use the old version here:
-This was created as part of my own learning process and you will find that git commits were made according to the Steps listed below. You can use the git version history to check each commit and learn step by step, as I did.
-
-I am also using this codebase as an experiment towards hiring people (freshers especially but not limited to them) for my development team. If you are in Mumbai and are interested to join my team, you can use this codebase in the following manner:
-
-* Fork the codebase
-* Add your own firebase_options.dart (follow steps and see firebase_options.template)
-* **Build your own application using this as a base (integrating any existing project of yours also works)**, or complete a TODO or fix a bug (only if you have no other ideas)
-* Send me a Pull Request. Mention a way of connecting with you in the commit message along with details of commit. Also modify ReadMe to say what you have changed in detail.
-* I will go through the request and then connect with you if I find the entry to be interesting and take an interview round.
-
-## The Steps
-
-Step 1: Use Get CLI [https://pub.dev/packages/get_cli]
-
-`get create project`
-
-Step 2: Copy code from [https://github.com/jonataslaw/getx/tree/4.6.1/example_nav2/lib]
-
-Step 3: Integrate FlutterFire Authentication
-
-- Tutorials [https://firebase.google.com/codelabs/firebase-auth-in-flutter-apps#0] for inspiration
-- Firebase Documentation [https://firebase.google.com/docs/auth/flutter/start]
-- Blog [www.medium.com/TBD]
-- To compile the code ensure that you generate your own firebase_options.dart by running
-
- `flutterfire configure`
-
-Step 4: Add Google OAuth [https://firebase.google.com/codelabs/firebase-auth-in-flutter-apps#6]. Note ensure you do the steps for Android and iOS as the code for it is not in Github
-
-Step 5: Add Guest User/Anonymous login with a Cart and Checkout use case [https://firebase.google.com/docs/auth/flutter/anonymous-auth]
-
-* delete unlinked anonymous user post logout
-
-Step 6: Add ImagePicker and Firebase Storage for profile image
-
-* Create PopupMenu button for web [https://api.flutter.dev/flutter/material/PopupMenuButton-class.html]
-* BottomSheet for phones and single file button for desktops
-* GetX and Image Picker [https://stackoverflow.com/questions/66559553/flutter-imagepicker-with-getx]
-* Add FilePicker [https://medium.com/@onuaugustine07/pick-any-file-file-picker-flutter-f82c0144e27c]
-* Firebase Storage [https://mercyjemosop.medium.com/select-and-upload-images-to-firebase-storage-flutter-6fac855970a9] and [https://firebase.google.com/docs/storage/flutter/start]
-
- Modify the Firebase Rules
- `service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow write: if request.auth.uid != null; allow read: if true; } } }`
-
- Fix CORS [https://stackoverflow.com/questions/37760695/firebase-storage-and-access-control-allow-origin]
-* PList additions [https://medium.com/unitechie/flutter-tutorial-image-picker-from-camera-gallery-c27af5490b74]
-
-Step 7: Additional Auth flow items
-
-1. Add a Change Password Screen. The Flutter Fire package does not have this screen.
-2. TODO: Add ReCaptcha to login flow for password authentication for Web only
- * Phone Auth on Web has a ReCaptcha already [https://firebase.flutter.dev/docs/auth/phone/]. Tried to use that library but it is very cryptic.
- * Use the following instead [https://stackoverflow.com/questions/60675575/how-to-implement-recaptcha-into-a-flutter-app] or [https://medium.com/cloudcraftz/securing-your-flutter-web-app-with-google-recaptcha-b556c567f409] or [https://pub.dev/packages/g_recaptcha_v3]
-3. TODO: Ensure Reset Password has Email verification
-4. TODO: Add Phone verification [https://firebase.google.com/docs/auth/flutter/phone-auth]
- * See [https://github.com/firebase/flutterfire/issues/4189].
-5. TODO: Add 2FA with SMS Pin. This screen is available in the Flutter Fire package
-
-Step 8: Add Firebase Emulator to test on laptop instead of server so that we can use Functions without upgrading the plan to Blaze. See [https://firebase.google.com/docs/emulator-suite/install_and_configure]
-
-Step 9: Add User Roles using Custom Claims. This requires upgrade of plan as we need to use Firebase Functions. Instead using Emulator.
-
-1. In Emulator we can add user via http://127.0.0.1:4000/auth and add custom claim via UI as {"role":"admin"}. The effect is shown via Product page in Nav instead of Cart page for admin user.
-2. Add Function to add the custom claim to make the first user the admin using the Admin SDK
-3. Registeration form to collect some data post signUp and enforce email verification from Client side.
-
- * Note! for Emulator check the console to verify using the link provided as email is not sent.
-4. Enforcing verify email using a button which appears when SignIn fails due to non verification.
-
- * Fixed the error handling message during login.
- * Coverted server side to Typescript
- * Enabled Resend verification mail button
- * Approach 1 - Use Email Link Authentication and signIn, assuming it marks email as verified also. We cannot send the verification mail as is, since that can be sent only if signed in (which was allowed only for first login post signup)
- * Refer https://firebase.google.com/docs/auth/flutter/email-link-auth
- * TODO Enable Deep Linking: According to https://firebase.google.com/docs/dynamic-links/flutter/receive, the Flutter feature is being deprecated and we should use the AppLinks (Android), UniversalLinks(iOS) instead. Leaving this for future as adding complexity.
- * We could use the server side handling instead of deep linking. See [https://firebase.google.com/docs/auth/custom-email-handler?hl=en&authuser=0#web]. However, this requires changing the email template for the URL which is not possible in Emulator. Using the continueURL instead does not work as oobCode is already expired. This handling also uses the web client sdk. Thus it is better to go with the below method instead.
- * Approach 2 - (Hack) send a create request with suffix ".verify" added in email when button clicked. Use the server side beforeCreate to catch this and send verification mail
- * Note that the Server side beforeCreate function can also bypass user creation till verification but the user record (esp password) needs to be stored anyways, so bypassing user creation is not a good idea. Instead, we should use the verified tag in subsequent processing
- * Sending emails from server side is possible but by using the web client SDK.
-5. TODO: Other Items
-
- * TODO: Using autocomplete for emails is throwing error log in terminal. No impact but need to fix when all is done.
- * TODO: Add a job that removes all unverified users after a while automatically. This could be useful if you were victim of bot attacks, but adding the Recaptcha is better precaution. See [https://stackoverflow.com/questions/67148672/how-to-delete-unverified-e-mail-addresses-in-firebase-authentication-flutter/67150606#67150606]
-6. Added Roles of Buyer and Seller.
-
- 1. Added Access level in increasing order of role order => Buyer then Seller then Admin
- 2. Created Navigation for each of Admin, Buyer, Seller screens
- 3. Allowed switch from lower role Navigation to Navigation view till the given role of the user
-
-Step 10: Firebase Remote Config for A/B testing. See [https://firebase.google.com/docs/remote-config]
-
-1. Complete the Screen enum based Navigation framework
-2. Config useBottomSheetForProfileOptions for Navigation element to be one of the following
- * False: Drawer for Account, Settings, Sign Out
- * True: Hamburger that opens BottomSheet (Context Menu in larger screen) for the same options
-3. TODO: Config for adding Search Bar at the Top vs a Bottom Navigation button
-
-Step 11: TODO: CRUD
-
-* Users request role upgrade
-* Add this request data to Firebase Datastore
-* Create ListView with slidable tiles for approvals
-* Admin SDK used by admin user via workflow on this request data and is approved from app
- * Allow a Plan attribute via Custome Claims (e.g. Premium user flag) for Buyer and Seller, to add features which are not Navigation linked. Add a button Upgrade to Plan in Drawer that leads to Payment screen. Also certain aspects of premium plan can be visible that leads to upgrade plan screen via middleware
-* Nested Category, Sub-Category tree creation
-
-Step 12: TODO: Theming and Custom Settings
-
-* Add Persona (like that in Netflix) and create a Persona selection only for Buyer Role
-* Add Minimal (Three Color Gradient Pallette) Material Theme. Align it with Persona Templates (like Kids Template in Netflix)
-* Dark theme toggle setting based on each Persona of the logged in User
-
-Step 13: TODO: Large vs Small screen responsiveness
-
-* Drawer: Triggered by Top Left Icon (App Logo). For iOS this icon changes to back button when required. Contains allowed Role List, Screens specified as Drawer. Becomes Left Side Navigation for Horizontal Screens. Can have additional extreme left vertical Navigation Strip. Bottom Navigation Bar also folds into this strip in Horizontal Screens.
-* Top Right Icon: used for Login and post Login triggers BottomSheet/Context Menu for Persona Change, Profile, Settings, Change Password, Logout
-* Search Bar (Toggle Button for phones) on Top Center with Title
-* Status Bottom Bar for desktops only instead of SnackBars
-* FAB vs Main Menu
-
-Step 14: TODO: Make own login flow screens. Remove firebase library reference from all but auth_service
+https://eduryde.web.app
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 72b295f6..61b6c4de 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,7 +1,29 @@
-analyzer:
- errors:
- constant_identifier_names: ignore
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
+
linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at
+ # https://dart-lang.github.io/linter/lints/index.html.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
rules:
-
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/android/.gitignore b/android/.gitignore
new file mode 100644
index 00000000..6f568019
--- /dev/null
+++ b/android/.gitignore
@@ -0,0 +1,13 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+key.properties
+**/*.keystore
+**/*.jks
diff --git a/android/app/build.gradle b/android/app/build.gradle
new file mode 100644
index 00000000..2c87c389
--- /dev/null
+++ b/android/app/build.gradle
@@ -0,0 +1,74 @@
+def localProperties = new Properties()
+def localPropertiesFile = rootProject.file('local.properties')
+if (localPropertiesFile.exists()) {
+ localPropertiesFile.withReader('UTF-8') { reader ->
+ localProperties.load(reader)
+ }
+}
+
+def flutterRoot = localProperties.getProperty('flutter.sdk')
+if (flutterRoot == null) {
+ throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
+}
+
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
+if (flutterVersionCode == null) {
+ flutterVersionCode = '1'
+}
+
+def flutterVersionName = localProperties.getProperty('flutter.versionName')
+if (flutterVersionName == null) {
+ flutterVersionName = '1.0'
+}
+
+apply plugin: 'com.android.application'
+// START: FlutterFire Configuration
+apply plugin: 'com.google.gms.google-services'
+// END: FlutterFire Configuration
+apply plugin: 'kotlin-android'
+apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+
+android {
+ compileSdkVersion flutter.compileSdkVersion
+ ndkVersion flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+
+ sourceSets {
+ main.java.srcDirs += 'src/main/kotlin'
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId "com.example.eduryde"
+ // You can update the following values to match your application needs.
+ // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
+ minSdkVersion 21
+ targetSdkVersion flutter.targetSdkVersion
+ versionCode flutterVersionCode.toInteger()
+ versionName flutterVersionName
+ }
+
+ buildTypes {
+ release {
+ // TODO: Add your own signing config for the release build.
+ // Signing with the debug keys for now, so `flutter run --release` works.
+ signingConfig signingConfigs.debug
+ }
+ }
+}
+
+flutter {
+ source '../..'
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+}
diff --git a/android/app/google-services.json b/android/app/google-services.json
new file mode 100644
index 00000000..78b1c48e
--- /dev/null
+++ b/android/app/google-services.json
@@ -0,0 +1,46 @@
+{
+ "project_info": {
+ "project_number": "168247508765",
+ "project_id": "eduryde",
+ "storage_bucket": "eduryde.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:168247508765:android:85850294d429dee738ebf4",
+ "android_client_info": {
+ "package_name": "com.example.eduryde"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "168247508765-408n259mv1608rm6fg9vr55sshd4jub7.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyBaJt7zrKMTZSYJz6vD2CTOA-8HdZ3ghII"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "168247508765-408n259mv1608rm6fg9vr55sshd4jub7.apps.googleusercontent.com",
+ "client_type": 3
+ },
+ {
+ "client_id": "168247508765-tcoltq95g1oahsg25428mmqv3aj16j8a.apps.googleusercontent.com",
+ "client_type": 2,
+ "ios_info": {
+ "bundle_id": "com.example.eduryde"
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 00000000..e1137f97
--- /dev/null
+++ b/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..44a34706
--- /dev/null
+++ b/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/kotlin/com/example/eduryde/MainActivity.kt b/android/app/src/main/kotlin/com/example/eduryde/MainActivity.kt
new file mode 100644
index 00000000..0d8466e0
--- /dev/null
+++ b/android/app/src/main/kotlin/com/example/eduryde/MainActivity.kt
@@ -0,0 +1,6 @@
+package com.example.eduryde
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity: FlutterActivity() {
+}
diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 00000000..f74085f3
--- /dev/null
+++ b/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 00000000..304732f8
--- /dev/null
+++ b/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..db77bb4b
Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..17987b79
Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..09d43914
Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..d5f1c8d3
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..4d6372ee
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 00000000..06952be7
--- /dev/null
+++ b/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000..cb1ef880
--- /dev/null
+++ b/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 00000000..e1137f97
--- /dev/null
+++ b/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/android/build.gradle b/android/build.gradle
new file mode 100644
index 00000000..59cdcf4f
--- /dev/null
+++ b/android/build.gradle
@@ -0,0 +1,35 @@
+buildscript {
+ ext.kotlin_version = '1.7.10'
+ repositories {
+ google()
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:7.2.0'
+ // START: FlutterFire Configuration
+ classpath 'com.google.gms:google-services:4.3.10'
+ // END: FlutterFire Configuration
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath 'com.google.gms:google-services:4.3.15'
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.buildDir = '../build'
+subprojects {
+ project.buildDir = "${rootProject.buildDir}/${project.name}"
+}
+subprojects {
+ project.evaluationDependsOn(':app')
+}
+
+tasks.register("clean", Delete) {
+ delete rootProject.buildDir
+}
diff --git a/android/gradle.properties b/android/gradle.properties
new file mode 100644
index 00000000..94adc3a3
--- /dev/null
+++ b/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx1536M
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..3c472b99
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
diff --git a/android/settings.gradle b/android/settings.gradle
new file mode 100644
index 00000000..44e62bcf
--- /dev/null
+++ b/android/settings.gradle
@@ -0,0 +1,11 @@
+include ':app'
+
+def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
+def properties = new Properties()
+
+assert localPropertiesFile.exists()
+localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
+
+def flutterSdkPath = properties.getProperty("flutter.sdk")
+assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
+apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
diff --git a/assets/icons/logo.png b/assets/icons/logo.png
deleted file mode 100644
index 77ffea42..00000000
Binary files a/assets/icons/logo.png and /dev/null differ
diff --git a/assets/images/dash.png b/assets/images/dash.png
deleted file mode 100644
index 6ccb3f39..00000000
Binary files a/assets/images/dash.png and /dev/null differ
diff --git a/assets/images/flutterfire_300x.png b/assets/images/flutterfire_300x.png
deleted file mode 100644
index 604593b8..00000000
Binary files a/assets/images/flutterfire_300x.png and /dev/null differ
diff --git a/firebase.json b/firebase.json
new file mode 100644
index 00000000..66037326
--- /dev/null
+++ b/firebase.json
@@ -0,0 +1,16 @@
+{
+ "hosting": {
+ "public": "build/web",
+ "ignore": [
+ "firebase.json",
+ "**/.*",
+ "**/node_modules/**"
+ ],
+ "rewrites": [
+ {
+ "source": "**",
+ "destination": "/index.html"
+ }
+ ]
+ }
+}
diff --git a/ios/.gitignore b/ios/.gitignore
new file mode 100644
index 00000000..7a7f9873
--- /dev/null
+++ b/ios/.gitignore
@@ -0,0 +1,34 @@
+**/dgph
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/ephemeral/
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3
diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist
index 7c569640..9625e105 100644
--- a/ios/Flutter/AppFrameworkInfo.plist
+++ b/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 12.0
+ 11.0
diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig
new file mode 100644
index 00000000..592ceee8
--- /dev/null
+++ b/ios/Flutter/Debug.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig
new file mode 100644
index 00000000..592ceee8
--- /dev/null
+++ b/ios/Flutter/Release.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..b3bc7fbc
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,483 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
+ 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
+ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 97C146EB1CF9000F007C117D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 9740EEB11CF90186004384FC /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */,
+ );
+ name = Flutter;
+ sourceTree = "";
+ };
+ 97C146E51CF9000F007C117D = {
+ isa = PBXGroup;
+ children = (
+ 9740EEB11CF90186004384FC /* Flutter */,
+ 97C146F01CF9000F007C117D /* Runner */,
+ 97C146EF1CF9000F007C117D /* Products */,
+ );
+ sourceTree = "";
+ };
+ 97C146EF1CF9000F007C117D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146EE1CF9000F007C117D /* Runner.app */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 97C146F01CF9000F007C117D /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146FA1CF9000F007C117D /* Main.storyboard */,
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
+ 97C147021CF9000F007C117D /* Info.plist */,
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 97C146ED1CF9000F007C117D /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 9740EEB61CF901F6004384FC /* Run Script */,
+ 97C146EA1CF9000F007C117D /* Sources */,
+ 97C146EB1CF9000F007C117D /* Frameworks */,
+ 97C146EC1CF9000F007C117D /* Resources */,
+ 9705A1C41CF9048500538489 /* Embed Frameworks */,
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 97C146E61CF9000F007C117D /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 1300;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 97C146ED1CF9000F007C117D = {
+ CreatedOnToolsVersion = 7.3.1;
+ LastSwiftMigration = 1100;
+ };
+ };
+ };
+ buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 97C146E51CF9000F007C117D;
+ productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 97C146ED1CF9000F007C117D /* Runner */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 97C146EC1CF9000F007C117D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Thin Binary";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
+ };
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 97C146EA1CF9000F007C117D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C146FB1CF9000F007C117D /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C147001CF9000F007C117D /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 249021D3217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Profile;
+ };
+ 249021D4217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.eduryde;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
+ 97C147031CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 97C147041CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 97C147061CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.eduryde;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Debug;
+ };
+ 97C147071CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.eduryde;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147031CF9000F007C117D /* Debug */,
+ 97C147041CF9000F007C117D /* Release */,
+ 249021D3217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147061CF9000F007C117D /* Debug */,
+ 97C147071CF9000F007C117D /* Release */,
+ 249021D4217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 97C146E61CF9000F007C117D /* Project object */;
+}
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000..919434a6
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 00000000..18d98100
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 00000000..f9b0d7c5
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 00000000..c87d15a3
--- /dev/null
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000..1d526a16
--- /dev/null
+++ b/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 00000000..18d98100
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 00000000..f9b0d7c5
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
new file mode 100644
index 00000000..3aa7735b
--- /dev/null
+++ b/ios/Runner/AppDelegate.swift
@@ -0,0 +1,25 @@
+import UIKit
+import Flutter
+import GoogleMaps
+
+@UIApplicationMain
+@objc class AppDelegate: FlutterAppDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ GeneratedPluginRegistrant.register(with: self)
+
+ var keys: NSDictionary?
+
+ if let path = Bundle.main.path(forResource: "ApiKey", ofType: "plist") {
+ keys = NSDictionary(contentsOfFile: path)
+ }
+ if let dict = keys {
+ let apiKey = dict["google_maps_api_key"] as? String
+ GMSServices.provideAPIKey(apiKey ?? "")
+ }
+
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 00000000..d36b1fab
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,122 @@
+{
+ "images" : [
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-83.5x83.5@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "1024x1024",
+ "idiom" : "ios-marketing",
+ "filename" : "Icon-App-1024x1024@1x.png",
+ "scale" : "1x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
new file mode 100644
index 00000000..dc9ada47
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
new file mode 100644
index 00000000..7353c41e
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
new file mode 100644
index 00000000..797d452e
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
new file mode 100644
index 00000000..6ed2d933
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
new file mode 100644
index 00000000..4cd7b009
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
new file mode 100644
index 00000000..fe730945
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
new file mode 100644
index 00000000..321773cd
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
new file mode 100644
index 00000000..797d452e
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
new file mode 100644
index 00000000..502f463a
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
new file mode 100644
index 00000000..0ec30343
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
new file mode 100644
index 00000000..0ec30343
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
new file mode 100644
index 00000000..e9f5fea2
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
new file mode 100644
index 00000000..84ac32ae
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
new file mode 100644
index 00000000..8953cba0
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
new file mode 100644
index 00000000..0467bf12
Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
new file mode 100644
index 00000000..0bedcf2f
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
new file mode 100644
index 00000000..9da19eac
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
new file mode 100644
index 00000000..9da19eac
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
new file mode 100644
index 00000000..9da19eac
Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
new file mode 100644
index 00000000..89c2725b
--- /dev/null
+++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
@@ -0,0 +1,5 @@
+# Launch Screen Assets
+
+You can customize the launch screen with your own desired assets by replacing the image files in this directory.
+
+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.
\ No newline at end of file
diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 00000000..f2e259c7
--- /dev/null
+++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard
new file mode 100644
index 00000000..f3c28516
--- /dev/null
+++ b/ios/Runner/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist
new file mode 100644
index 00000000..ba18d8e6
--- /dev/null
+++ b/ios/Runner/GoogleService-Info.plist
@@ -0,0 +1,34 @@
+
+
+
+
+ CLIENT_ID
+ 168247508765-tcoltq95g1oahsg25428mmqv3aj16j8a.apps.googleusercontent.com
+ REVERSED_CLIENT_ID
+ com.googleusercontent.apps.168247508765-tcoltq95g1oahsg25428mmqv3aj16j8a
+ API_KEY
+ AIzaSyAlBX90zh6ErB0mW-FvNDEC3xZ8cKFNdK4
+ GCM_SENDER_ID
+ 168247508765
+ PLIST_VERSION
+ 1
+ BUNDLE_ID
+ com.example.eduryde
+ PROJECT_ID
+ eduryde
+ STORAGE_BUCKET
+ eduryde.appspot.com
+ IS_ADS_ENABLED
+
+ IS_ANALYTICS_ENABLED
+
+ IS_APPINVITE_ENABLED
+
+ IS_GCM_ENABLED
+
+ IS_SIGNIN_ENABLED
+
+ GOOGLE_APP_ID
+ 1:168247508765:ios:2df5ab1351ffa28a38ebf4
+
+
\ No newline at end of file
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index fc7f1dd4..27f2c2de 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -5,7 +5,7 @@
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
- Get Flutter Fire
+ Eduryde
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -13,7 +13,7 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- get_flutter_fire
+ eduryde
CFBundlePackageType
APPL
CFBundleShortVersionString
@@ -41,15 +41,11 @@
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
+ UIViewControllerBasedStatusBarAppearance
+
CADisableMinimumFrameDurationOnPhone
UIApplicationSupportsIndirectInputEvents
- NSCameraUsageDescription
- Allow access to camera
- NSMicrophoneUsageDescription
- Allow access to microphone for video recording
- NSPhotoLibraryUsageDescription
- Allow access to photo library
diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h
new file mode 100644
index 00000000..308a2a56
--- /dev/null
+++ b/ios/Runner/Runner-Bridging-Header.h
@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"
diff --git a/ios/firebase_app_id_file.json b/ios/firebase_app_id_file.json
new file mode 100644
index 00000000..712552af
--- /dev/null
+++ b/ios/firebase_app_id_file.json
@@ -0,0 +1,7 @@
+{
+ "file_generated_by": "FlutterFire CLI",
+ "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
+ "GOOGLE_APP_ID": "1:168247508765:ios:2df5ab1351ffa28a38ebf4",
+ "FIREBASE_PROJECT_ID": "eduryde",
+ "GCM_SENDER_ID": "168247508765"
+}
\ No newline at end of file
diff --git a/lib/app/middleware/auth_middleware.dart b/lib/app/middleware/auth_middleware.dart
index 827dd96c..ed855c40 100644
--- a/lib/app/middleware/auth_middleware.dart
+++ b/lib/app/middleware/auth_middleware.dart
@@ -1,94 +1,15 @@
-// ignore_for_file: avoid_print
+import 'package:flutter/material.dart';
import 'package:get/get.dart';
-import 'package:get_flutter_fire/models/role.dart';
-import 'package:get_flutter_fire/services/auth_service.dart';
-import 'package:get_flutter_fire/app/routes/app_pages.dart';
-
-Future loginVerify(bool check, GetNavConfig route,
- Future Function(GetNavConfig) redirector) async {
- final newRoute = route.location == Routes.LOGIN
- ? Routes.LOGIN
- : Routes.LOGIN_THEN(route.location);
- if (check) {
- return GetNavConfig.fromRoute(newRoute);
- }
-
- // Below could be used if the login was happening without verification.
- // This will never get reached if server is sending error in login due to non verification
- // With customClaims status == "creating", it will reach here for SignUp case only
- if (!AuthService.to.isEmailVerified && !AuthService.to.registered.value) {
- return GetNavConfig.fromRoute(route.location == Routes.REGISTER
- ? Routes.REGISTER
- : Routes.REGISTER_THEN(route.location));
- }
-
- return await redirector(route);
-}
-
-// class EnsureAuthMiddleware extends GetMiddleware {
-// @override
-// Future redirectDelegate(GetNavConfig route) async {
-// // you can do whatever you want here
-// // but it's preferable to make this method fast
-
-// return await loginVerify(
-// !AuthService.to.isLoggedInValue, route, super.redirectDelegate);
-// }
-// }
-
-class EnsureNotAuthedOrGuestMiddleware extends GetMiddleware {
- //AccessLevel.notAuthed
- @override
- Future redirectDelegate(GetNavConfig route) async {
- if (AuthService.to.isLoggedInValue && !AuthService.to.isAnon) {
- //NEVER navigate to auth screen, when user is already authed
- return GetNavConfig.fromRoute(
- AuthService.to.registered.value ? Routes.HOME : Routes.REGISTER);
- }
- return await super.redirectDelegate(route);
- }
-}
-
-class EnsureAuthedAndNotGuestMiddleware extends GetMiddleware {
- //AccessLevel.authenticated
- @override
- Future redirectDelegate(GetNavConfig route) async {
- return await loginVerify(
- !AuthService.to.isLoggedInValue || AuthService.to.isAnon,
- route,
- super.redirectDelegate);
- }
-}
-
-class EnsureRoleMiddleware extends GetMiddleware {
- //AccessLevel.roleBased
- Role role;
- EnsureRoleMiddleware(this.role);
+import '../../services/auth_service.dart';
+import '../routes/app_pages.dart';
+class AuthMiddleware extends GetMiddleware {
@override
- Future redirectDelegate(GetNavConfig route) async {
- if (!AuthService.to.isLoggedInValue || !AuthService.to.hasRole(role)) {
- final newRoute = Routes.LOGIN_THEN(route.location);
- return GetNavConfig.fromRoute(newRoute);
- }
- return await super.redirectDelegate(route);
- }
-}
-
-class EnsureAuthOrGuestMiddleware extends GetMiddleware {
- //AccessLevel.guest
- @override
- Future redirectDelegate(GetNavConfig route) async {
- // you can do whatever you want here
- // but it's preferable to make this method fast
- // In this case this is taking human input and is not fast
-
- if (!AuthService.to.isLoggedInValue) {
- bool? value = await AuthService.to.guest();
- if (value != true) {
- return GetNavConfig.fromRoute(Routes.LOGIN);
- }
+ RouteSettings? redirect(String? route) {
+ final authService = Get.find();
+ if (authService.currentUser != null) {
+ return RouteSettings(name: Routes.HOME);
}
- return await super.redirectDelegate(route);
+ return null;
}
-}
+}
\ No newline at end of file
diff --git a/lib/app/modules/active_ride/bindings/active_ride_binding.dart b/lib/app/modules/active_ride/bindings/active_ride_binding.dart
new file mode 100644
index 00000000..e347626e
--- /dev/null
+++ b/lib/app/modules/active_ride/bindings/active_ride_binding.dart
@@ -0,0 +1,11 @@
+import 'package:get/get.dart';
+import '../controllers/active_ride_controller.dart';
+
+class ActiveRideBinding extends Bindings {
+ @override
+ void dependencies() {
+ Get.lazyPut(
+ () => ActiveRideController(),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/active_ride/controllers/active_ride_controller.dart b/lib/app/modules/active_ride/controllers/active_ride_controller.dart
new file mode 100644
index 00000000..42fae2d6
--- /dev/null
+++ b/lib/app/modules/active_ride/controllers/active_ride_controller.dart
@@ -0,0 +1,182 @@
+import 'dart:async';
+import 'package:flutter/foundation.dart';
+import 'package:get/get.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
+import 'package:location/location.dart';
+import 'package:url_launcher/url_launcher.dart';
+import 'package:flutter/material.dart';
+import '../../../../models/ride.dart';
+import '../../../../services/auth_service.dart';
+import '../../../../services/firestore_service.dart';
+import '../../../../private/api_keys.dart';
+
+class ActiveRideController extends GetxController {
+ final AuthService _authService = Get.find();
+ final FirestoreService _firestoreService = Get.find();
+
+ final Rx activeRide = Rx(null);
+ final RxBool isDriver = false.obs;
+ final RxBool mapRendered = false.obs;
+ final Rx currentLocation = Rx(null);
+ final RxSet markers = RxSet();
+ final RxBool isLoading = true.obs;
+ final RxBool hasLocationPermission = false.obs;
+
+ GoogleMapController? mapController;
+ Location location = Location();
+
+ @override
+ void onInit() {
+ super.onInit();
+ _subscribeToActiveRide();
+ _initializeLocationAndMap();
+ }
+
+ void _subscribeToActiveRide() {
+ final user = _authService.currentUser;
+ if (user != null && user.email != null) {
+ print("Current user email: ${user.email}"); // Debug print
+ final rideStream = _firestoreService.getActiveRideStream(user.email!);
+ ever(activeRide, (_) => _updateMapData());
+ rideStream.listen((ride) {
+ print("Received ride: ${ride?.id}"); // Debug print
+ activeRide.value = ride;
+ if (ride != null) {
+ print("Ride status: ${ride.tripStatus}"); // Debug print
+ isDriver.value = ride.driverId == user.email;
+ print("Is driver: ${isDriver.value}"); // Debug print
+ } else {
+ print("No active ride found"); // Debug print
+ }
+ });
+ } else {
+ print("No current user or email is null"); // Debug print
+ }
+ }
+
+ Future _initializeLocationAndMap() async {
+ try {
+ bool serviceEnabled;
+ PermissionStatus permissionGranted;
+
+ if (!kIsWeb) {
+ serviceEnabled = await location.serviceEnabled();
+ if (!serviceEnabled) {
+ serviceEnabled = await location.requestService();
+ if (!serviceEnabled) {
+ isLoading.value = false;
+ return;
+ }
+ }
+
+ permissionGranted = await location.hasPermission();
+ if (permissionGranted == PermissionStatus.denied) {
+ permissionGranted = await location.requestPermission();
+ if (permissionGranted != PermissionStatus.granted) {
+ isLoading.value = false;
+ return;
+ }
+ }
+ }
+
+ hasLocationPermission.value = true;
+ currentLocation.value = await location.getLocation();
+ location.onLocationChanged.listen((LocationData locationData) {
+ currentLocation.value = locationData;
+ _updateMapData();
+ });
+ } catch (e) {
+ print('Error initializing location: $e');
+ hasLocationPermission.value = false;
+ } finally {
+ isLoading.value = false;
+ }
+ }
+
+ void onMapCreated(GoogleMapController controller) {
+ mapController = controller;
+ _updateMapData();
+ }
+
+ void _updateMapData() {
+ if (activeRide.value != null && currentLocation.value != null && mapController != null) {
+ markers.clear();
+
+ markers.add(Marker(
+ markerId: MarkerId('currentLocation'),
+ position: LatLng(currentLocation.value!.latitude!, currentLocation.value!.longitude!),
+ infoWindow: InfoWindow(title: 'Your Location'),
+ ));
+
+ markers.add(Marker(
+ markerId: MarkerId('pickup'),
+ position: LatLng(activeRide.value!.pickupLat, activeRide.value!.pickupLng),
+ infoWindow: InfoWindow(title: 'Pickup Location'),
+ ));
+
+ markers.add(Marker(
+ markerId: MarkerId('destination'),
+ position: LatLng(activeRide.value!.destinationLat, activeRide.value!.destinationLng),
+ infoWindow: InfoWindow(title: 'Destination'),
+ ));
+
+ mapController!.animateCamera(CameraUpdate.newLatLngZoom(
+ LatLng(currentLocation.value!.latitude!, currentLocation.value!.longitude!),
+ 14.0,
+ ));
+
+ mapRendered.value = true;
+ }
+ }
+
+ Future navigateToGoogleMaps() async {
+ if (activeRide.value != null && currentLocation.value != null) {
+ double destLat, destLng;
+ if (activeRide.value!.tripStatus == 'Accepted') {
+ destLat = activeRide.value!.pickupLat;
+ destLng = activeRide.value!.pickupLng;
+ } else {
+ destLat = activeRide.value!.destinationLat;
+ destLng = activeRide.value!.destinationLng;
+ }
+
+ final Uri url = Uri.parse(
+ 'https://www.google.com/maps/dir/?api=1&origin=${currentLocation.value!.latitude},${currentLocation.value!.longitude}&destination=$destLat,$destLng&travelmode=driving'
+ );
+
+ if (await canLaunchUrl(url)) {
+ await launchUrl(url, mode: LaunchMode.externalApplication);
+ } else {
+ throw 'Could not launch $url';
+ }
+ }
+ }
+
+ void startRide() async {
+ if (activeRide.value != null && isDriver.value) {
+ await _firestoreService.updateRideStatus(activeRide.value!.id, 'InProgress');
+ print("Ride started"); // Debug print
+ }
+ }
+
+ void completeRide() async {
+ if (activeRide.value != null && isDriver.value) {
+ await _firestoreService.completeRide(activeRide.value!.id);
+ print("Ride completed"); // Debug print
+ // You might want to navigate the user away from the active ride screen here
+ }
+ }
+
+ void cancelRide() async {
+ if (activeRide.value != null) {
+ await _firestoreService.cancelRide(activeRide.value!.id);
+ print("Ride cancelled"); // Debug print
+ }
+ }
+
+ @override
+ void onClose() {
+ mapController?.dispose();
+ super.onClose();
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/active_ride/views/active_ride_view.dart b/lib/app/modules/active_ride/views/active_ride_view.dart
new file mode 100644
index 00000000..e4cdf7eb
--- /dev/null
+++ b/lib/app/modules/active_ride/views/active_ride_view.dart
@@ -0,0 +1,118 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
+import '../controllers/active_ride_controller.dart';
+
+class ActiveRideView extends GetView {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(title: Text('Active Ride')),
+ body: Obx(() {
+ if (controller.isLoading.value) {
+ return Center(child: CircularProgressIndicator());
+ } else if (!controller.hasLocationPermission.value) {
+ return Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text('Location permission is required to use this feature.'),
+ ElevatedButton(
+ onPressed: () => controller.onInit(),
+ child: Text('Request Permission'),
+ ),
+ ],
+ ),
+ );
+ } else if (controller.activeRide.value == null) {
+ return Center(child: Text('No active ride'));
+ } else {
+ return Stack(
+ children: [
+ GoogleMap(
+ initialCameraPosition: CameraPosition(
+ target: LatLng(
+ controller.currentLocation.value?.latitude ?? 0,
+ controller.currentLocation.value?.longitude ?? 0,
+ ),
+ zoom: 14.0,
+ ),
+ onMapCreated: controller.onMapCreated,
+ markers: controller.markers,
+ myLocationEnabled: true,
+ myLocationButtonEnabled: true,
+ ),
+ Positioned(
+ bottom: 16,
+ left: 16,
+ right: 16,
+ child: Card(
+ child: Padding(
+ padding: const EdgeInsets.all(16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text('Status: ${controller.activeRide.value!.tripStatus}'),
+ Text('Pickup: ${controller.activeRide.value!.pickupLocation}'),
+ Text('Destination: ${controller.activeRide.value!.destination}'),
+ SizedBox(height: 16),
+ Text('Is Driver: ${controller.isDriver.value}'), // Debug text
+ if (controller.isDriver.value) ...[
+ _buildDriverButtons(),
+ ] else
+ _buildRiderButtons(),
+ SizedBox(height: 8),
+ ElevatedButton(
+ onPressed: controller.navigateToGoogleMaps,
+ child: Text('Navigate'),
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.green,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+ }),
+ );
+ }
+
+ Widget _buildDriverButtons() {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ if (controller.activeRide.value!.tripStatus == 'Accepted')
+ ElevatedButton(
+ onPressed: controller.startRide,
+ child: Text('Start Ride'),
+ style: ElevatedButton.styleFrom(backgroundColor: Colors.blue),
+ ),
+ if (controller.activeRide.value!.tripStatus == 'InProgress')
+ ElevatedButton(
+ onPressed: controller.completeRide,
+ child: Text('Complete Ride'),
+ style: ElevatedButton.styleFrom(backgroundColor: Colors.green),
+ ),
+ SizedBox(height: 8),
+ ElevatedButton(
+ onPressed: controller.cancelRide,
+ child: Text('Cancel Ride'),
+ style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
+ ),
+ ],
+ );
+ }
+
+ Widget _buildRiderButtons() {
+ return ElevatedButton(
+ onPressed: controller.cancelRide,
+ child: Text('Cancel Ride'),
+ style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/add_ride/bindings/add_ride_binding.dart b/lib/app/modules/add_ride/bindings/add_ride_binding.dart
new file mode 100644
index 00000000..6d38ea56
--- /dev/null
+++ b/lib/app/modules/add_ride/bindings/add_ride_binding.dart
@@ -0,0 +1,11 @@
+import 'package:get/get.dart';
+import '../controllers/add_ride_controller.dart';
+
+class AddRideBinding extends Bindings {
+ @override
+ void dependencies() {
+ Get.lazyPut(
+ () => AddRidesController(),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/add_ride/controllers/add_ride_controller.dart b/lib/app/modules/add_ride/controllers/add_ride_controller.dart
new file mode 100644
index 00000000..0bf88444
--- /dev/null
+++ b/lib/app/modules/add_ride/controllers/add_ride_controller.dart
@@ -0,0 +1,147 @@
+import 'package:get/get.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_google_places_sdk/flutter_google_places_sdk.dart';
+import 'package:intl/intl.dart';
+import '../../../../models/ride.dart';
+import '../../../../services/auth_service.dart';
+import '../../../../services/firestore_service.dart';
+import '../../../../private/api_keys.dart';
+
+class AddRidesController extends GetxController {
+ final FirestoreService _firestoreService = Get.find();
+ final AuthService _authService = Get.find();
+ late FlutterGooglePlacesSdk places;
+
+ final formKey = GlobalKey();
+ final dateTimeController = TextEditingController();
+ final destinationController = TextEditingController();
+ final pickupController = TextEditingController();
+ final fareController = TextEditingController();
+
+ final RxBool isFormVisible = false.obs;
+ final Rx editingRide = Rx(null);
+ final RxList myRides = [].obs;
+
+ final Rx destinationPlace = Rx(null);
+ final Rx pickupPlace = Rx(null);
+ final Rx destinationLatLng = Rx(null);
+ final Rx pickupLatLng = Rx(null);
+
+ @override
+ void onInit() {
+ super.onInit();
+ places = FlutterGooglePlacesSdk(MAPS_API_KEY_WEB);
+ fetchMyRides();
+ }
+
+ void fetchMyRides() async {
+ String? currentUserEmail = _authService.currentUser?.email;
+ if (currentUserEmail != null) {
+ myRides.value = await _firestoreService.getMyRides(currentUserEmail);
+ }
+ }
+
+ void toggleFormVisibility({Ride? ride}) {
+ isFormVisible.toggle();
+ if (!isFormVisible.value) {
+ editingRide.value = null;
+ clearForm();
+ } else if (ride != null) {
+ editingRide.value = ride;
+ fillForm(ride);
+ }
+ }
+
+ void clearForm() {
+ dateTimeController.clear();
+ destinationController.clear();
+ pickupController.clear();
+ fareController.clear();
+ destinationPlace.value = null;
+ pickupPlace.value = null;
+ destinationLatLng.value = null;
+ pickupLatLng.value = null;
+ }
+
+ void fillForm(Ride ride) {
+ dateTimeController.text = DateFormat('yyyy-MM-dd HH:mm').format(ride.departureDateTime);
+ destinationController.text = ride.destination;
+ pickupController.text = ride.pickupLocation;
+ fareController.text = ride.fare.toString();
+ destinationLatLng.value = LatLng(lat: ride.destinationLat, lng: ride.destinationLng);
+ pickupLatLng.value = LatLng(lat: ride.pickupLat, lng: ride.pickupLng);
+ }
+
+ Future searchPlace(TextEditingController controller, bool isDestination) async {
+ final response = await places.findAutocompletePredictions(controller.text);
+ if (response.predictions.isNotEmpty) {
+ final prediction = response.predictions[0];
+ final placeId = prediction.placeId;
+ final placeResponse = await places.fetchPlace(placeId, fields: [PlaceField.Location]);
+ final location = placeResponse.place?.latLng;
+ if (location != null) {
+ if (isDestination) {
+ destinationLatLng.value = location;
+ destinationPlace.value = placeResponse.place;
+ } else {
+ pickupLatLng.value = location;
+ pickupPlace.value = placeResponse.place;
+ }
+ controller.text = prediction.fullText;
+ }
+ }
+ }
+
+ Future saveRide() async {
+ if (formKey.currentState!.validate()) {
+ final currentUser = _authService.currentUser;
+ if (currentUser != null) {
+ final dateTime = DateFormat('yyyy-MM-dd HH:mm').parse(dateTimeController.text);
+ Ride ride = Ride(
+ id: editingRide.value?.id ?? '',
+ driverId: currentUser.email!,
+ riderIds: editingRide.value?.riderIds ?? [],
+ destination: destinationController.text,
+ destinationLat: destinationLatLng.value?.lat ?? 0,
+ destinationLng: destinationLatLng.value?.lng ?? 0,
+ pickupLocation: pickupController.text,
+ pickupLat: pickupLatLng.value?.lat ?? 0,
+ pickupLng: pickupLatLng.value?.lng ?? 0,
+ departureDateTime: dateTime,
+ fare: double.parse(fareController.text),
+ tripStatus: editingRide.value?.tripStatus ?? 'Pending',
+ );
+
+ if (editingRide.value != null) {
+ await _firestoreService.updateRide(ride);
+ } else {
+ await _firestoreService.addRide(ride);
+ }
+
+ fetchMyRides();
+ toggleFormVisibility();
+ }
+ }
+ }
+
+ Future deleteRide() async {
+ if (editingRide.value != null) {
+ await _firestoreService.deleteRide(editingRide.value!.id);
+ fetchMyRides();
+ toggleFormVisibility();
+ }
+ }
+
+ void editRide(Ride ride) {
+ toggleFormVisibility(ride: ride);
+ }
+
+ @override
+ void onClose() {
+ dateTimeController.dispose();
+ destinationController.dispose();
+ pickupController.dispose();
+ fareController.dispose();
+ super.onClose();
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/add_ride/views/add_ride_view.dart b/lib/app/modules/add_ride/views/add_ride_view.dart
new file mode 100644
index 00000000..0b8b2b86
--- /dev/null
+++ b/lib/app/modules/add_ride/views/add_ride_view.dart
@@ -0,0 +1,152 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import '../controllers/add_ride_controller.dart';
+import '../../../widgets/travel_card.dart';
+import '../../../widgets/top_text.dart';
+import '../../../widgets/auto_complete_text_field.dart';
+import 'package:intl/intl.dart';
+
+class AddRidesView extends GetView {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: Colors.grey.shade300,
+ floatingActionButton: FloatingActionButton(
+ onPressed: () => controller.toggleFormVisibility(),
+ backgroundColor: Colors.black,
+ child: const Icon(Icons.add),
+ ),
+ body: Stack(
+ children: [
+ Column(
+ children: [
+ const Padding(
+ padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 8.0),
+ child: TopText(
+ text: 'My Rydes',
+ ),
+ ),
+ Expanded(
+ child: Obx(() => ListView.builder(
+ itemCount: controller.myRides.length,
+ itemBuilder: (context, index) {
+ final ride = controller.myRides[index];
+ return TravelCard(
+ ride: ride,
+ onPressed: () => controller.editRide(ride),
+ isEditable: true,
+ isUserRide: true,
+ );
+ },
+ )),
+ ),
+ ],
+ ),
+ Obx(() => controller.isFormVisible.value
+ ? Center(
+ child: Container(
+ width: MediaQuery.of(context).size.width * 0.8,
+ padding: const EdgeInsets.all(20.0),
+ decoration: BoxDecoration(
+ color: Theme.of(context).canvasColor,
+ borderRadius: BorderRadius.circular(15.0),
+ boxShadow: const [
+ BoxShadow(
+ color: Colors.black26,
+ blurRadius: 15.0,
+ spreadRadius: 1.0,
+ ),
+ ],
+ ),
+ child: Form(
+ key: controller.formKey,
+ child: ListView(
+ shrinkWrap: true,
+ children: [
+ _buildDateTimeField(context),
+ AutoCompleteTextField(
+ controller: controller.destinationController,
+ labelText: 'Destination',
+ validator: (value) => value!.isEmpty ? 'Please enter destination' : null,
+ places: controller.places,
+ placeRx: controller.destinationPlace,
+ latLngRx: controller.destinationLatLng,
+ ),
+ AutoCompleteTextField(
+ controller: controller.pickupController,
+ labelText: 'Pickup Location',
+ validator: (value) => value!.isEmpty ? 'Please enter pickup location' : null,
+ places: controller.places,
+ placeRx: controller.pickupPlace,
+ latLngRx: controller.pickupLatLng,
+ ),
+ TextFormField(
+ controller: controller.fareController,
+ decoration: const InputDecoration(labelText: 'Fare'),
+ keyboardType: TextInputType.number,
+ validator: (value) => value!.isEmpty ? 'Please enter fare' : null,
+ ),
+ SizedBox(height: 20),
+ ElevatedButton(
+ onPressed: controller.saveRide,
+ child: Text(controller.editingRide.value != null ? 'Update Ride' : 'Save Ride'),
+ ),
+ if (controller.editingRide.value != null)
+ ElevatedButton(
+ onPressed: controller.deleteRide,
+ child: const Text('Delete Ride'),
+ ),
+ ElevatedButton(
+ onPressed: controller.toggleFormVisibility,
+ child: const Text('Cancel'),
+ ),
+ ],
+ ),
+ ),
+ ),
+ )
+ : SizedBox.shrink()
+ ),
+ ],
+ ),
+ );
+ }
+
+ Widget _buildDateTimeField(BuildContext context) {
+ return InkWell(
+ onTap: () async {
+ final DateTime? pickedDate = await showDatePicker(
+ context: context,
+ initialDate: DateTime.now(),
+ firstDate: DateTime.now(),
+ lastDate: DateTime.now().add(const Duration(days: 365)),
+ );
+ if (pickedDate != null) {
+ final TimeOfDay? pickedTime = await showTimePicker(
+ context: context,
+ initialTime: TimeOfDay.now(),
+ );
+ if (pickedTime != null) {
+ final DateTime pickedDateTime = DateTime(
+ pickedDate.year,
+ pickedDate.month,
+ pickedDate.day,
+ pickedTime.hour,
+ pickedTime.minute,
+ );
+ controller.dateTimeController.text = DateFormat('yyyy-MM-dd HH:mm').format(pickedDateTime);
+ }
+ }
+ },
+ child: AbsorbPointer(
+ child: TextFormField(
+ controller: controller.dateTimeController,
+ decoration: const InputDecoration(
+ labelText: 'Date and Time',
+ ),
+ validator: (value) => value!.isEmpty ? 'Please select date and time' : null,
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/cart/bindings/cart_binding.dart b/lib/app/modules/cart/bindings/cart_binding.dart
deleted file mode 100644
index 009c52ae..00000000
--- a/lib/app/modules/cart/bindings/cart_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/cart_controller.dart';
-
-class CartBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => CartController(),
- );
- }
-}
diff --git a/lib/app/modules/cart/controllers/cart_controller.dart b/lib/app/modules/cart/controllers/cart_controller.dart
deleted file mode 100644
index c938ec4c..00000000
--- a/lib/app/modules/cart/controllers/cart_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class CartController extends GetxController {
- //TODO: Implement CartController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/cart/views/cart_view.dart b/lib/app/modules/cart/views/cart_view.dart
deleted file mode 100644
index 3e048c79..00000000
--- a/lib/app/modules/cart/views/cart_view.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-import 'package:get_flutter_fire/app/routes/app_pages.dart';
-import '../../../widgets/screen_widget.dart';
-import '../../../../services/auth_service.dart';
-import '../controllers/cart_controller.dart';
-
-class CartView extends GetView {
- const CartView({super.key});
- @override
- Widget build(BuildContext context) {
- return ScreenWidget(
- appBar: AppBar(
- title: Text('${AuthService.to.userName} Cart'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'CartView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- screen: screen!,
- );
- }
-}
diff --git a/lib/app/modules/categories/bindings/categories_binding.dart b/lib/app/modules/categories/bindings/categories_binding.dart
deleted file mode 100644
index 06e278c8..00000000
--- a/lib/app/modules/categories/bindings/categories_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/categories_controller.dart';
-
-class CategoriesBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => CategoriesController(),
- );
- }
-}
diff --git a/lib/app/modules/categories/controllers/categories_controller.dart b/lib/app/modules/categories/controllers/categories_controller.dart
deleted file mode 100644
index 6612e511..00000000
--- a/lib/app/modules/categories/controllers/categories_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class CategoriesController extends GetxController {
- //TODO: Implement CategoriesController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/categories/views/categories_view.dart b/lib/app/modules/categories/views/categories_view.dart
deleted file mode 100644
index 97bfef38..00000000
--- a/lib/app/modules/categories/views/categories_view.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/categories_controller.dart';
-
-class CategoriesView extends GetView {
- const CategoriesView({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('CategoriesView'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'CategoriesView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/checkout/bindings/checkout_binding.dart b/lib/app/modules/checkout/bindings/checkout_binding.dart
deleted file mode 100644
index 42202b56..00000000
--- a/lib/app/modules/checkout/bindings/checkout_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/checkout_controller.dart';
-
-class CheckoutBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => CheckoutController(),
- );
- }
-}
diff --git a/lib/app/modules/checkout/controllers/checkout_controller.dart b/lib/app/modules/checkout/controllers/checkout_controller.dart
deleted file mode 100644
index aa1265f6..00000000
--- a/lib/app/modules/checkout/controllers/checkout_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class CheckoutController extends GetxController {
- //TODO: Implement CheckoutController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/checkout/views/checkout_view.dart b/lib/app/modules/checkout/views/checkout_view.dart
deleted file mode 100644
index b8b17072..00000000
--- a/lib/app/modules/checkout/views/checkout_view.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/checkout_controller.dart';
-
-class CheckoutView extends GetView {
- const CheckoutView({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('CheckoutView'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'CheckoutView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/dashboard/bindings/dashboard_binding.dart b/lib/app/modules/dashboard/bindings/dashboard_binding.dart
deleted file mode 100644
index da48f13c..00000000
--- a/lib/app/modules/dashboard/bindings/dashboard_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/dashboard_controller.dart';
-
-class DashboardBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => DashboardController(),
- );
- }
-}
diff --git a/lib/app/modules/dashboard/controllers/dashboard_controller.dart b/lib/app/modules/dashboard/controllers/dashboard_controller.dart
deleted file mode 100644
index 24d91a16..00000000
--- a/lib/app/modules/dashboard/controllers/dashboard_controller.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-import 'dart:async';
-
-import 'package:get/get.dart';
-
-class DashboardController extends GetxController {
- final now = DateTime.now().obs;
- @override
- void onReady() {
- super.onReady();
- Timer.periodic(
- const Duration(seconds: 1),
- (timer) {
- now.value = DateTime.now();
- },
- );
- }
-}
diff --git a/lib/app/modules/dashboard/views/dashboard_view.dart b/lib/app/modules/dashboard/views/dashboard_view.dart
deleted file mode 100644
index f475030f..00000000
--- a/lib/app/modules/dashboard/views/dashboard_view.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../controllers/dashboard_controller.dart';
-
-class DashboardView extends GetView {
- const DashboardView({super.key});
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: Obx(
- () => Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text(
- 'DashboardView is working',
- style: TextStyle(fontSize: 20),
- ),
- Text('Time: ${controller.now.value.toString()}'),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/driver_dashboard/bindings/driver_dashboard_binding.dart b/lib/app/modules/driver_dashboard/bindings/driver_dashboard_binding.dart
new file mode 100644
index 00000000..120f60aa
--- /dev/null
+++ b/lib/app/modules/driver_dashboard/bindings/driver_dashboard_binding.dart
@@ -0,0 +1,11 @@
+import 'package:get/get.dart';
+import '../controllers/driver_dashboard_controller.dart';
+
+class DriverDashboardBinding extends Bindings {
+ @override
+ void dependencies() {
+ Get.lazyPut(
+ () => DriverDashboardController(),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/driver_dashboard/controllers/driver_dashboard_controller.dart b/lib/app/modules/driver_dashboard/controllers/driver_dashboard_controller.dart
new file mode 100644
index 00000000..bd4869ce
--- /dev/null
+++ b/lib/app/modules/driver_dashboard/controllers/driver_dashboard_controller.dart
@@ -0,0 +1,62 @@
+import 'package:get/get.dart';
+import '../../../../models/ride.dart';
+import '../../../../services/auth_service.dart';
+import '../../../../services/firestore_service.dart';
+import '../../../routes/app_pages.dart';
+
+
+class DriverDashboardController extends GetxController {
+ final FirestoreService _firestoreService = Get.find();
+ final AuthService _authService = Get.find();
+
+ final RxList activeRides = [].obs;
+ final RxList pendingRides = [].obs;
+ final RxBool isLoading = false.obs;
+
+ @override
+ void onInit() {
+ super.onInit();
+ _loadDriverRides();
+ }
+
+ void _loadDriverRides() async {
+ isLoading.value = true;
+ try {
+ final driverId = _authService.currentUser!.uid;
+ activeRides.value = await _firestoreService.getDriverActiveRides(driverId);
+ pendingRides.value = await _firestoreService.getDriverPendingRides(driverId);
+ } catch (e) {
+ Get.snackbar('Error', 'Failed to load rides: $e');
+ } finally {
+ isLoading.value = false;
+ }
+ }
+
+ void startRide(String rideId) async {
+ try {
+ await _firestoreService.startRide(rideId);
+ _loadDriverRides();
+ } catch (e) {
+ Get.snackbar('Error', 'Failed to start ride: $e');
+ }
+ }
+
+ void completeRide(String rideId) async {
+ try {
+ await _firestoreService.completeRide(rideId);
+ _loadDriverRides();
+ } catch (e) {
+ Get.snackbar('Error', 'Failed to complete ride: $e');
+ }
+ }
+
+ @override
+ void onReady() {
+ super.onReady();
+ ever(Get.routing.obs, (_) {
+ if (Get.previousRoute == Routes.ADD_RIDE) {
+ _loadDriverRides();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/driver_dashboard/views/driver_dashboard_view.dart b/lib/app/modules/driver_dashboard/views/driver_dashboard_view.dart
new file mode 100644
index 00000000..d76bd30d
--- /dev/null
+++ b/lib/app/modules/driver_dashboard/views/driver_dashboard_view.dart
@@ -0,0 +1,64 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import '../../../routes/app_pages.dart';
+import '../../../widgets/travel_card.dart';
+import '../controllers/driver_dashboard_controller.dart';
+
+
+class DriverDashboardView extends GetView {
+ const DriverDashboardView({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(title: const Text('Driver Dashboard')),
+ body: Obx(() => controller.isLoading.value
+ ? const Center(child: CircularProgressIndicator())
+ : SingleChildScrollView(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const Padding(
+ padding: EdgeInsets.all(16.0),
+ child: Text('Active Rides', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
+ ),
+ ListView.builder(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: controller.activeRides.length,
+ itemBuilder: (context, index) {
+ final ride = controller.activeRides[index];
+ TravelCard(
+ ride: ride,
+ onPressed: () => controller.completeRide(ride.id),
+ );
+ },
+ ),
+ const Padding(
+ padding: EdgeInsets.all(16.0),
+ child: Text('Pending Rides', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
+ ),
+ ListView.builder(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: controller.pendingRides.length,
+ itemBuilder: (context, index) {
+ final ride = controller.pendingRides[index];
+ TravelCard(
+ ride: ride,
+ onPressed: () => controller.startRide(ride.id),
+ );
+ },
+ ),
+ ],
+ ),
+ ),
+ ),
+ floatingActionButton: FloatingActionButton(
+ onPressed: () => Get.toNamed(Routes.ADD_RIDE),
+ tooltip: 'Add New Ride',
+ child: const Icon(Icons.add),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/home/bindings/home_binding.dart b/lib/app/modules/home/bindings/home_binding.dart
index d08a80d4..d9400696 100644
--- a/lib/app/modules/home/bindings/home_binding.dart
+++ b/lib/app/modules/home/bindings/home_binding.dart
@@ -1,12 +1,19 @@
import 'package:get/get.dart';
-
import '../controllers/home_controller.dart';
+import '../../settings/controllers/settings_controller.dart';
+import '../../add_ride/controllers/add_ride_controller.dart';
+import '../../ride_search/controllers/ride_search_controller.dart';
+import '../../past_rides/controllers/past_rides_controller.dart';
+import '../../active_ride/controllers/active_ride_controller.dart'; // Import ActiveRideController
class HomeBinding extends Bindings {
@override
void dependencies() {
- Get.lazyPut(
- () => HomeController(),
- );
+ Get.lazyPut(() => HomeController());
+ Get.lazyPut(() => SettingsController());
+ Get.lazyPut(() => AddRidesController());
+ Get.lazyPut(() => RideSearchController());
+ Get.lazyPut(() => PastRidesController());
+ Get.lazyPut(() => ActiveRideController()); // Bind ActiveRideController
}
}
diff --git a/lib/app/modules/home/controllers/home_controller.dart b/lib/app/modules/home/controllers/home_controller.dart
index f058de2a..b0cedc21 100644
--- a/lib/app/modules/home/controllers/home_controller.dart
+++ b/lib/app/modules/home/controllers/home_controller.dart
@@ -1,14 +1,11 @@
-import 'package:get/get.dart';
+// lib/app/modules/home/controllers/home_controller.dart
-import '../../../../models/role.dart';
-import '../../../../services/auth_service.dart';
+import 'package:get/get.dart';
class HomeController extends GetxController {
- final Rx chosenRole = Rx(AuthService.to.maxRole);
-
- // Role get role => AuthService.to.maxRole;
-
- get isBuyer => chosenRole.value == Role.buyer;
+ final RxInt currentIndex = 0.obs;
- get isAdmin => chosenRole.value == Role.admin;
-}
+ void changePage(int index) {
+ currentIndex.value = index;
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart
index 0cfc040d..15ffe149 100644
--- a/lib/app/modules/home/views/home_view.dart
+++ b/lib/app/modules/home/views/home_view.dart
@@ -1,34 +1,45 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
-import '../../../routes/app_pages.dart';
-import '../../../widgets/screen_widget.dart';
import '../controllers/home_controller.dart';
+import '../../ride_search/views/ride_search_view.dart';
+import '../../add_ride/views/add_ride_view.dart';
+import '../../past_rides/views/past_rides_view.dart';
+import '../../settings/views/settings_view.dart';
+import '../../active_ride/views/active_ride_view.dart'; // Import ActiveRideView
class HomeView extends GetView {
- const HomeView({super.key});
-
@override
Widget build(BuildContext context) {
- return GetRouterOutlet.builder(
- builder: (context, delegate, currentRoute) {
- var arg = Get.rootDelegate.arguments();
- if (arg != null) {
- controller.chosenRole.value = arg["role"];
+ return Scaffold(
+ body: Obx(() {
+ switch (controller.currentIndex.value) {
+ case 0:
+ return RideSearchView();
+ case 1:
+ return AddRidesView();
+ case 2:
+ return PastRidesView();
+ case 3:
+ return ActiveRideView(); // New Active Ride tab
+ case 4:
+ return SettingsView();
+ default:
+ return RideSearchView();
}
- var route = controller.chosenRole.value.tabs[0].route;
- //This router outlet handles the appbar and the bottom navigation bar
- return ScreenWidget(
- screen: screen!,
- body: GetRouterOutlet(
- initialRoute: route,
- // anchorRoute: Routes.HOME,
- key: Get.nestedKey(route),
- ),
- role: controller.chosenRole.value,
- delegate: delegate,
- currentRoute: currentRoute,
- );
- },
+ }),
+ bottomNavigationBar: Obx(() => BottomNavigationBar(
+ currentIndex: controller.currentIndex.value,
+ onTap: controller.changePage,
+ selectedItemColor: Colors.black,
+ unselectedItemColor: Colors.black54,
+ items: const [
+ BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
+ BottomNavigationBarItem(icon: Icon(Icons.add), label: 'Add Ride'),
+ BottomNavigationBarItem(icon: Icon(Icons.history), label: 'Past Rides'),
+ BottomNavigationBarItem(icon: Icon(Icons.location_on), label: 'Active Ride'), // New tab
+ BottomNavigationBarItem(icon: Icon(Icons.settings), label: 'Settings'),
+ ],
+ )),
);
}
}
diff --git a/lib/app/modules/login/bindings/login_binding.dart b/lib/app/modules/login/bindings/login_binding.dart
index ac119f4a..fa367860 100644
--- a/lib/app/modules/login/bindings/login_binding.dart
+++ b/lib/app/modules/login/bindings/login_binding.dart
@@ -1,12 +1,11 @@
import 'package:get/get.dart';
-
import '../controllers/login_controller.dart';
class LoginBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(
- () => LoginController(),
+ () => LoginController(),
);
}
-}
+}
\ No newline at end of file
diff --git a/lib/app/modules/login/controllers/login_controller.dart b/lib/app/modules/login/controllers/login_controller.dart
index 5178fec9..5044e726 100644
--- a/lib/app/modules/login/controllers/login_controller.dart
+++ b/lib/app/modules/login/controllers/login_controller.dart
@@ -1,20 +1,18 @@
import 'package:get/get.dart';
-
+import 'package:flutter/material.dart';
import '../../../../services/auth_service.dart';
class LoginController extends GetxController {
- static AuthService get to => Get.find();
-
- final Rx showReverificationButton = Rx(false);
-
- bool get isRobot => AuthService.to.robot.value == true;
-
- set robot(bool v) => AuthService.to.robot.value = v;
+ final AuthService _authService = Get.find();
- bool get isLoggedIn => AuthService.to.isLoggedInValue;
+ final emailController = TextEditingController();
+ final passwordController = TextEditingController();
- bool get isAnon => AuthService.to.isAnon;
+ void login() {
+ _authService.signIn(emailController.text, passwordController.text);
+ }
- bool get isRegistered =>
- AuthService.to.registered.value || AuthService.to.isEmailVerified;
+ void goToRegister() {
+ Get.toNamed('/register');
+ }
}
diff --git a/lib/app/modules/login/views/login_view.dart b/lib/app/modules/login/views/login_view.dart
index 00c3af3f..9ff3b060 100644
--- a/lib/app/modules/login/views/login_view.dart
+++ b/lib/app/modules/login/views/login_view.dart
@@ -1,162 +1,59 @@
-// ignore_for_file: inference_failure_on_function_invocation
-
-import 'package:firebase_auth/firebase_auth.dart' as fba;
-import 'package:firebase_ui_auth/firebase_ui_auth.dart';
-import 'package:firebase_ui_oauth_google/firebase_ui_oauth_google.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
-import '../../../../firebase_options.dart';
-
-import '../../../../models/screens.dart';
-import '../../../widgets/login_widgets.dart';
+import '../../../routes/app_pages.dart';
+import '../../../widgets/my_button.dart';
+import '../../../widgets/my_text_field.dart';
import '../controllers/login_controller.dart';
-class LoginView extends GetView {
- void showReverificationButton(
- bool show, fba.EmailAuthCredential? credential) {
- // Below is very important.
- // See [https://stackoverflow.com/questions/69351845/this-obx-widget-cannot-be-marked-as-needing-to-build-because-the-framework-is-al]
- WidgetsBinding.instance.addPostFrameCallback((_) {
- controller.showReverificationButton.value = show;
- });
- //or Future.delayed(Duration.zero, () {
- // We can get the email and password from the controllers either by making the whole screen from scratch
- // or probably by add flutter_test find.byKey (hacky)
- // tried using AuthStateChangeAction instead which is not getting called
- // Finally Subclassed EmailAuthProvider to handle the same, but that also did not work
- // So went for server side email sending option
- //}));
- }
-
- const LoginView({super.key});
+class LoginView extends GetView {
@override
Widget build(BuildContext context) {
- return Obx(() => loginScreen(context));
- }
-
- Widget subtitleBuilder(context, action) {
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 8.0),
- child: action == AuthAction.signIn
- ? const Text('Welcome to Get Flutter Fire, please sign in!')
- : const Text('New to Get Flutter Fire, please sign up!'),
- );
- }
-
- Widget footerBuilder(Rx show, Rxn credential) {
- return LoginWidgets.footerBuilder(EmailLinkButton(show, credential));
- }
-
- Widget loginScreen(BuildContext context) {
- Widget ui;
- if (!controller.isLoggedIn) {
- ui = !(GetPlatform.isAndroid || GetPlatform.isIOS) && controller.isRobot
- ? recaptcha()
- : SignInScreen(
- providers: [
- GoogleProvider(clientId: DefaultFirebaseOptions.webClientId),
- MyEmailAuthProvider(),
- ],
- showAuthActionSwitch: !controller.isRegistered,
- showPasswordVisibilityToggle: true,
- headerBuilder: LoginWidgets.headerBuilder,
- subtitleBuilder: subtitleBuilder,
- footerBuilder: (context, action) => footerBuilder(
- controller.showReverificationButton,
- LoginController.to.credential),
- sideBuilder: LoginWidgets.sideBuilder,
- actions: getActions(),
- );
- } else if (controller.isAnon) {
- ui = RegisterScreen(
- providers: [
- MyEmailAuthProvider(),
- ],
- showAuthActionSwitch: !controller.isAnon, //if Anon only SignUp
- showPasswordVisibilityToggle: true,
- headerBuilder: LoginWidgets.headerBuilder,
- subtitleBuilder: subtitleBuilder,
- footerBuilder: (context, action) => footerBuilder(
- controller.showReverificationButton, LoginController.to.credential),
- sideBuilder: LoginWidgets.sideBuilder,
- actions: getActions(),
- );
- } else {
- final thenTo = Get
- .rootDelegate.currentConfiguration!.currentPage!.parameters?['then'];
- Get.rootDelegate.offNamed(thenTo ??
- (controller.isRegistered ? Screen.HOME : Screen.REGISTER).route);
- ui = const Scaffold();
- }
- return ui;
- }
-
- Widget recaptcha() {
- //TODO: Add Recaptcha
return Scaffold(
- body: TextButton(
- onPressed: () => controller.robot = false,
- child: const Text("Are you a Robot?"),
- ));
- }
-
- /// The following actions are useful here:
- /// - [AuthStateChangeAction]
- /// - [AuthCancelledAction]
- /// - [EmailLinkSignInAction]
- /// - [VerifyPhoneAction]
- /// - [SMSCodeRequestedAction]
-
- List getActions() {
- return [
- // AuthStateChangeAction((context, state) {
- AuthStateChangeAction((context, state) => LoginController.to
- .errorMessage(context, state, showReverificationButton)),
- // AuthStateChangeAction((context, state) {
- // // This is not required due to the AuthMiddleware
- // }),
- // EmailLinkSignInAction((context) {
- // final thenTo = Get.rootDelegate.currentConfiguration!.currentPage!
- // .parameters?['then'];
- // Get.rootDelegate.offNamed(thenTo ?? Routes.PROFILE);
- // }),
- ];
- }
-}
-
-class MyEmailAuthProvider extends EmailAuthProvider {
- @override
- void onCredentialReceived(
- fba.EmailAuthCredential credential,
- AuthAction action,
- ) {
- WidgetsBinding.instance.addPostFrameCallback((_) {
- LoginController.to.credential.value = credential;
- });
- super.onCredentialReceived(credential, action);
- }
-}
-
-class EmailLinkButton extends StatelessWidget {
- final Rx show;
- final Rxn credential;
-
- const EmailLinkButton(
- this.show,
- this.credential, {
- super.key,
- });
-
- @override
- Widget build(BuildContext context) {
- return Obx(() => Visibility(
- visible: show.value,
- child: Padding(
- padding: const EdgeInsets.only(top: 16),
- child: ElevatedButton(
- onPressed: () => LoginController.to
- .sendVerificationMail(emailAuth: credential.value),
- child: const Text('Resend Verification Mail')))));
+ backgroundColor: Colors.grey.shade300,
+ body: SafeArea(
+ child: SingleChildScrollView(
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ const SizedBox(height: 50),
+ ClipRRect(
+ borderRadius: BorderRadius.circular(100),
+ child: const Image(
+ image: AssetImage('lib/images/eduryde_circular.png'),
+ width: 200,
+ height: 200,
+ fit: BoxFit.cover,
+ ),
+ ),
+ const SizedBox(height: 25),
+ MyTextField(
+ controller: Get.find().emailController,
+ hintText: 'Email',
+ ),
+ MyTextField(
+ controller: Get.find().passwordController,
+ hintText: 'Password',
+ obscureText: true,
+ ),
+ MyButton(
+ text: 'Login',
+ onTap: () => Get.find().login(),
+ ),
+ TextButton(
+ onPressed: () => Get.toNamed(Routes.RESET_PASSWORD),
+ child: Text('Forgot Password?'),
+ ),
+ TextButton(
+ onPressed: () => Get.find().goToRegister(),
+ child: Text('Don\'t have an account? Register'),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
}
}
diff --git a/lib/app/modules/my_products/bindings/my_products_binding.dart b/lib/app/modules/my_products/bindings/my_products_binding.dart
deleted file mode 100644
index a537f047..00000000
--- a/lib/app/modules/my_products/bindings/my_products_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/my_products_controller.dart';
-
-class MyProductsBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => MyProductsController(),
- );
- }
-}
diff --git a/lib/app/modules/my_products/controllers/my_products_controller.dart b/lib/app/modules/my_products/controllers/my_products_controller.dart
deleted file mode 100644
index 31696ea2..00000000
--- a/lib/app/modules/my_products/controllers/my_products_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class MyProductsController extends GetxController {
- //TODO: Implement MyProductsController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/my_products/views/my_products_view.dart b/lib/app/modules/my_products/views/my_products_view.dart
deleted file mode 100644
index 43793ebb..00000000
--- a/lib/app/modules/my_products/views/my_products_view.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/my_products_controller.dart';
-
-class MyProductsView extends GetView {
- const MyProductsView({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('MyProductsView'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'MyProductsView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/past_rides/bindings/past_rides_binding.dart b/lib/app/modules/past_rides/bindings/past_rides_binding.dart
new file mode 100644
index 00000000..252e1046
--- /dev/null
+++ b/lib/app/modules/past_rides/bindings/past_rides_binding.dart
@@ -0,0 +1,11 @@
+import 'package:get/get.dart';
+import '../controllers/past_rides_controller.dart';
+
+class PastRidesBinding extends Bindings {
+ @override
+ void dependencies() {
+ Get.lazyPut(
+ () => PastRidesController(),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/past_rides/controllers/past_rides_controller.dart b/lib/app/modules/past_rides/controllers/past_rides_controller.dart
new file mode 100644
index 00000000..515a27aa
--- /dev/null
+++ b/lib/app/modules/past_rides/controllers/past_rides_controller.dart
@@ -0,0 +1,32 @@
+import 'package:get/get.dart';
+import '../../../../models/ride.dart';
+import '../../../../services/auth_service.dart';
+import '../../../../services/firestore_service.dart';
+
+class PastRidesController extends GetxController {
+ final FirestoreService _firestoreService = Get.find();
+ final AuthService _authService = Get.find();
+
+ final RxList pastRides = [].obs;
+ final RxBool isLoading = false.obs;
+
+ @override
+ void onInit() {
+ super.onInit();
+ loadPastRides();
+ }
+
+ void loadPastRides() async {
+ isLoading.value = true;
+ try {
+ final userEmail = _authService.currentUser!.email;
+ if (userEmail != null) {
+ pastRides.value = await _firestoreService.getPastRides(userEmail);
+ }
+ } catch (e) {
+ Get.snackbar('Error', 'Failed to load past rides: $e');
+ } finally {
+ isLoading.value = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/past_rides/views/past_rides_view.dart b/lib/app/modules/past_rides/views/past_rides_view.dart
new file mode 100644
index 00000000..4174146d
--- /dev/null
+++ b/lib/app/modules/past_rides/views/past_rides_view.dart
@@ -0,0 +1,29 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import '../../../widgets/past_ryde_card.dart';
+import '../controllers/past_rides_controller.dart';
+
+
+class PastRidesView extends GetView {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(title: const Text('Past Rides')),
+ body: Obx(() {
+ if (controller.isLoading.value) {
+ return const Center(child: CircularProgressIndicator());
+ } else if (controller.pastRides.isEmpty) {
+ return const Center(child: Text('No past rides found'));
+ } else {
+ return ListView.builder(
+ itemCount: controller.pastRides.length,
+ itemBuilder: (context, index) {
+ final ride = controller.pastRides[index];
+ return PastRideCard(ride: ride);
+ },
+ );
+ }
+ }),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/product_details/bindings/product_details_binding.dart b/lib/app/modules/product_details/bindings/product_details_binding.dart
deleted file mode 100644
index 624d55ac..00000000
--- a/lib/app/modules/product_details/bindings/product_details_binding.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/product_details_controller.dart';
-
-class ProductDetailsBinding extends Bindings {
- @override
- void dependencies() {
- Get.create(
- () => ProductDetailsController(
- Get.parameters['productId'] ?? '',
- ),
- );
- }
-}
diff --git a/lib/app/modules/product_details/controllers/product_details_controller.dart b/lib/app/modules/product_details/controllers/product_details_controller.dart
deleted file mode 100644
index d894e10c..00000000
--- a/lib/app/modules/product_details/controllers/product_details_controller.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-import 'package:get/get.dart';
-
-class ProductDetailsController extends GetxController {
- final String productId;
-
- ProductDetailsController(this.productId);
- @override
- void onInit() {
- super.onInit();
- Get.log('ProductDetailsController created with id: $productId');
- }
-
- @override
- void onClose() {
- Get.log('ProductDetailsController close with id: $productId');
- super.onClose();
- }
-}
diff --git a/lib/app/modules/product_details/views/product_details_view.dart b/lib/app/modules/product_details/views/product_details_view.dart
deleted file mode 100644
index c9290724..00000000
--- a/lib/app/modules/product_details/views/product_details_view.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/product_details_controller.dart';
-
-class ProductDetailsView extends GetWidget {
- const ProductDetailsView({super.key});
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text(
- 'ProductDetailsView is working',
- style: TextStyle(fontSize: 20),
- ),
- Text('ProductId: ${controller.productId}')
- ],
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/products/bindings/products_binding.dart b/lib/app/modules/products/bindings/products_binding.dart
deleted file mode 100644
index e7c762db..00000000
--- a/lib/app/modules/products/bindings/products_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/products_controller.dart';
-
-class ProductsBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => ProductsController(),
- );
- }
-}
diff --git a/lib/app/modules/products/controllers/products_controller.dart b/lib/app/modules/products/controllers/products_controller.dart
deleted file mode 100644
index 118c7dc8..00000000
--- a/lib/app/modules/products/controllers/products_controller.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-import 'package:get/get.dart';
-
-import '../../../../models/product.dart';
-
-class ProductsController extends GetxController {
- final products = [].obs;
-
- void loadDemoProductsFromSomeWhere() {
- products.add(
- Product(
- name: 'Product added on: ${DateTime.now().toString()}',
- id: DateTime.now().millisecondsSinceEpoch.toString(),
- ),
- );
- }
-
- @override
- void onReady() {
- super.onReady();
- loadDemoProductsFromSomeWhere();
- }
-
- @override
- void onClose() {
- Get.printInfo(info: 'Products: onClose');
- super.onClose();
- }
-}
diff --git a/lib/app/modules/products/views/products_view.dart b/lib/app/modules/products/views/products_view.dart
deleted file mode 100644
index 5b190a6a..00000000
--- a/lib/app/modules/products/views/products_view.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-// ignore_for_file: inference_failure_on_function_invocation
-
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../../../../models/role.dart';
-import '../../../routes/app_pages.dart';
-import '../controllers/products_controller.dart';
-
-class ProductsView extends GetView {
- const ProductsView({super.key});
-
- @override
- Widget build(BuildContext context) {
- var arg = Get.rootDelegate.arguments();
- return Scaffold(
- floatingActionButton:
- (arg != null && Get.rootDelegate.arguments()["role"] == Role.seller)
- ? FloatingActionButton.extended(
- onPressed: controller.loadDemoProductsFromSomeWhere,
- label: const Text('Add'),
- )
- : null,
- body: Column(
- children: [
- const Hero(
- tag: 'heroLogo',
- child: FlutterLogo(),
- ),
- Expanded(
- child: Obx(
- () => RefreshIndicator(
- onRefresh: () async {
- controller.products.clear();
- controller.loadDemoProductsFromSomeWhere();
- },
- child: ListView.builder(
- itemCount: controller.products.length,
- itemBuilder: (context, index) {
- final item = controller.products[index];
- return ListTile(
- onTap: () {
- Get.rootDelegate.toNamed(Routes.PRODUCT_DETAILS(
- item.id)); //we could use Get Parameters
- },
- title: Text(item.name),
- subtitle: Text(item.id),
- );
- },
- ),
- ),
- ),
- ),
- ],
- ),
- );
- }
-}
diff --git a/lib/app/modules/profile/bindings/profile_binding.dart b/lib/app/modules/profile/bindings/profile_binding.dart
deleted file mode 100644
index 5eb3b2bd..00000000
--- a/lib/app/modules/profile/bindings/profile_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/profile_controller.dart';
-
-class ProfileBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => ProfileController(),
- );
- }
-}
diff --git a/lib/app/modules/profile/controllers/profile_controller.dart b/lib/app/modules/profile/controllers/profile_controller.dart
deleted file mode 100644
index 0c1e059e..00000000
--- a/lib/app/modules/profile/controllers/profile_controller.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-import 'dart:io';
-
-import 'package:firebase_auth/firebase_auth.dart';
-import 'package:firebase_storage/firebase_storage.dart';
-import 'package:get/get.dart';
-import 'package:get_storage/get_storage.dart';
-
-import 'package:path/path.dart';
-import '../../../../services/auth_service.dart';
-
-class ProfileController extends GetxController {
- FirebaseStorage storage = FirebaseStorage.instance;
- User? currentUser = AuthService.to.user;
- final Rxn _photoURL = Rxn();
-
- File? _photo;
-
- String? get photoURL => _photoURL.value;
-
- @override
- onInit() {
- super.onInit();
- _photoURL.value = currentUser!.photoURL;
- _photoURL.bindStream(currentUser!.photoURL.obs.stream);
- }
-
- Future uploadFile(String path) async {
- try {
- var byt = GetStorage().read(path);
- if (byt != null) {
- final fileName = path;
- final destination = 'profilePics/${currentUser!.uid}';
-
- final ref = storage.ref(destination).child(fileName);
- await ref.putData(byt);
- return "$destination/$fileName";
- } else {
- _photo = File(path);
- if (_photo == null) return null;
- final fileName = basename(_photo!.path);
- final destination = 'profilePics/${currentUser!.uid}';
-
- final ref = storage.ref(destination).child(fileName);
- await ref.putFile(_photo!);
- return "$destination/$fileName";
- }
- } catch (e) {
- Get.snackbar('Error', 'Image Not Uploaded as ${e.toString()}');
- }
- return null;
- }
-
- void logout() {
- AuthService.to.logout();
- }
-
- Future updatePhotoURL(String dest) async {
- _photoURL.value = await storage.ref().child(dest).getDownloadURL();
- await currentUser?.updatePhotoURL(_photoURL.value);
- Get.snackbar('Success', 'Picture stored and linked');
- }
-}
diff --git a/lib/app/modules/profile/views/profile_view.dart b/lib/app/modules/profile/views/profile_view.dart
deleted file mode 100644
index c26d11c1..00000000
--- a/lib/app/modules/profile/views/profile_view.dart
+++ /dev/null
@@ -1,124 +0,0 @@
-// ignore_for_file: inference_failure_on_function_invocation
-
-import 'package:firebase_ui_auth/firebase_ui_auth.dart';
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../../../../services/auth_service.dart';
-import '../../../../models/screens.dart';
-import '../../../widgets/change_password_dialog.dart';
-import '../../../widgets/image_picker_button.dart';
-import '../controllers/profile_controller.dart';
-
-class ProfileView extends GetView {
- const ProfileView({super.key});
- ShapeBorder get shape => const CircleBorder();
- double get size => 120;
- Color get placeholderColor => Colors.grey;
-
- Widget _imageFrameBuilder(
- BuildContext context,
- Widget? child,
- int? frame,
- bool? _,
- ) {
- if (frame == null) {
- return Container(color: placeholderColor);
- }
-
- return child!;
- }
-
- @override
- Widget build(BuildContext context) {
- return Obx(() => profileScreen());
- }
-
- Widget profileScreen() {
- return AuthService.to.isLoggedInValue
- ? ProfileScreen(
- // We are using the Flutter Fire Profile Screen now but will change in subsequent steps.
- // The issues are highlighted in comments here
-
- // appBar: AppBar(
- // title: const Text('User Profile'),
- // ),
- avatar: SizedBox(
- //null will give the profile image component but it does not refresh the pic when changed
- height: size,
- width: size,
- child: ClipPath(
- clipper: ShapeBorderClipper(shape: shape),
- clipBehavior: Clip.hardEdge,
- child: controller.photoURL != null
- ? Image.network(
- controller.photoURL!,
- width: size,
- height: size,
- cacheWidth: size.toInt(),
- cacheHeight: size.toInt(),
- fit: BoxFit.contain,
- frameBuilder: _imageFrameBuilder,
- )
- : Center(
- child: Image.asset(
- 'assets/images/dash.png',
- width: size,
- fit: BoxFit.contain,
- ),
- ),
- ),
- ),
- // showDeleteConfirmationDialog: true, //this does not work properly. Possibly a bug in FlutterFire
- actions: [
- SignedOutAction((context) {
- Get.back();
- controller.logout();
- Get.rootDelegate.toNamed(Screen.PROFILE.route);
- // Navigator.of(context).pop();
- }),
- AccountDeletedAction((context, user) {
- //If we don't include this the button is still shown but no action gets done. Ideally the button should also not be shown. Its a bug in FlutterFire
- Get.defaultDialog(
- //this is only called after the delete is done and not useful for confirmation of the delete action
- title: 'Deleted Account of ${user.displayName}',
- barrierDismissible: true,
- navigatorKey: Get.nestedKey(Screen.HOME.route),
- );
- })
- ],
- children: [
- //This is to show that we can add custom content here
- const Divider(),
- controller.currentUser?.email != null
- ? TextButton.icon(
- onPressed: callChangePwdDialog,
- label: const Text('Change Password'),
- icon: const Icon(Icons.password_rounded),
- )
- : const SizedBox.shrink(),
- ImagePickerButton(callback: (String? path) async {
- if (path != null) {
- //Upload to Store
- String? dest = await controller.uploadFile(path);
- //attach it to User imageUrl
- if (dest != null) {
- await controller.updatePhotoURL(dest);
- }
- }
- })
- ],
- )
- : const Scaffold();
- }
-
- void callChangePwdDialog() {
- var dlg = ChangePasswordDialog(controller.currentUser!);
- Get.defaultDialog(
- title: "Change Password",
- content: dlg,
- textConfirm: "Submit",
- textCancel: "Cancel",
- onConfirm: dlg.onSubmit);
- }
-}
diff --git a/lib/app/modules/register/bindings/register_binding.dart b/lib/app/modules/register/bindings/register_binding.dart
index 1089ecbd..a6ffb873 100644
--- a/lib/app/modules/register/bindings/register_binding.dart
+++ b/lib/app/modules/register/bindings/register_binding.dart
@@ -1,12 +1,11 @@
import 'package:get/get.dart';
-
import '../controllers/register_controller.dart';
class RegisterBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(
- () => RegisterController(),
+ () => RegisterController(),
);
}
-}
+}
\ No newline at end of file
diff --git a/lib/app/modules/register/controllers/register_controller.dart b/lib/app/modules/register/controllers/register_controller.dart
index 96cb2cb0..8a4f7739 100644
--- a/lib/app/modules/register/controllers/register_controller.dart
+++ b/lib/app/modules/register/controllers/register_controller.dart
@@ -1,23 +1,33 @@
import 'package:get/get.dart';
-
+import 'package:flutter/material.dart';
import '../../../../services/auth_service.dart';
class RegisterController extends GetxController {
- @override
- void onInit() {
- super.onInit();
- // Send email verification and logout
- AuthService.to
- .sendVerificationMail(); //if we use the EmailVerificationScreen then no need to call this
- }
+ final AuthService _authService = Get.find();
+
+ final nameController = TextEditingController();
+ final emailController = TextEditingController();
+ final passwordController = TextEditingController();
+ final confirmPasswordController = TextEditingController();
+ final isLoading = false.obs;
+ final isEmailVerified = false.obs;
- // @override
- // void onReady() {
- // super.onReady();
- // }
+ void register() async {
+ if (passwordController.text != confirmPasswordController.text) {
+ Get.snackbar("Error", "Passwords do not match");
+ return;
+ }
- // @override
- // void onClose() {
- // super.onClose();
- // }
+ isLoading.value = true;
+ await _authService.register(
+ nameController.text.trim(),
+ emailController.text.trim(),
+ passwordController.text.trim(),
+ );
+ isLoading.value = false;
+ }
+
+ void goToLogin() {
+ Get.toNamed('/login');
+ }
}
diff --git a/lib/app/modules/register/views/register_view.dart b/lib/app/modules/register/views/register_view.dart
index 01f73e88..1308c7a3 100644
--- a/lib/app/modules/register/views/register_view.dart
+++ b/lib/app/modules/register/views/register_view.dart
@@ -1,53 +1,107 @@
-// import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
-
import 'package:get/get.dart';
-
-import '../../../../services/auth_service.dart';
-// import '../../../widgets/login_widgets.dart';
+import '../../../widgets/my_button.dart';
+import '../../../widgets/my_text_field.dart';
import '../controllers/register_controller.dart';
-//ALso add a form to take additional info such as display name of other customer details mapped with uid in Firestore
class RegisterView extends GetView {
- const RegisterView({super.key});
-
@override
Widget build(BuildContext context) {
- // Add pre verification Form if any. Mostly it can be post verification and can be the Profile or Setting screens
- try {
- // using this is causing an error when we send verification mail from server side
- // if it was initiated once, even when no visible. So we need to dispose when not visible
- var w =
- // EmailVerificationScreen(
- // headerBuilder: LoginWidgets.headerBuilder,
- // sideBuilder: LoginWidgets.sideBuilder,
- // actions: [
- // EmailVerifiedAction(() {
- // AuthService.to.register();
- // }),
- // ],
- // );
- Scaffold(
- appBar: AppBar(
- title: const Text('Registeration'),
- centerTitle: true,
- ),
- body: Center(
- child: Column(children: [
- const Text(
- 'Please verify your email (check SPAM folder), and then relogin',
- style: TextStyle(fontSize: 20),
+ return Scaffold(
+ backgroundColor: Colors.grey.shade300,
+ body: SafeArea(
+ child: SingleChildScrollView(
+ child: Center(
+ child: Column(
+ children: [
+ const SizedBox(height: 50),
+ ClipRRect(
+ borderRadius: BorderRadius.circular(100),
+ child: const Image(
+ image: AssetImage('lib/images/eduryde_circular.png'),
+ width: 200,
+ height: 200,
+ fit: BoxFit.cover,
+ ),
+ ),
+ const SizedBox(height: 25),
+ Text(
+ "Let's get started!",
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ color: Colors.grey[700],
+ fontSize: 16,
+ ),
+ ),
+ const SizedBox(height: 25),
+ MyTextField(
+ controller: controller.nameController,
+ hintText: "Name",
+ obscureText: false,
+ ),
+ const SizedBox(height: 10),
+ MyTextField(
+ controller: controller.emailController,
+ hintText: "Email",
+ obscureText: false,
+ ),
+ const SizedBox(height: 10),
+ MyTextField(
+ controller: controller.passwordController,
+ hintText: "Password",
+ obscureText: true,
+ ),
+ const SizedBox(height: 10),
+ MyTextField(
+ controller: controller.confirmPasswordController,
+ hintText: "Confirm Password",
+ obscureText: true,
+ ),
+ const SizedBox(height: 10),
+ Obx(() {
+ return controller.isLoading.value
+ ? CircularProgressIndicator(
+ valueColor: AlwaysStoppedAnimation(Colors.blue),
+ )
+ : controller.isEmailVerified.value
+ ? Icon(Icons.check_circle, color: Colors.green, size: 50)
+ : SizedBox.shrink();
+ }),
+ const SizedBox(height: 30),
+ MyButton(
+ onTap: controller.register,
+ text: 'Sign Up',
+ ),
+ const SizedBox(height: 25),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ "Already have an account?",
+ style: TextStyle(
+ color: Colors.grey[600],
+ fontSize: 16,
+ ),
+ ),
+ const SizedBox(width: 5),
+ GestureDetector(
+ onTap: controller.goToLogin,
+ child: const Text(
+ "Login now",
+ style: TextStyle(
+ color: Colors.blue,
+ fontSize: 16,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
),
- TextButton(
- onPressed: () => AuthService.to.register(),
- child: const Text("Verification Done. Relogin"),
- )
- ])),
- );
- return w;
- } catch (e) {
- // TODO
- }
- return const Scaffold();
+ ),
+ ),
+ );
}
}
diff --git a/lib/app/modules/reset_password/bindings/reset_password_binding.dart b/lib/app/modules/reset_password/bindings/reset_password_binding.dart
new file mode 100644
index 00000000..f6a88c16
--- /dev/null
+++ b/lib/app/modules/reset_password/bindings/reset_password_binding.dart
@@ -0,0 +1,9 @@
+import 'package:get/get.dart';
+import '../controllers/reset_password_controller.dart';
+
+class ResetPasswordBinding extends Bindings {
+ @override
+ void dependencies() {
+ Get.lazyPut(() => ResetPasswordController());
+ }
+}
diff --git a/lib/app/modules/reset_password/controllers/reset_password_controller.dart b/lib/app/modules/reset_password/controllers/reset_password_controller.dart
new file mode 100644
index 00000000..8250b93e
--- /dev/null
+++ b/lib/app/modules/reset_password/controllers/reset_password_controller.dart
@@ -0,0 +1,17 @@
+import 'package:get/get.dart';
+import 'package:flutter/material.dart';
+import '../../../../services/auth_service.dart';
+
+class ResetPasswordController extends GetxController {
+ final AuthService _authService = Get.find();
+
+ final emailController = TextEditingController();
+
+ void resetPassword() {
+ if (emailController.text.isEmpty) {
+ Get.snackbar("Error", "Please enter your email");
+ return;
+ }
+ _authService.resetPassword(emailController.text);
+ }
+}
diff --git a/lib/app/modules/reset_password/views/reset_password_view.dart b/lib/app/modules/reset_password/views/reset_password_view.dart
new file mode 100644
index 00000000..4735fc1f
--- /dev/null
+++ b/lib/app/modules/reset_password/views/reset_password_view.dart
@@ -0,0 +1,37 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import '../controllers/reset_password_controller.dart';
+import '../../../widgets/my_button.dart';
+import '../../../widgets/my_text_field.dart';
+
+class ResetPasswordView extends GetView {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: Colors.grey.shade300,
+ body: SafeArea(
+ child: SingleChildScrollView(
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ MyTextField(
+ controller: controller.emailController,
+ hintText: 'Email',
+ ),
+ MyButton(
+ text: 'Reset Password',
+ onTap: () => controller.resetPassword(),
+ ),
+ TextButton(
+ onPressed: () => Get.back(),
+ child: Text('Go back to Login'),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/app/modules/ride_search/bindings/ride_search_binding.dart b/lib/app/modules/ride_search/bindings/ride_search_binding.dart
new file mode 100644
index 00000000..f72a52c2
--- /dev/null
+++ b/lib/app/modules/ride_search/bindings/ride_search_binding.dart
@@ -0,0 +1,11 @@
+import 'package:get/get.dart';
+import '../controllers/ride_search_controller.dart';
+
+class RideSearchBinding extends Bindings {
+ @override
+ void dependencies() {
+ Get.lazyPut(
+ () => RideSearchController(),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/ride_search/controllers/ride_search_controller.dart b/lib/app/modules/ride_search/controllers/ride_search_controller.dart
new file mode 100644
index 00000000..56b17bde
--- /dev/null
+++ b/lib/app/modules/ride_search/controllers/ride_search_controller.dart
@@ -0,0 +1,74 @@
+import 'package:get/get.dart';
+import '../../../../models/ride.dart';
+import '../../../../services/auth_service.dart';
+import '../../../../services/firestore_service.dart';
+import 'dart:async';
+
+class RideSearchController extends GetxController {
+ final FirestoreService _firestoreService = Get.find();
+ final AuthService _authService = Get.find();
+
+ final RxList availableRides = [].obs;
+ final RxBool isLoading = false.obs;
+ final RxBool userHasActiveRide = false.obs;
+
+ late StreamSubscription> _rideSubscription;
+
+ @override
+ void onInit() {
+ super.onInit();
+ _subscribeToAvailableRides();
+ checkUserActiveRide();
+ }
+
+ void _subscribeToAvailableRides() {
+ _rideSubscription = _firestoreService.getAvailableRidesStream().listen(
+ (rides) {
+ availableRides.value = rides;
+ isLoading.value = false;
+ },
+ onError: (error) {
+ Get.snackbar('Error', 'Failed to fetch rides: $error');
+ isLoading.value = false;
+ },
+ );
+ }
+
+ void checkUserActiveRide() async {
+ String? currentUserEmail = _authService.currentUser?.email;
+ if (currentUserEmail != null) {
+ userHasActiveRide.value = await _firestoreService.userHasActiveRide(currentUserEmail);
+ }
+ }
+
+ Future acceptRide(String rideId) async {
+ try {
+ String? currentUserEmail = _authService.currentUser?.email;
+ if (currentUserEmail == null) {
+ throw Exception('User not logged in');
+ }
+
+ Ride ride = await _firestoreService.getRide(rideId);
+
+ if (ride.driverId == currentUserEmail) {
+ throw Exception('You cannot accept your own ride');
+ }
+
+ await _firestoreService.acceptRide(currentUserEmail, rideId);
+ userHasActiveRide.value = true;
+ Get.snackbar('Success', 'Ride accepted successfully');
+ } catch (e) {
+ Get.snackbar('Error', 'Failed to accept ride: $e');
+ }
+ }
+
+ bool isUserRide(String driverId) {
+ return driverId == _authService.currentUser?.email;
+ }
+
+ @override
+ void onClose() {
+ _rideSubscription.cancel();
+ super.onClose();
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/ride_search/views/ride_search_view.dart b/lib/app/modules/ride_search/views/ride_search_view.dart
new file mode 100644
index 00000000..842a58bd
--- /dev/null
+++ b/lib/app/modules/ride_search/views/ride_search_view.dart
@@ -0,0 +1,60 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import '../controllers/ride_search_controller.dart';
+import '../../../widgets/travel_card.dart';
+
+class RideSearchView extends GetView {
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ backgroundColor: Colors.grey.shade300,
+ body: SafeArea(
+ child: CustomScrollView(
+ slivers: [
+ SliverPadding(
+ padding: const EdgeInsets.all(8.0),
+ sliver: SliverToBoxAdapter(
+ child: Text(
+ 'Available Rydes',
+ style: TextStyle(
+ fontSize: 24,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ ),
+ Obx(() {
+ if (controller.isLoading.value) {
+ return SliverToBoxAdapter(
+ child: Center(child: CircularProgressIndicator()),
+ );
+ }
+ if (controller.availableRides.isEmpty) {
+ return SliverToBoxAdapter(
+ child: Center(child: Text('No available rides at the moment.')),
+ );
+ }
+ return SliverList(
+ delegate: SliverChildBuilderDelegate(
+ (context, index) {
+ final ride = controller.availableRides[index];
+ return Padding(
+ padding: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
+ child: TravelCard(
+ ride: ride,
+ onPressed: () => controller.acceptRide(ride.id),
+ isEditable: false,
+ isUserRide: controller.isUserRide(ride.driverId),
+ ),
+ );
+ },
+ childCount: controller.availableRides.length,
+ ),
+ );
+ }),
+ ],
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/modules/root/bindings/root_binding.dart b/lib/app/modules/root/bindings/root_binding.dart
deleted file mode 100644
index e1e94d1d..00000000
--- a/lib/app/modules/root/bindings/root_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/root_controller.dart';
-
-class RootBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => RootController(),
- );
- }
-}
diff --git a/lib/app/modules/root/controllers/my_drawer_controller.dart b/lib/app/modules/root/controllers/my_drawer_controller.dart
deleted file mode 100644
index f45ef122..00000000
--- a/lib/app/modules/root/controllers/my_drawer_controller.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-import 'package:get/get.dart';
-
-import '../../../../models/screens.dart';
-
-class MyDrawerController extends GetxController {
- MyDrawerController(Iterable iter)
- : values = Rx>(iter);
-
- final Rx> values;
-}
diff --git a/lib/app/modules/root/controllers/root_controller.dart b/lib/app/modules/root/controllers/root_controller.dart
deleted file mode 100644
index 7f160fc6..00000000
--- a/lib/app/modules/root/controllers/root_controller.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-class RootController extends GetxController {
- GlobalKey scaffoldKey = GlobalKey();
-
- void openDrawer() {
- scaffoldKey.currentState!.openDrawer();
- }
-
- void closeDrawer() {
- scaffoldKey.currentState!.openEndDrawer();
- }
-}
diff --git a/lib/app/modules/root/views/drawer.dart b/lib/app/modules/root/views/drawer.dart
deleted file mode 100644
index 908d0223..00000000
--- a/lib/app/modules/root/views/drawer.dart
+++ /dev/null
@@ -1,118 +0,0 @@
-// ignore_for_file: inference_failure_on_function_invocation
-
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../../../../models/role.dart';
-import '../../../../services/auth_service.dart';
-
-import '../../../../models/screens.dart';
-import '../controllers/my_drawer_controller.dart';
-
-class DrawerWidget extends StatelessWidget {
- const DrawerWidget({
- super.key,
- });
-
- @override
- Widget build(BuildContext context) {
- MyDrawerController controller = Get.put(MyDrawerController([]),
- permanent: true); //must make true else gives error
- Screen.drawer().then((v) => {controller.values.value = v});
- return Obx(() => Drawer(
- //changing the shape of the drawer
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- topRight: Radius.circular(0), bottomRight: Radius.circular(20)),
- ),
- width: 200,
- child: Column(
- children: drawerItems(context, controller.values),
- ),
- ));
- }
-
- List drawerItems(BuildContext context, Rx> values) {
- List list = [
- Container(
- height: 100,
- color: Colors.red,
- //adding content in the highlighted part of the drawer
- child: Align(
- alignment: Alignment.centerLeft,
- child: Container(
- margin: const EdgeInsets.only(left: 15),
- child: const Text('User Name', //Profile Icon also
- style: TextStyle(fontWeight: FontWeight.bold)))),
- )
- ];
-
- if (AuthService.to.maxRole.index > 1) {
- for (var i = 0; i <= AuthService.to.maxRole.index; i++) {
- Role role = Role.values[i];
- list.add(ListTile(
- title: Text(
- role.name,
- style: const TextStyle(
- color: Colors.blue,
- ),
- ),
- onTap: () {
- Get.rootDelegate
- .toNamed(Screen.HOME.route, arguments: {'role': role});
- //to close the drawer
- Navigator.of(context).pop();
- },
- ));
- }
- }
-
- for (Screen screen in values.value) {
- list.add(ListTile(
- title: Text(screen.label ?? ''),
- onTap: () {
- Get.rootDelegate.toNamed(screen.route);
- //to close the drawer
-
- Navigator.of(context).pop();
- },
- ));
- }
-
- if (AuthService.to.isLoggedInValue) {
- list.add(ListTile(
- title: const Text(
- 'Logout',
- style: TextStyle(
- color: Colors.red,
- ),
- ),
- onTap: () {
- AuthService.to.logout();
- Get.rootDelegate.toNamed(Screen.LOGIN.route);
- //to close the drawer
-
- Navigator.of(context).pop();
- },
- ));
- }
- if (!AuthService.to.isLoggedInValue) {
- list.add(ListTile(
- title: const Text(
- 'Login',
- style: TextStyle(
- color: Colors.blue,
- ),
- ),
- onTap: () {
- Get.rootDelegate.toNamed(Screen.LOGIN.route);
- //to close the drawer
-
- Navigator.of(context).pop();
- },
- ));
- }
-
- return list;
- }
-}
diff --git a/lib/app/modules/root/views/root_view.dart b/lib/app/modules/root/views/root_view.dart
deleted file mode 100644
index 2bbf228c..00000000
--- a/lib/app/modules/root/views/root_view.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-// ignore_for_file: inference_failure_on_function_invocation
-
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import 'package:get_flutter_fire/services/auth_service.dart';
-import '../../../routes/app_pages.dart';
-import '../../../../models/screens.dart';
-import '../controllers/root_controller.dart';
-import 'drawer.dart';
-
-class RootView extends GetView {
- const RootView({super.key});
-
- @override
- Widget build(BuildContext context) {
- return GetRouterOutlet.builder(
- builder: (context, delegate, current) {
- final title = current!.currentPage!.title;
- return Scaffold(
- key: controller.scaffoldKey,
- drawer: const DrawerWidget(),
- appBar: AppBar(
- title: Text(title ?? ''),
- centerTitle: true,
- leading: GetPlatform.isIOS // Since Web and Android have back button
- &&
- current.locationString.contains(RegExp(r'(\/[^\/]*){3,}'))
- ? BackButton(
- onPressed: () =>
- Get.rootDelegate.popRoute(), //Navigator.pop(context),
- )
- : IconButton(
- icon: ImageIcon(
- const AssetImage("icons/logo.png"),
- color: Colors.grey.shade800,
- ),
- onPressed: () => AuthService.to.isLoggedInValue
- ? controller.openDrawer()
- : {Screen.HOME.doAction()},
- ),
- actions: topRightMenuButtons(current),
- // automaticallyImplyLeading: false, //removes drawer icon
- ),
- body: GetRouterOutlet(
- initialRoute: AppPages.INITIAL,
- // anchorRoute: '/',
- // filterPages: (afterAnchor) {
- // return afterAnchor.take(1);
- // },
- ),
- );
- },
- );
- }
-
-//This could be used to add icon buttons in expanded web view instead of the context menu
- List topRightMenuButtons(GetNavConfig current) {
- return [
- Container(
- margin: const EdgeInsets.only(right: 15),
- child: Screen.LOGIN.widget(current))
- ]; //TODO add seach button
- }
-}
diff --git a/lib/app/modules/settings/bindings/settings_binding.dart b/lib/app/modules/settings/bindings/settings_bindings.dart
similarity index 84%
rename from lib/app/modules/settings/bindings/settings_binding.dart
rename to lib/app/modules/settings/bindings/settings_bindings.dart
index fb567f07..d24d1621 100644
--- a/lib/app/modules/settings/bindings/settings_binding.dart
+++ b/lib/app/modules/settings/bindings/settings_bindings.dart
@@ -1,12 +1,11 @@
import 'package:get/get.dart';
-
import '../controllers/settings_controller.dart';
class SettingsBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut(
- () => SettingsController(),
+ () => SettingsController(),
);
}
-}
+}
\ No newline at end of file
diff --git a/lib/app/modules/settings/controllers/settings_controller.dart b/lib/app/modules/settings/controllers/settings_controller.dart
index 265e54b1..f13a62d6 100644
--- a/lib/app/modules/settings/controllers/settings_controller.dart
+++ b/lib/app/modules/settings/controllers/settings_controller.dart
@@ -1,20 +1,11 @@
import 'package:get/get.dart';
+import '../../../../services/auth_service.dart';
class SettingsController extends GetxController {
- //TODO: Implement SettingsController
+ final AuthService _authService = Get.find();
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
+ void signOut() async {
+ await _authService.signOut();
+ Get.offAllNamed('/login');
}
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {}
- void increment() => count.value++;
-}
+}
\ No newline at end of file
diff --git a/lib/app/modules/settings/views/settings_view.dart b/lib/app/modules/settings/views/settings_view.dart
index 2bb244b6..3d44fe3d 100644
--- a/lib/app/modules/settings/views/settings_view.dart
+++ b/lib/app/modules/settings/views/settings_view.dart
@@ -1,21 +1,22 @@
import 'package:flutter/material.dart';
-
import 'package:get/get.dart';
-
import '../controllers/settings_controller.dart';
class SettingsView extends GetView {
- const SettingsView({super.key});
-
@override
Widget build(BuildContext context) {
- return const Scaffold(
+ return Scaffold(
+ appBar: AppBar(title: Text('Settings')),
body: Center(
- child: Text(
- 'SettingsView is working',
- style: TextStyle(fontSize: 20),
+ child: ElevatedButton(
+ onPressed: controller.signOut,
+ child: Text('Sign Out'),
+ style: ElevatedButton.styleFrom(
+ foregroundColor: Colors.white, backgroundColor: Colors.red,
+ padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
+ ),
),
),
);
}
-}
+}
\ No newline at end of file
diff --git a/lib/app/modules/task_details/bindings/task_details_binding.dart b/lib/app/modules/task_details/bindings/task_details_binding.dart
deleted file mode 100644
index 1e017283..00000000
--- a/lib/app/modules/task_details/bindings/task_details_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/task_details_controller.dart';
-
-class TaskDetailsBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => TaskDetailsController(),
- );
- }
-}
diff --git a/lib/app/modules/task_details/controllers/task_details_controller.dart b/lib/app/modules/task_details/controllers/task_details_controller.dart
deleted file mode 100644
index e0a6a0d9..00000000
--- a/lib/app/modules/task_details/controllers/task_details_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class TaskDetailsController extends GetxController {
- //TODO: Implement TaskDetailsController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/task_details/views/task_details_view.dart b/lib/app/modules/task_details/views/task_details_view.dart
deleted file mode 100644
index c21dbc0e..00000000
--- a/lib/app/modules/task_details/views/task_details_view.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/task_details_controller.dart';
-
-class TaskDetailsView extends GetView {
- const TaskDetailsView({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('TaskDetailsView'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'TaskDetailsView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/tasks/bindings/tasks_binding.dart b/lib/app/modules/tasks/bindings/tasks_binding.dart
deleted file mode 100644
index 9d836c2b..00000000
--- a/lib/app/modules/tasks/bindings/tasks_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/tasks_controller.dart';
-
-class TasksBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => TasksController(),
- );
- }
-}
diff --git a/lib/app/modules/tasks/controllers/tasks_controller.dart b/lib/app/modules/tasks/controllers/tasks_controller.dart
deleted file mode 100644
index 4d4196e4..00000000
--- a/lib/app/modules/tasks/controllers/tasks_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class TasksController extends GetxController {
- //TODO: Implement TasksController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/tasks/views/tasks_view.dart b/lib/app/modules/tasks/views/tasks_view.dart
deleted file mode 100644
index 2103103b..00000000
--- a/lib/app/modules/tasks/views/tasks_view.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/tasks_controller.dart';
-
-class TasksView extends GetView {
- const TasksView({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('TasksView'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'TasksView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/modules/users/bindings/users_binding.dart b/lib/app/modules/users/bindings/users_binding.dart
deleted file mode 100644
index 7d8efdb0..00000000
--- a/lib/app/modules/users/bindings/users_binding.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'package:get/get.dart';
-
-import '../controllers/users_controller.dart';
-
-class UsersBinding extends Bindings {
- @override
- void dependencies() {
- Get.lazyPut(
- () => UsersController(),
- );
- }
-}
diff --git a/lib/app/modules/users/controllers/users_controller.dart b/lib/app/modules/users/controllers/users_controller.dart
deleted file mode 100644
index 871467c4..00000000
--- a/lib/app/modules/users/controllers/users_controller.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'package:get/get.dart';
-
-class UsersController extends GetxController {
- //TODO: Implement UsersController
-
- final count = 0.obs;
- @override
- void onInit() {
- super.onInit();
- }
-
- @override
- void onReady() {
- super.onReady();
- }
-
- @override
- void onClose() {
- super.onClose();
- }
-
- void increment() => count.value++;
-}
diff --git a/lib/app/modules/users/views/users_view.dart b/lib/app/modules/users/views/users_view.dart
deleted file mode 100644
index 702f32da..00000000
--- a/lib/app/modules/users/views/users_view.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:get/get.dart';
-
-import '../controllers/users_controller.dart';
-
-class UsersView extends GetView {
- const UsersView({super.key});
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('UsersView'),
- centerTitle: true,
- ),
- body: const Center(
- child: Text(
- 'UsersView is working',
- style: TextStyle(fontSize: 20),
- ),
- ),
- );
- }
-}
diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart
index 7269755d..ec0450e0 100644
--- a/lib/app/routes/app_pages.dart
+++ b/lib/app/routes/app_pages.dart
@@ -1,154 +1,80 @@
-import 'package:flutter/material.dart';
import 'package:get/get.dart';
-
-import '../../models/access_level.dart';
-import '../../models/role.dart';
-import '../middleware/auth_middleware.dart';
-import '../modules/cart/bindings/cart_binding.dart';
-import '../modules/cart/views/cart_view.dart';
-import '../modules/categories/bindings/categories_binding.dart';
-import '../modules/categories/views/categories_view.dart';
-import '../modules/checkout/bindings/checkout_binding.dart';
-import '../modules/checkout/views/checkout_view.dart';
-import '../modules/dashboard/bindings/dashboard_binding.dart';
-import '../modules/dashboard/views/dashboard_view.dart';
import '../modules/home/bindings/home_binding.dart';
import '../modules/home/views/home_view.dart';
import '../modules/login/bindings/login_binding.dart';
import '../modules/login/views/login_view.dart';
-import '../modules/my_products/bindings/my_products_binding.dart';
-import '../modules/my_products/views/my_products_view.dart';
-import '../modules/product_details/bindings/product_details_binding.dart';
-import '../modules/product_details/views/product_details_view.dart';
-import '../modules/products/bindings/products_binding.dart';
-import '../modules/products/views/products_view.dart';
-import '../modules/profile/bindings/profile_binding.dart';
-import '../modules/profile/views/profile_view.dart';
import '../modules/register/bindings/register_binding.dart';
import '../modules/register/views/register_view.dart';
-import '../modules/root/bindings/root_binding.dart';
-import '../modules/root/views/root_view.dart';
-import '../modules/settings/bindings/settings_binding.dart';
+import '../modules/reset_password/bindings/reset_password_binding.dart';
+import '../modules/reset_password/views/reset_password_view.dart';
+import '../modules/ride_search/bindings/ride_search_binding.dart';
+import '../modules/ride_search/views/ride_search_view.dart';
+import '../modules/active_ride/bindings/active_ride_binding.dart';
+import '../modules/active_ride/views/active_ride_view.dart';
+import '../modules/past_rides/bindings/past_rides_binding.dart';
+import '../modules/past_rides/views/past_rides_view.dart';
+import '../modules/settings/bindings/settings_bindings.dart';
import '../modules/settings/views/settings_view.dart';
-import '../modules/task_details/bindings/task_details_binding.dart';
-import '../modules/task_details/views/task_details_view.dart';
-import '../modules/tasks/bindings/tasks_binding.dart';
-import '../modules/tasks/views/tasks_view.dart';
-import '../modules/users/bindings/users_binding.dart';
-import '../modules/users/views/users_view.dart';
-import '../../models/screens.dart';
+import '../modules/add_ride/bindings/add_ride_binding.dart';
+import '../modules/add_ride/views/add_ride_view.dart';
+import '../modules/driver_dashboard/bindings/driver_dashboard_binding.dart';
+import '../modules/driver_dashboard/views/driver_dashboard_view.dart';
part 'app_routes.dart';
-part 'screen_extension.dart';
class AppPages {
- AppPages._();
-
- static const INITIAL = Routes.HOME;
+ static const INITIAL = Routes.LOGIN;
- //TODO create this using the information from Screen and Role data
- //can use https://pub.dev/packages/freezed
static final routes = [
GetPage(
- name: '/',
- page: () => const RootView(),
- binding: RootBinding(),
- participatesInRootNavigator: true,
- preventDuplicates: true,
- children: [
- Screen.LOGIN.getPage(
- page: () => const LoginView(),
- binding: LoginBinding(),
- ),
- Screen.REGISTER.getPage(
- page: () => const RegisterView(),
- binding: RegisterBinding(),
- ),
- Screen.PROFILE.getPage(
- page: () => const ProfileView(),
- binding: ProfileBinding(),
- ),
- Screen.SETTINGS.getPage(
- page: () => const SettingsView(),
- binding: SettingsBinding(),
- ),
- Screen.HOME.getPage(
- page: () => const HomeView(),
- bindings: [
- HomeBinding(),
- ],
- children: [
- Screen.DASHBOARD.getPage(
- page: () => const DashboardView(),
- binding: DashboardBinding(),
- ),
- Screen.USERS.getPage(
- role: Role.admin,
- page: () => const UsersView(),
- binding: UsersBinding(),
- children: [
- Screen.USER_PROFILE.getPage(
- page: () => const ProfileView(),
- binding: ProfileBinding(),
- )
- ],
- ),
- Screen.PRODUCTS.getPage(
- page: () => const ProductsView(),
- binding: ProductsBinding(),
- children: [
- Screen.PRODUCT_DETAILS.getPages(
- page: () => const ProductDetailsView(),
- binding: ProductDetailsBinding(),
- ),
- ],
- ),
- Screen.CATEGORIES.getPage(
- role: Role.admin,
- page: () => const CategoriesView(),
- binding: CategoriesBinding(),
- ),
- Screen.CART.getPage(
- page: () => const CartView(),
- binding: CartBinding(),
- role: Role.buyer,
- children: [
- Screen.CHECKOUT.getPage(
- //if this is after cart details, it never gets reached
- page: () => const CheckoutView(),
- binding: CheckoutBinding(),
- ),
- Screen.CART_DETAILS.getPages(
- page: () => const ProductDetailsView(),
- binding: ProductDetailsBinding(),
- ),
- ],
- ),
- Screen.MY_PRODUCTS.getPage(
- page: () => const MyProductsView(),
- binding: MyProductsBinding(),
- role: Role.seller,
- children: [
- Screen.MY_PRODUCT_DETAILS.getPages(
- page: () => const ProductDetailsView(),
- binding: ProductDetailsBinding(),
- ),
- ],
- ),
- Screen.TASKS.getPage(
- role: Role.admin,
- page: () => const TasksView(),
- binding: TasksBinding(),
- children: [
- Screen.TASK_DETAILS.getPage(
- page: () => const TaskDetailsView(),
- binding: TaskDetailsBinding(),
- ),
- ],
- ),
- ],
- )
- ],
+ name: Routes.LOGIN,
+ page: () => LoginView(),
+ binding: LoginBinding(),
+ ),
+ GetPage(
+ name: Routes.RESET_PASSWORD,
+ page: () => ResetPasswordView(),
+ binding: ResetPasswordBinding(),
+ ),
+ GetPage(
+ name: Routes.REGISTER,
+ page: () => RegisterView(),
+ binding: RegisterBinding(),
+ ),
+ GetPage(
+ name: Routes.RIDE_SEARCH,
+ page: () => RideSearchView(),
+ binding: RideSearchBinding(),
+ ),
+ GetPage(
+ name: Routes.ACTIVE_RIDE,
+ page: () => ActiveRideView(),
+ binding: ActiveRideBinding(),
+ ),
+ GetPage(
+ name: Routes.PAST_RIDES,
+ page: () => PastRidesView(),
+ binding: PastRidesBinding(),
+ ),
+ GetPage(
+ name: Routes.SETTINGS,
+ page: () => SettingsView(),
+ binding: SettingsBinding(),
+ ),
+ GetPage(
+ name: Routes.ADD_RIDE,
+ page: () => AddRidesView(),
+ binding: AddRideBinding(),
+ ),
+ GetPage(
+ name: Routes.DRIVER_DASHBOARD,
+ page: () => DriverDashboardView(),
+ binding: DriverDashboardBinding(),
+ ),
+ GetPage(
+ name: Routes.HOME,
+ page: () => HomeView(),
+ binding: HomeBinding(),
),
];
-}
+}
\ No newline at end of file
diff --git a/lib/app/routes/app_routes.dart b/lib/app/routes/app_routes.dart
index f3129d21..2848b715 100644
--- a/lib/app/routes/app_routes.dart
+++ b/lib/app/routes/app_routes.dart
@@ -1,54 +1,15 @@
-// ignore_for_file: non_constant_identifier_names, constant_identifier_names
-
part of 'app_pages.dart';
-// DO NOT EDIT. This is code generated via package:get_cli/get_cli.dart
abstract class Routes {
- static const HOME = _Paths.HOME;
- // static String PROFILE = Screen.PROFILE.fullPath;
- // static String SETTINGS = Screen.SETTINGS.fullPath;
- static String LOGIN = Screen.LOGIN.route;
- static String REGISTER = Screen.REGISTER.route;
- // static String DASHBOARD = Screen.DASHBOARD.fullPath;
- // static String PRODUCTS = Screen.PRODUCTS.fullPath;
- // static String CART = Screen.CART.fullPath;
- // static String CHECKOUT = Screen.CHECKOUT.fullPath;
- // static const CATEGORIES = _Paths.HOME + _Paths.CATEGORIES;
- // static const TASKS = _Paths.HOME + _Paths.TASKS;
- // static const USERS = _Paths.HOME + _Paths.USERS;
- // static const MY_PRODUCTS = _Paths.HOME + _Paths.MY_PRODUCTS;
-
- static String PRODUCT_DETAILS(String productId) =>
- '${Screen.PRODUCTS.route}/$productId';
- static String CART_DETAILS(String productId) =>
- '${Screen.CART.route}/$productId';
- static String TASK_DETAILS(String taskId) => '${Screen.TASKS.route}/$taskId';
- static String USER_PROFILE(String uId) => '${Screen.USERS.route}/$uId';
-
- Routes._();
- static String LOGIN_THEN(String afterSuccessfulLogin) =>
- '${Screen.LOGIN.route}?then=${Uri.encodeQueryComponent(afterSuccessfulLogin)}';
- static String REGISTER_THEN(String afterSuccessfulLogin) =>
- '${Screen.REGISTER.route}?then=${Uri.encodeQueryComponent(afterSuccessfulLogin)}';
-}
-
-// Keeping this as Get_Cli will require it. Any addition can later be added to Screen
-abstract class _Paths {
- static const String HOME = '/home';
- // static const DASHBOARD = '/dashboard';
- // static const PRODUCTS = '/products';
- // static const PROFILE = '/profile';
- // static const SETTINGS = '/settings';
- // static const PRODUCT_DETAILS = '/:productId';
- // static const CART_DETAILS = '/:productId';
- // static const LOGIN = '/login';
- // static const CART = '/cart';
- // static const CHECKOUT = '/checkout';
- // static const REGISTER = '/register';
- // static const CATEGORIES = '/categories';
- // static const TASKS = '/tasks';
- // static const TASK_DETAILS = '/:taskId';
- // static const USERS = '/users';
- // static const USER_PROFILE = '/:uId';
- // static const MY_PRODUCTS = '/my-products';
-}
+ static const HOME = '/home';
+ static const LOGIN = '/login';
+ static const REGISTER = '/register';
+ static const PROFILE = '/profile';
+ static const RIDE_SEARCH = '/ride_search';
+ static const ACTIVE_RIDE = '/active_ride';
+ static const PAST_RIDES = '/past_rides';
+ static const SETTINGS = '/settings';
+ static const ADD_RIDE = '/add_ride';
+ static const DRIVER_DASHBOARD = '/driver_dashboard';
+ static const RESET_PASSWORD = '/reset_password';
+}
\ No newline at end of file
diff --git a/lib/app/routes/screen_extension.dart b/lib/app/routes/screen_extension.dart
deleted file mode 100644
index aaf138b0..00000000
--- a/lib/app/routes/screen_extension.dart
+++ /dev/null
@@ -1,125 +0,0 @@
-part of 'app_pages.dart';
-
-extension GetViewExtension on GetView {
- static final _screens = Expando();
-
- Screen? get screen => _screens[this];
- set screen(Screen? x) => _screens[this] = x;
-}
-
-extension GetWidgetExtension on GetWidget {
- static final _screens = Expando();
-
- Screen? get screen => _screens[this];
- set screen(Screen? x) => _screens[this] = x;
-}
-
-extension GetPageExtension on GetPage {}
-
-extension ScreenExtension on Screen {
- GetPage getPage(
- {required GetView Function() page,
- Bindings? binding,
- List bindings = const [],
- List? middlewares,
- List>? children,
- bool preventDuplicates = true,
- Role? role}) {
- // we are injecting the Screen variable here
- pageW() {
- GetView p = page();
- p.screen = this;
- return p;
- }
-
- //check role and screen mapping for rolebased access
- if (accessLevel == AccessLevel.roleBased) {
- if (role == null &&
- (parent == null || parent!.accessLevel != AccessLevel.roleBased)) {
- throw Exception("Role must be provided for RoleBased Screens");
- }
- if (role != null && !role.permissions.contains(this)) {
- throw Exception("Role must permit this Screen");
- }
- }
-
- return _getPage(pageW, binding, bindings, middlewares, children,
- preventDuplicates, role);
- }
-
- GetPage getPages(
- {required GetWidget Function() page,
- Bindings? binding,
- List bindings = const [],
- List? middlewares,
- List>? children,
- bool preventDuplicates = false,
- Role? role}) {
- pageW() {
- GetWidget p = page();
- p.screen = this;
- return p;
- }
-
- return _getPage(pageW, binding, bindings, middlewares, children,
- preventDuplicates, role);
- }
-
- GetPage _getPage(
- Widget Function() pageW,
- Bindings? binding,
- List bindings,
- List? middlewares,
- List>? children,
- bool preventDuplicates,
- Role? role) {
- return binding != null
- ? GetPage(
- preventDuplicates: preventDuplicates,
- middlewares: middlewares ?? defaultMiddlewares(role),
- name: path,
- page: pageW,
- title: label,
- transition: Transition.fade,
- binding: binding,
- children: children ?? const [])
- : GetPage(
- preventDuplicates: preventDuplicates,
- middlewares: middlewares,
- name: path,
- page: pageW,
- title: label,
- transition: Transition.fade,
- bindings: bindings,
- children: children ?? const []);
- }
-
- List? defaultMiddlewares(Role? role) => (parent == null ||
- parent!.accessLevel.index < accessLevel.index)
- ? switch (accessLevel) {
- AccessLevel.public => null,
- AccessLevel.guest => [EnsureAuthOrGuestMiddleware()],
- AccessLevel.authenticated => [EnsureAuthedAndNotGuestMiddleware()],
- AccessLevel.roleBased => [EnsureRoleMiddleware(role ?? Role.buyer)],
- AccessLevel.masked => throw UnimplementedError(), //not for screens
- AccessLevel.secret => throw UnimplementedError(), //not for screens
- AccessLevel.notAuthed => [EnsureNotAuthedOrGuestMiddleware()],
- }
- : null;
-}
-
-extension RoleExtension on Role {
- int getCurrentIndexFromRoute(GetNavConfig? currentRoute) {
- final String? currentLocation = currentRoute?.location;
- int currentIndex = 0;
- if (currentLocation != null) {
- currentIndex =
- tabs.indexWhere((tab) => currentLocation.startsWith(tab.path));
- }
- return (currentIndex > 0) ? currentIndex : 0;
- }
-
- void routeTo(int value, GetDelegate delegate) {
- delegate.toNamed(tabs[value].route, arguments: {'role': this});
- }
-}
diff --git a/lib/app/widgets/auto_complete_text_field.dart b/lib/app/widgets/auto_complete_text_field.dart
new file mode 100644
index 00000000..2d608ed3
--- /dev/null
+++ b/lib/app/widgets/auto_complete_text_field.dart
@@ -0,0 +1,84 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:flutter_google_places_sdk/flutter_google_places_sdk.dart';
+
+class AutoCompleteTextField extends StatefulWidget {
+ final TextEditingController controller;
+ final String labelText;
+ final String? Function(String?) validator;
+ final FlutterGooglePlacesSdk places;
+ final Rx placeRx;
+ final Rx latLngRx;
+
+ const AutoCompleteTextField({
+ Key? key,
+ required this.controller,
+ required this.labelText,
+ required this.validator,
+ required this.places,
+ required this.placeRx,
+ required this.latLngRx,
+ }) : super(key: key);
+
+ @override
+ AutoCompleteTextFieldState createState() => AutoCompleteTextFieldState();
+}
+
+class AutoCompleteTextFieldState extends State {
+ final RxList _predictions = [].obs;
+
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ TextFormField(
+ controller: widget.controller,
+ decoration: InputDecoration(
+ labelText: widget.labelText,
+ ),
+ validator: widget.validator,
+ onChanged: (value) async {
+ if (value.length < 3) {
+ _predictions.clear();
+ return;
+ }
+
+ FindAutocompletePredictionsResponse response =
+ await widget.places.findAutocompletePredictions(value);
+ _predictions.value = response.predictions;
+ },
+ ),
+ Obx(() => _predictions.isNotEmpty
+ ? SizedBox(
+ height: 200,
+ child: ListView.builder(
+ itemCount: _predictions.length,
+ itemBuilder: (BuildContext context, int index) {
+ return ListTile(
+ title: Text(_predictions[index].primaryText),
+ onTap: () async {
+ FetchPlaceResponse fetchPlaceResponse = await widget.places
+ .fetchPlace(_predictions[index].placeId, fields: [
+ PlaceField.Location,
+ PlaceField.Name
+ ]);
+
+ Place? place = fetchPlaceResponse.place;
+ if (place != null) {
+ widget.controller.text = place.name ?? '';
+ widget.placeRx.value = place;
+ widget.latLngRx.value = place.latLng;
+ _predictions.clear();
+ }
+ },
+ );
+ },
+ ),
+ )
+ : const SizedBox.shrink()
+ ),
+ ],
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/widgets/change_password_dialog.dart b/lib/app/widgets/change_password_dialog.dart
deleted file mode 100644
index 78c392e5..00000000
--- a/lib/app/widgets/change_password_dialog.dart
+++ /dev/null
@@ -1,139 +0,0 @@
-import 'package:firebase_auth/firebase_auth.dart';
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../../constants.dart';
-
-class ChangePasswordDialog extends StatefulWidget {
- final User user;
-
- ChangePasswordDialog(this.user, {super.key});
-
- final _formKey = GlobalKey();
- final _formValues = FormValues();
-
- @override
- State createState() => _ChangePasswordDialogState();
-
- void onSubmit() async {
- if (_formKey.currentState != null && _formKey.currentState!.validate()) {
- _formKey.currentState?.save();
- try {
- AuthCredential credential = EmailAuthProvider.credential(
- email: user.email!, password: _formValues.old!);
- await user.reauthenticateWithCredential(credential);
- await user.updatePassword(_formValues.newP!);
- Get.back(result: true);
- } catch (e) {
- _formValues.authError = "Incorrect Password";
- _formKey.currentState!.validate();
- // Get.snackbar("Error", e.toString());
- }
- }
- }
-
- void onReset() {
- _formKey.currentState?.reset();
- }
-}
-
-class FormValues {
- String? old;
- String? newP;
- String? authError;
-}
-
-class _ChangePasswordDialogState extends State {
- @override
- Widget build(BuildContext context) {
- return Material(
- child: Form(
- key: widget._formKey,
- child: Column(
- children: [
- TextFormField(
- textInputAction: TextInputAction.done,
- autovalidateMode: AutovalidateMode.onUserInteraction,
- obscureText: true,
- cursorColor: kPrimaryColor,
- decoration: const InputDecoration(
- hintText: "Old Password",
- prefixIcon: Padding(
- padding: EdgeInsets.all(defaultPadding),
- child: Icon(Icons.key),
- ),
- ),
- validator: (String? value) {
- return widget._formValues.authError ??
- ((value != null && value.length < 8)
- ? 'Pwd cannot be less than 8 characters'
- : null);
- },
- onChanged: (value) {
- setState(() {
- widget._formValues.old = value;
- widget._formValues.authError = null;
- });
- },
- ),
- Padding(
- padding: const EdgeInsets.symmetric(vertical: defaultPadding),
- child: TextFormField(
- textInputAction: TextInputAction.done,
- autovalidateMode: AutovalidateMode.onUserInteraction,
- obscureText: true,
- cursorColor: kPrimaryColor,
- decoration: const InputDecoration(
- hintText: "New Password",
- prefixIcon: Padding(
- padding: EdgeInsets.all(defaultPadding),
- child: Icon(Icons.lock),
- ),
- ),
- validator: (String? value) {
- return (value != null && value.length < 8)
- ? 'Pwd cannot be less than 8 characters'
- : (value != null && value == widget._formValues.old)
- ? 'Pwd cannot be same as old Pwd'
- : null;
- },
- onChanged: (value) {
- setState(() {
- widget._formValues.newP = value;
- });
- },
- ),
- ),
- Padding(
- padding: const EdgeInsets.symmetric(vertical: defaultPadding),
- child: TextFormField(
- textInputAction: TextInputAction.done,
- autovalidateMode: AutovalidateMode.onUserInteraction,
- obscureText: true,
- cursorColor: kPrimaryColor,
- decoration: const InputDecoration(
- hintText: "Confirm Password",
- prefixIcon: Padding(
- padding: EdgeInsets.all(defaultPadding),
- child: Icon(Icons.confirmation_num),
- ),
- ),
- validator: (String? value) {
- return (value != null && value != widget._formValues.newP)
- ? 'Pwd does not match'
- : null;
- },
- ),
- ),
- const SizedBox(height: defaultPadding),
- ElevatedButton(
- onPressed: widget.onReset,
- child: const Text(
- "Reset",
- ),
- ),
- ],
- ),
- ));
- }
-}
diff --git a/lib/app/widgets/image_picker_button.dart b/lib/app/widgets/image_picker_button.dart
deleted file mode 100644
index d6e87ff4..00000000
--- a/lib/app/widgets/image_picker_button.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-import 'package:file_picker/file_picker.dart';
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import 'package:get_storage/get_storage.dart';
-import 'package:image_picker/image_picker.dart';
-
-import '../../models/action_enum.dart';
-import 'menu_sheet_button.dart';
-
-enum ImageSources implements ActionEnum {
- camera(Icons.camera, 'Camera'),
- gallery(Icons.photo_library, 'Gallery'),
- file(Icons.file_upload, 'File');
-
- const ImageSources(this.icon, this.label);
-
- @override
- Future doAction() async {
- switch (this) {
- case ImageSources.camera:
- return await getImage(ImageSource.camera);
- case ImageSources.gallery:
- return await getImage(ImageSource.gallery);
- case ImageSources.file:
- return await getFile();
- default:
- }
- return null;
- }
-
- @override
- final IconData? icon;
- @override
- final String? label;
-
- static Future getImage(ImageSource imageSource) async {
- final pickedFile = await ImagePicker().pickImage(source: imageSource);
- if (pickedFile != null) {
- return pickedFile.path;
- } else {
- Get.snackbar('Error', 'Image Not Selected');
- return null;
- }
- }
-
- static Future getFile() async {
- FilePickerResult? result = await FilePicker.platform
- .pickFiles(type: FileType.image, allowMultiple: false);
-
- if (result != null && result.files.isNotEmpty) {
- final fileBytes = result.files.first.bytes;
- final fileName = result.files.first.name;
- GetStorage().write(fileName, fileBytes);
-
- return fileName;
- //result.files.single.path;//is causing issues for Web, see https://github.com/miguelpruivo/flutter_file_picker/wiki/FAQ
- } else {
- Get.snackbar('Error', 'Image Not Selected');
- return null;
- }
- }
-}
-
-class ImagePickerButton extends MenuSheetButton {
- final ValueSetter? callback;
-
- const ImagePickerButton(
- {super.key,
- super.icon = const Icon(Icons.image),
- super.label = 'Pick an Image',
- this.callback});
-
- @override
- Iterable get values => ImageSources.values;
-
- @override
- void callbackFunc(act) {
- if (callback != null) callback!(act);
- }
-
- @override
- Widget build(BuildContext context) {
- return !(GetPlatform.isAndroid || GetPlatform.isIOS)
- ? TextButton.icon(
- onPressed: () async => callbackFunc(await ImageSources.getFile()),
- icon: icon,
- label: const Text('Pick an Image'),
- )
- : builder(context);
- }
-}
diff --git a/lib/app/widgets/login_widgets.dart b/lib/app/widgets/login_widgets.dart
deleted file mode 100644
index b8f2d8c1..00000000
--- a/lib/app/widgets/login_widgets.dart
+++ /dev/null
@@ -1,95 +0,0 @@
-// ignore_for_file: inference_failure_on_function_invocation
-
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../../services/auth_service.dart';
-import '../../models/screens.dart';
-import '../../services/remote_config.dart';
-import 'menu_sheet_button.dart';
-
-class LoginWidgets {
- static Widget headerBuilder(context, constraints, shrinkOffset) {
- return Padding(
- padding: const EdgeInsets.all(20),
- child: AspectRatio(
- aspectRatio: 1,
- child: Image.asset('assets/images/flutterfire_300x.png'),
- ),
- );
- }
-
- static Widget footerBuilder(myWidget) {
- return Column(
- children: [
- myWidget,
- const Padding(
- padding: EdgeInsets.only(top: 16),
- child: Text(
- 'By signing in, you agree to our terms and conditions.',
- style: TextStyle(color: Colors.grey),
- ))
- ],
- );
- }
-
- static Widget sideBuilder(context, shrinkOffset) {
- return Padding(
- padding: const EdgeInsets.all(20),
- child: AspectRatio(
- aspectRatio: 1,
- child: Image.asset('assets/images/flutterfire_300x.png'),
- ),
- );
- }
-}
-
-class LoginBottomSheetToggle extends MenuSheetButton {
- const LoginBottomSheetToggle(this.current, {super.key});
- final GetNavConfig current;
-
- @override
- Iterable get values {
- MenuItemsController controller = Get.find();
- return controller.values.value;
- }
-
- @override
- Icon? get icon => (AuthService.to.isLoggedInValue)
- ? values.length == 1
- ? const Icon(Icons.logout)
- : const Icon(Icons.menu)
- : const Icon(Icons.login);
-
- @override
- String? get label => (AuthService.to.isLoggedInValue)
- ? values.length == 1
- ? 'Logout'
- : 'Click for Options'
- : 'Login';
-
- @override
- Widget build(BuildContext context) {
- MenuItemsController controller = Get.put(
- MenuItemsController([]),
- permanent: true); //must make true else gives error
- Screen.sheet(null).then((val) {
- controller.values.value = val;
- });
- RemoteConfig.instance.then((ins) =>
- ins.addUseBottomSheetForProfileOptionsListener((val) async =>
- {controller.values.value = await Screen.sheet(null)}));
- return Obx(() => (AuthService.to.isLoggedInValue)
- ? builder(context, vals: controller.values.value)
- : !(current.currentPage!.name == Screen.LOGIN.path)
- ? IconButton(
- onPressed: () async {
- await Screen.LOGIN.doAction();
- // controller.toggle(Screen.LOGIN);
- },
- icon: Icon(Screen.LOGIN.icon),
- tooltip: Screen.LOGIN.label,
- )
- : const SizedBox.shrink()); //should be only for loggedin case
- }
-}
diff --git a/lib/app/widgets/menu_sheet_button.dart b/lib/app/widgets/menu_sheet_button.dart
deleted file mode 100644
index abd3873e..00000000
--- a/lib/app/widgets/menu_sheet_button.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-
-import '../../models/action_enum.dart';
-
-class MenuItemsController extends GetxController {
- MenuItemsController(Iterable iter) : values = Rx>(iter);
-
- final Rx> values;
-}
-
-class MenuSheetButton extends StatelessWidget {
- final Iterable? values_;
- final Icon? icon;
- final String? label;
-
- const MenuSheetButton(
- {super.key,
- this.values_,
- this.icon,
- this.label}); //passing scaffoldKey means that bottomSheet is added to it
-
- Iterable get values => values_!;
-
- static Widget bottomSheet(
- Iterable values, ValueSetter? callback) {
- return SizedBox(
- height: 180,
- width: Get.mediaQuery.size.width,
- child: ListView(
- // mainAxisAlignment: MainAxisAlignment.center,
- children: values
- .map(
- (ActionEnum value) => ListTile(
- leading: Icon(value.icon),
- title: Text(
- value.label!,
- ),
- onTap: () async {
- Get.back();
- callback != null
- ? callback(await value.doAction())
- : await value.doAction();
- }),
- )
- .toList(),
- ),
- );
- }
-
- List> getItems(BuildContext context, Iterable values) {
- return values.map>(createPopupMenuItem).toList();
- }
-
- PopupMenuEntry createPopupMenuItem(dynamic value) => PopupMenuItem(
- value: value,
- child: Text(value.label ?? ''), //TODO add Icon
- );
-
- @override
- Widget build(BuildContext context) {
- return builder(context);
- }
-
-//This should be a modal bottom sheet if on Mobile (See https://mercyjemosop.medium.com/select-and-upload-images-to-firebase-storage-flutter-6fac855970a9)
- Widget builder(BuildContext context, {Iterable? vals}) {
- Iterable values = vals ?? values_!;
- return values.length == 1 ||
- Get.mediaQuery.orientation == Orientation.portrait
- // : Get.context!.isPortrait
- ? (icon != null
- ? IconButton(
- onPressed: () => buttonPressed(values),
- icon: icon!,
- tooltip: label,
- )
- : TextButton(
- onPressed: () => buttonPressed(values),
- child: Text(label ?? 'Need Label')))
- : PopupMenuButton(
- itemBuilder: (context_) => getItems(context_, values),
- icon: icon,
- tooltip: label,
- onSelected: (T value) async =>
- callbackFunc(await value.doAction()));
- }
-
- void buttonPressed(Iterable values) async => values.length == 1
- ? callbackFunc(await values.first.doAction())
- : Get.bottomSheet(MenuSheetButton.bottomSheet(values, callbackFunc),
- backgroundColor: Colors.white);
-
- void callbackFunc(act) {}
-}
diff --git a/lib/app/widgets/my_button.dart b/lib/app/widgets/my_button.dart
new file mode 100644
index 00000000..e36baeab
--- /dev/null
+++ b/lib/app/widgets/my_button.dart
@@ -0,0 +1,41 @@
+import 'package:flutter/material.dart';
+
+class MyButton extends StatelessWidget {
+ final Function()? onTap;
+ final String text;
+ final bool isLoading;
+
+ const MyButton({
+ Key? key,
+ required this.onTap,
+ required this.text,
+ this.isLoading = false,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ onTap: isLoading ? null : onTap,
+ child: Container(
+ padding: const EdgeInsets.all(25),
+ margin: const EdgeInsets.symmetric(horizontal: 25),
+ decoration: BoxDecoration(
+ color: Colors.black,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Center(
+ child: isLoading
+ ? const CircularProgressIndicator(color: Colors.white)
+ : Text(
+ text,
+ style: const TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ fontSize: 16,
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/widgets/my_text_field.dart b/lib/app/widgets/my_text_field.dart
new file mode 100644
index 00000000..4f54c408
--- /dev/null
+++ b/lib/app/widgets/my_text_field.dart
@@ -0,0 +1,62 @@
+import 'package:flutter/material.dart';
+
+class MyTextField extends StatefulWidget {
+ final TextEditingController controller;
+ final String hintText;
+ final bool obscureText;
+ final TextInputType? keyboardType;
+ final bool enabled;
+
+ const MyTextField({
+ Key? key,
+ required this.controller,
+ required this.hintText,
+ this.obscureText = false,
+ this.keyboardType,
+ this.enabled = true,
+ }) : super(key: key);
+
+ @override
+ _MyTextFieldState createState() => _MyTextFieldState();
+}
+
+class _MyTextFieldState extends State {
+ late TextEditingController _controller;
+
+ @override
+ void initState() {
+ super.initState();
+ _controller = widget.controller;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 25),
+ child: TextField(
+ controller: _controller,
+ obscureText: widget.obscureText,
+ keyboardType: widget.keyboardType,
+ enabled: widget.enabled,
+ decoration: InputDecoration(
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey.shade200),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey.shade400),
+ ),
+ fillColor: Colors.grey.shade200,
+ filled: true,
+ hintText: widget.hintText,
+ hintStyle: TextStyle(color: Colors.grey.shade500),
+ ),
+ ),
+ );
+ }
+
+ @override
+ void dispose() {
+ // Don't dispose the controller here, as it's managed by the parent
+ super.dispose();
+ }
+}
\ No newline at end of file
diff --git a/lib/app/widgets/past_ryde_card.dart b/lib/app/widgets/past_ryde_card.dart
new file mode 100644
index 00000000..50e2d146
--- /dev/null
+++ b/lib/app/widgets/past_ryde_card.dart
@@ -0,0 +1,107 @@
+import 'package:flutter/material.dart';
+import 'package:cloud_firestore/cloud_firestore.dart';
+
+import '../../models/euser.dart';
+import '../../models/ride.dart';
+
+
+class PastRideCard extends StatelessWidget {
+ final Ride ride;
+
+ PastRideCard({required this.ride});
+
+ @override
+ Widget build(BuildContext context) {
+ return FutureBuilder(
+ future: FirebaseFirestore.instance.collection('Users').doc(ride.driverId).get(),
+ builder: (context, snapshot) {
+ if (!snapshot.hasData || snapshot.data == null || snapshot.data!.data() == null) {
+ return const CircularProgressIndicator();
+ }
+
+ Map data = snapshot.data!.data()! as Map;
+ EUser driver = EUser.fromMap(data);
+
+ return FutureBuilder>(
+ future: getRiderNames(ride.riderIds),
+ builder: (context, snapshot) {
+ if (snapshot.connectionState == ConnectionState.waiting) {
+ return CircularProgressIndicator();
+ }
+
+ if (snapshot.hasError) {
+ return Text('Error: ${snapshot.error}');
+ }
+
+ return Card(
+ color: Colors.blueGrey.shade300,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(20.0),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ rowBuilder('Pickup: ${ride.pickupLocation}', Icons.location_on),
+ SizedBox(height: 8.0),
+ rowBuilder('Destination: ${ride.destination}', Icons.location_on),
+ SizedBox(height: 8.0),
+ rowBuilder('Driver: ${driver.name}', Icons.directions_car),
+ SizedBox(height: 8.0),
+ Column(
+ children: snapshot.data!.map((rider) {
+ return rowBuilder(rider, Icons.person);
+ }).toList(),
+ ),
+ SizedBox(height: 8.0),
+ rowBuilder('Fare: \$${ride.fare.toStringAsFixed(2)}', Icons.attach_money),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ },
+ );
+ }
+
+ Widget rowBuilder(String text, IconData icon) {
+ List parts = text.split(':');
+
+ return Row(
+ children: [
+ Icon(icon),
+ SizedBox(width: 8),
+ Flexible(
+ child: RichText(
+ overflow: TextOverflow.ellipsis,
+ text: TextSpan(
+ children: [
+ TextSpan(
+ text: parts[0] + ':',
+ style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, color: Colors.black),
+ ),
+ TextSpan(
+ text: parts.length > 1 ? parts[1] : '',
+ style: TextStyle(fontSize: 16.0, color: Colors.black),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+
+ Future> getRiderNames(List riderIds) async {
+ List riderNames = [];
+ for (var riderId in riderIds) {
+ DocumentSnapshot doc = await FirebaseFirestore.instance.collection('Users').doc(riderId).get();
+ Map data = doc.data()! as Map;
+ EUser rider = EUser.fromMap(data);
+ riderNames.add('Rider: ${rider.name}');
+ }
+ return riderNames;
+ }
+}
\ No newline at end of file
diff --git a/lib/app/widgets/screen_widget.dart b/lib/app/widgets/screen_widget.dart
deleted file mode 100644
index d80c9275..00000000
--- a/lib/app/widgets/screen_widget.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import '../routes/app_pages.dart';
-import '../../models/role.dart';
-import '../../models/screens.dart';
-
-class ScreenWidget extends StatelessWidget {
- final Widget body;
- final Role? role;
-
- final GetDelegate? delegate;
-
- final GetNavConfig? currentRoute;
-
- final Screen screen;
- final AppBar? appBar;
-
- const ScreenWidget({
- super.key,
- required this.body,
- required this.screen,
- this.role = Role.buyer,
- this.delegate,
- this.currentRoute,
- this.appBar,
- });
-
- @override
- Widget build(BuildContext context) {
- int currentIndex =
- role != null ? role!.getCurrentIndexFromRoute(currentRoute) : 0;
- Iterable fabs = screen.fabs;
- return Scaffold(
- body: body,
- appBar: appBar,
- bottomNavigationBar: (screen.navTabs.isNotEmpty)
- ? BottomNavigationBar(
- currentIndex: currentIndex,
- onTap: (value) {
- if (delegate != null) {
- role!.routeTo(value, delegate!);
- }
- },
- items:
- role!.tabs //screen may have more navTabs but we need by role
- .map((Screen tab) => BottomNavigationBarItem(
- icon: Icon(tab.icon),
- label: tab.label,
- ))
- .toList(),
- )
- : null,
- floatingActionButton: fabs.isNotEmpty ? getFAB(fabs) : null,
- // bottomSheet: //this is used for persistent bar like status bar
- );
- }
-
- FloatingActionButton? getFAB(Iterable fabs) {
- if (fabs.length == 1) {
- var screen = fabs.firstOrNull!;
- return FloatingActionButton.extended(
- backgroundColor: Colors.blue,
- onPressed: () => Get.rootDelegate.toNamed(screen.route),
- label: Text(screen.label ?? ''),
- icon: screen.icon == null
- ? null
- : Icon(
- screen.icon,
- color: Colors.white,
- ),
- );
- }
- return null; //TODO multi fab button on press
- }
-}
diff --git a/lib/app/widgets/top_text.dart b/lib/app/widgets/top_text.dart
new file mode 100644
index 00000000..4df06c5a
--- /dev/null
+++ b/lib/app/widgets/top_text.dart
@@ -0,0 +1,40 @@
+import 'package:flutter/material.dart';
+
+class TopText extends StatelessWidget {
+ final String text;
+ final Color backgroundColor;
+ final Color textColor;
+
+ const TopText({
+ Key? key,
+ required this.text,
+ this.backgroundColor = Colors.black,
+ this.textColor = Colors.white,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ margin: const EdgeInsets.only(top: 10),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 20),
+ child: Container(
+ padding: const EdgeInsets.all(25),
+ decoration: BoxDecoration(
+ color: backgroundColor,
+ borderRadius: BorderRadius.circular(100),
+ ),
+ child: Center(
+ child: Text(
+ text,
+ style: TextStyle(
+ color: textColor,
+ fontSize: 16,
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/app/widgets/travel_card.dart b/lib/app/widgets/travel_card.dart
new file mode 100644
index 00000000..69cf24f5
--- /dev/null
+++ b/lib/app/widgets/travel_card.dart
@@ -0,0 +1,85 @@
+import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
+import '../../models/ride.dart';
+
+class TravelCard extends StatelessWidget {
+ final Ride ride;
+ final VoidCallback onPressed;
+ final bool isEditable;
+ final bool isUserRide;
+
+ const TravelCard({
+ Key? key,
+ required this.ride,
+ required this.onPressed,
+ this.isEditable = false,
+ this.isUserRide = false,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ final formattedDateTime = DateFormat('HH:mm a').format(ride.departureDateTime);
+ final formattedTime = formattedDateTime.split(' ')[0];
+ final period = formattedDateTime.split(' ')[1];
+
+ return GestureDetector(
+ onTap: onPressed,
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(25),
+ color: Colors.blueGrey.shade300,
+ ),
+ padding: const EdgeInsets.all(16),
+ margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ formattedTime,
+ style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
+ ),
+ Text(period,
+ style: const TextStyle(fontSize: 16, color: Colors.white)),
+ ],
+ ),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Text(
+ ride.destination,
+ style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
+ overflow: TextOverflow.ellipsis,
+ ),
+ Text(
+ ride.pickupLocation,
+ style: const TextStyle(fontSize: 17, color: Colors.white),
+ overflow: TextOverflow.ellipsis,
+ ),
+ ],
+ ),
+ ),
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Text(
+ "\$${ride.fare.toStringAsFixed(2)}",
+ style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
+ ),
+ const Text("Fare",
+ style: TextStyle(fontSize: 16, color: Colors.white)),
+ ],
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/constants.dart b/lib/constants.dart
deleted file mode 100644
index dd5d17ce..00000000
--- a/lib/constants.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:flutter/material.dart';
-// import 'package:get/get_utils/src/platform/platform.dart';
-
-const kPrimaryColor = Color(0xFF6F35A5);
-const kPrimaryLightColor = Color(0xFFF1E6FF);
-
-const double defaultPadding = 16.0;
-
-const useEmulator = false;
-
-const useRecaptcha = false;
-
-const sendMailFromClient =
- true; // set this true if in server using custom claim status
-
-const emulatorHost =
- "127.0.0.1"; // GetPlatform.isAndroid ? "10.0.2.2" : "127.0.0.1"; //This is not required due to automaticHostMapping
-
-const baseUrl = useEmulator ? "http://127.0.0.1" : "your domain";
-
-const bundleID = "com.example";
diff --git a/lib/copy_files.dart b/lib/copy_files.dart
new file mode 100644
index 00000000..368e773b
--- /dev/null
+++ b/lib/copy_files.dart
@@ -0,0 +1,75 @@
+import 'dart:io';
+
+void main() {
+ final currentDir = Directory.current;
+ final outputDir = Directory('all_files');
+
+ // Create the output directory if it doesn't exist
+ if (!outputDir.existsSync()) {
+ outputDir.createSync(recursive: true);
+ print('Created directory: ${outputDir.path}');
+ } else {
+ print('Directory already exists: ${outputDir.path}');
+ }
+
+ void copyFile(File sourceFile, Directory targetDir) {
+ try {
+ String fileName = sourceFile.uri.pathSegments.last;
+
+ // Initialize the target file path
+ String targetPath = '${targetDir.path}/$fileName';
+ File targetFile = File(targetPath);
+
+ // Handle potential filename conflicts
+ int counter = 1;
+ String fileNameWithoutExtension;
+ String fileExtension;
+
+ if (fileName.contains('.')) {
+ int lastDot = fileName.lastIndexOf('.');
+ fileNameWithoutExtension = fileName.substring(0, lastDot);
+ fileExtension = fileName.substring(lastDot);
+ } else {
+ fileNameWithoutExtension = fileName;
+ fileExtension = '';
+ }
+
+ // Append counter until a unique filename is found
+ while (targetFile.existsSync()) {
+ String newFileName =
+ '${fileNameWithoutExtension}_$counter$fileExtension';
+ targetPath = '${targetDir.path}/$newFileName';
+ targetFile = File(targetPath);
+ counter++;
+ }
+
+ // Copy the file
+ sourceFile.copySync(targetPath);
+ print('Copied: ${sourceFile.path} -> $targetPath');
+ } catch (e) {
+ print('Error copying file ${sourceFile.path}: $e');
+ }
+ }
+
+ // Recursively find and copy all files to the output directory
+ // Exclude the output directory itself to prevent infinite loops
+ void copyFiles(Directory dir) {
+ try {
+ for (var entity in dir.listSync(recursive: false)) {
+ if (entity is File) {
+ copyFile(entity, outputDir);
+ } else if (entity is Directory && entity.path != outputDir.path) {
+ copyFiles(entity);
+ }
+ }
+ } catch (e) {
+ print('Error accessing directory ${dir.path}: $e');
+ }
+ }
+
+
+ // Start copying files from the current directory
+ copyFiles(currentDir);
+
+ print('All files have been copied to ${outputDir.path}');
+}
diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart
new file mode 100644
index 00000000..b81984e8
--- /dev/null
+++ b/lib/firebase_options.dart
@@ -0,0 +1,85 @@
+// File generated by FlutterFire CLI.
+// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
+import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
+import 'package:flutter/foundation.dart'
+ show defaultTargetPlatform, kIsWeb, TargetPlatform;
+
+/// Default [FirebaseOptions] for use with your Firebase apps.
+///
+/// Example:
+/// ```dart
+/// import 'firebase_options.dart';
+/// // ...
+/// await Firebase.initializeApp(
+/// options: DefaultFirebaseOptions.currentPlatform,
+/// );
+/// ```
+///
+class DefaultFirebaseOptions {
+
+ static FirebaseOptions get currentPlatform {
+ if (kIsWeb) {
+ return web;
+ }
+ switch (defaultTargetPlatform) {
+ case TargetPlatform.android:
+ return android;
+ case TargetPlatform.iOS:
+ return ios;
+ case TargetPlatform.macOS:
+ return macos;
+ case TargetPlatform.windows:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for windows - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ case TargetPlatform.linux:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for linux - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ default:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions are not supported for this platform.',
+ );
+ }
+ }
+
+ static const FirebaseOptions web = FirebaseOptions(
+ apiKey: 'AIzaSyC0QvbIKZ1Ib3YhPqsXZUpyjVXD6evhBxY',
+ appId: '1:168247508765:web:9c5553ef6fabb93e38ebf4',
+ messagingSenderId: '168247508765',
+ projectId: 'eduryde',
+ authDomain: 'eduryde.firebaseapp.com',
+ storageBucket: 'eduryde.appspot.com',
+ measurementId: 'G-NL47S8RR44',
+ );
+
+ static const FirebaseOptions android = FirebaseOptions(
+ apiKey: 'AIzaSyBaJt7zrKMTZSYJz6vD2CTOA-8HdZ3ghII',
+ appId: '1:168247508765:android:85850294d429dee738ebf4',
+ messagingSenderId: '168247508765',
+ projectId: 'eduryde',
+ storageBucket: 'eduryde.appspot.com',
+ );
+
+ static const FirebaseOptions ios = FirebaseOptions(
+ apiKey: 'AIzaSyAlBX90zh6ErB0mW-FvNDEC3xZ8cKFNdK4',
+ appId: '1:168247508765:ios:2df5ab1351ffa28a38ebf4',
+ messagingSenderId: '168247508765',
+ projectId: 'eduryde',
+ storageBucket: 'eduryde.appspot.com',
+ iosClientId: '168247508765-tcoltq95g1oahsg25428mmqv3aj16j8a.apps.googleusercontent.com',
+ iosBundleId: 'com.example.eduryde',
+ );
+
+ static const FirebaseOptions macos = FirebaseOptions(
+ apiKey: 'AIzaSyAlBX90zh6ErB0mW-FvNDEC3xZ8cKFNdK4',
+ appId: '1:168247508765:ios:2df5ab1351ffa28a38ebf4',
+ messagingSenderId: '168247508765',
+ projectId: 'eduryde',
+ storageBucket: 'eduryde.appspot.com',
+ iosClientId: '168247508765-tcoltq95g1oahsg25428mmqv3aj16j8a.apps.googleusercontent.com',
+ iosBundleId: 'com.example.eduryde',
+ );
+}
diff --git a/lib/firebase_options.template b/lib/firebase_options.template
deleted file mode 100644
index 57f5e36d..00000000
--- a/lib/firebase_options.template
+++ /dev/null
@@ -1,96 +0,0 @@
-// This is a template of the file generated by FlutterFire CLI.
-// Actual file will be .dart extension
-// ignore_for_file: type=lint
-import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
-import 'package:firebase_storage/firebase_storage.dart';
-import 'package:flutter/foundation.dart'
- show defaultTargetPlatform, kIsWeb, TargetPlatform;
-
-/// Default [FirebaseOptions] for use with your Firebase apps.
-///
-/// Example:
-/// ```dart
-/// import 'firebase_options.dart';
-/// // ...
-/// await Firebase.initializeApp(
-/// options: DefaultFirebaseOptions.currentPlatform,
-/// );
-/// ```
-class DefaultFirebaseOptions {
- static FirebaseOptions get currentPlatform {
- if (kIsWeb) {
- return web;
- }
- switch (defaultTargetPlatform) {
- case TargetPlatform.android:
- return android;
- case TargetPlatform.iOS:
- return ios;
- case TargetPlatform.macOS:
- return macos;
- case TargetPlatform.windows:
- return windows;
- case TargetPlatform.linux:
- throw UnsupportedError(
- 'DefaultFirebaseOptions have not been configured for linux - '
- 'you can reconfigure this by running the FlutterFire CLI again.',
- );
- default:
- throw UnsupportedError(
- 'DefaultFirebaseOptions are not supported for this platform.',
- );
- }
- }
-
- static const FirebaseOptions web = FirebaseOptions(
- apiKey: 'YOUR_API_KEY',
- appId: 'YOUR_APP_ID',
- messagingSenderId: 'YOUR_MESSAGING_ID',
- projectId: 'YOUR_PROJECT_ID',
- authDomain: 'YOUR_PROJECT_ID.firebaseapp.com',
- storageBucket: 'YOUR_PROJECT_ID.appspot.com',
- measurementId: 'YOUR_MEASUREMENT_ID',
- );
-
- static const String webClientId =
- 'YOUR_APP_ID.apps.googleusercontent.com';
-
- static const FirebaseOptions android = FirebaseOptions(
- apiKey: 'YOUR_APP_ID',
- appId: 'YOUR_APP_ID',
- messagingSenderId: 'YOUR_MESSAGING_ID',
- projectId: 'YOUR_PROJECT_ID',
- storageBucket: 'YOUR_PROJECT_ID.appspot.com',
- );
-
- static const FirebaseOptions ios = FirebaseOptions(
- apiKey: 'YOUR_API_KEY',
- appId: 'YOUR_APP_ID',
- messagingSenderId: 'YOUR_MESSAGING_ID',
- projectId: 'YOUR_PROJECT_ID',
- storageBucket: 'YOUR_PROJECT_ID.appspot.com',
- iosBundleId: 'com.example.complete',
- );
-
- static const FirebaseOptions macos = FirebaseOptions(
- apiKey: 'YOUR_API_KEY',
- appId: 'YOUR_APP_ID',
- messagingSenderId: 'YOUR_MESSAGING_ID',
- projectId: 'YOUR_PROJECT_ID',
- storageBucket: 'YOUR_PROJECT_ID.appspot.com',
- iosBundleId: 'com.example.complete',
- );
-
- static const FirebaseOptions windows = FirebaseOptions(
- apiKey: 'YOUR_API_KEY',
- appId: 'YOUR_APP_ID',
- messagingSenderId: 'YOUR_MESSAGING_ID',
- projectId: 'YOUR_PROJECT_ID',
- authDomain: 'YOUR_PROJECT_ID.firebaseapp.com',
- storageBucket: 'YOUR_PROJECT_ID.appspot.com',
- measurementId: 'YOUR_MEASUREMENT_ID',
- );
-
- final storage =
- FirebaseStorage.instanceFor(bucket: "gs://YOUR_PROJECT_ID.appspot.com");
-}
diff --git a/lib/images/eduryde_circular.png b/lib/images/eduryde_circular.png
new file mode 100644
index 00000000..d86e833c
Binary files /dev/null and b/lib/images/eduryde_circular.png differ
diff --git a/lib/images/eduryde_logo.png b/lib/images/eduryde_logo.png
new file mode 100644
index 00000000..d86e833c
Binary files /dev/null and b/lib/images/eduryde_logo.png differ
diff --git a/lib/main.dart b/lib/main.dart
index 30c258f2..dc29af28 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,44 +1,56 @@
-// ignore_for_file: inference_failure_on_instance_creation
-
-import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
+import 'package:firebase_core/firebase_core.dart';
import 'package:get_storage/get_storage.dart';
-
import 'app/routes/app_pages.dart';
-import 'firebase_options.dart';
import 'services/auth_service.dart';
+import 'services/firestore_service.dart';
+import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
- await GetStorage.init();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
+ await GetStorage.init();
+
+ // Initialize services
+ Get.put(FirestoreService());
+ Get.put(AuthService());
+
+ runApp(MyApp());
+}
- runApp(
- GetMaterialApp.router(
- debugShowCheckedModeBanner:
- false, //the debug banner will automatically disappear in prod build
- title: 'Application',
- initialBinding: BindingsBuilder(
- () {
- Get.put(AuthService());
- },
- ),
+class MyApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return GetMaterialApp(
+ title: "EduRyde",
+ initialRoute: AppPages.INITIAL,
getPages: AppPages.routes,
- // routeInformationParser: GetInformationParser(
- // // initialRoute: Routes.HOME,
- // ),
- // routerDelegate: GetDelegate(
- // backButtonPopMode: PopMode.History,
- // preventDuplicateHandlingMode:
- // PreventDuplicateHandlingMode.ReorderRoutes,
- // ),
- theme: ThemeData(
- highlightColor: Colors.black.withOpacity(0.5),
- bottomSheetTheme:
- const BottomSheetThemeData(surfaceTintColor: Colors.blue)),
- ),
- );
+ initialBinding: BindingsBuilder(() {
+ Get.put(AuthService());
+ }),
+ navigatorObservers: [
+ GetObserver(MiddlewareRunner.observer), // Custom observer
+ ],
+ );
+ }
}
+
+class MiddlewareRunner {
+ static void observer(Routing? routing) {
+ if (routing?.current == routing?.previous) return;
+
+ AuthService authService = Get.find();
+ if (authService.currentUser != null) {
+ if (Get.currentRoute == Routes.LOGIN) {
+ Get.offAllNamed(Routes.HOME);
+ }
+ } else {
+ if (Get.currentRoute != Routes.LOGIN && Get.currentRoute != Routes.REGISTER) {
+ Get.offAllNamed(Routes.LOGIN);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/lib/models/access_level.dart b/lib/models/access_level.dart
deleted file mode 100644
index a7b89742..00000000
--- a/lib/models/access_level.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-enum AccessLevel {
- public, //available without any login
- guest, //available with guest login
- notAuthed, // used for login screens
- authenticated, //available on login
- roleBased, //available on login and with allowed roles
- masked, //available in a partly masked manner based on role
- secret //never visible
-}
diff --git a/lib/models/action_enum.dart b/lib/models/action_enum.dart
deleted file mode 100644
index 023adba5..00000000
--- a/lib/models/action_enum.dart
+++ /dev/null
@@ -1,7 +0,0 @@
-import 'package:flutter/material.dart';
-
-abstract class ActionEnum {
- Future doAction();
- IconData? get icon;
- String? get label;
-}
diff --git a/lib/models/euser.dart b/lib/models/euser.dart
new file mode 100644
index 00000000..02dd1529
--- /dev/null
+++ b/lib/models/euser.dart
@@ -0,0 +1,51 @@
+class EUser {
+ String id;
+ String name;
+ String email;
+ String phone;
+ String? profileImageUrl;
+ bool isDriver;
+ bool hasActiveRide;
+ String activeRideUid;
+ List rideUids;
+
+ EUser({
+ this.id = '',
+ this.name = '',
+ this.email = '',
+ this.phone = '',
+ this.profileImageUrl,
+ this.isDriver = false,
+ this.hasActiveRide = false,
+ this.activeRideUid = '',
+ this.rideUids = const [],
+ });
+
+ factory EUser.fromMap(Map map) {
+ return EUser(
+ id: map['id'] ?? '',
+ name: map['name'] ?? '',
+ email: map['email'] ?? '',
+ phone: map['phone'] ?? '',
+ profileImageUrl: map['profileImageUrl'],
+ isDriver: map['isDriver'] ?? false,
+ hasActiveRide: map['hasActiveRide'] ?? false,
+ activeRideUid: map['activeRideUid'] ?? '',
+ rideUids: List.from(map['rideUids'] ?? []),
+ );
+ }
+
+ Map toMap() {
+ return {
+ 'id': id,
+ 'name': name,
+ 'email': email,
+ 'phone': phone,
+ 'profileImageUrl': profileImageUrl,
+ 'isDriver': isDriver,
+ 'hasActiveRide': hasActiveRide,
+ 'activeRideUid': activeRideUid,
+ 'rideUids': rideUids,
+ };
+ }
+}
\ No newline at end of file
diff --git a/lib/models/product.dart b/lib/models/product.dart
deleted file mode 100644
index 003d5785..00000000
--- a/lib/models/product.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-class Product {
- final String name;
- final String id;
-
- Product({
- required this.name,
- required this.id,
- });
-}
diff --git a/lib/models/ride.dart b/lib/models/ride.dart
new file mode 100644
index 00000000..53245c48
--- /dev/null
+++ b/lib/models/ride.dart
@@ -0,0 +1,68 @@
+import 'package:cloud_firestore/cloud_firestore.dart';
+
+class Ride {
+ final String id;
+ final String driverId;
+ final List riderIds;
+ final String destination;
+ final String pickupLocation;
+ final double destinationLat;
+ final double destinationLng;
+ final double pickupLat;
+ final double pickupLng;
+ final DateTime departureDateTime;
+ final double fare;
+ String tripStatus;
+
+ Ride({
+ required this.id,
+ required this.driverId,
+ required this.riderIds,
+ required this.destination,
+ required this.pickupLocation,
+ required this.destinationLat,
+ required this.destinationLng,
+ required this.pickupLat,
+ required this.pickupLng,
+ required this.departureDateTime,
+ required this.fare,
+ required this.tripStatus,
+ });
+
+ factory Ride.fromMap(Map map, String id) {
+ return Ride(
+ id: id,
+ driverId: map['driverId'] ?? '',
+ riderIds: List.from(map['riderIds'] ?? []),
+ destination: map['destination'] ?? '',
+ pickupLocation: map['pickupLocation'] ?? '',
+ destinationLat: (map['destinationLatLng'] as Map)['lat'] ?? 0.0,
+ destinationLng: (map['destinationLatLng'] as Map)['lng'] ?? 0.0,
+ pickupLat: (map['pickupLatLng'] as Map)['lat'] ?? 0.0,
+ pickupLng: (map['pickupLatLng'] as Map)['lng'] ?? 0.0,
+ departureDateTime: (map['departureDateTime'] as Timestamp).toDate(),
+ fare: (map['fare'] ?? 0.0).toDouble(),
+ tripStatus: map['tripStatus'] ?? '',
+ );
+ }
+
+ Map toMap() {
+ return {
+ 'driverId': driverId,
+ 'riderIds': riderIds,
+ 'destination': destination,
+ 'pickupLocation': pickupLocation,
+ 'destinationLatLng': {
+ 'lat': destinationLat,
+ 'lng': destinationLng,
+ },
+ 'pickupLatLng': {
+ 'lat': pickupLat,
+ 'lng': pickupLng,
+ },
+ 'departureDateTime': Timestamp.fromDate(departureDateTime),
+ 'fare': fare,
+ 'tripStatus': tripStatus,
+ };
+ }
+}
\ No newline at end of file
diff --git a/lib/models/role.dart b/lib/models/role.dart
deleted file mode 100644
index 50ee31b4..00000000
--- a/lib/models/role.dart
+++ /dev/null
@@ -1,35 +0,0 @@
-import 'screens.dart';
-
-// First tab for all except Admin is Home/Dashboard which is diferrent for each role
-// Admin is User List By Roles with slide to Change Role or Disable
-// Second tab for
-// Guest & Buyer is Public Product List by Category with Slide to Add to Cart
-// Seller is Product List by Category with Add Product FAB leading to Product Form
-// Admin is Category List with Add Category FAB
-// Third tab for
-// Guest is Cart with Guest Auth
-// Buyer is Cart with own Auth
-// Seller is MyProducts
-// Admin is Tasks/Approvals
-// Profile and Settings is in Drawer
-
-enum Role {
- buyer([Screen.DASHBOARD, Screen.PRODUCTS, Screen.CART]),
- seller([Screen.DASHBOARD, Screen.PRODUCTS, Screen.MY_PRODUCTS]),
- admin([Screen.USERS, Screen.CATEGORIES, Screen.TASKS]);
-//higher role can assume a lower role
-
- const Role(this.permissions);
- final List
- permissions; //list of screens, with accessLevel = roleBased, visible for the role
-
- static Role fromString(String? name) => (name != null
- ? Role.values.firstWhere((role) => role.name == name)
- : Role.buyer);
- bool hasAccess(Role role) => index >= role.index;
- bool hasAccessOf(String role) => index >= fromString(role).index;
-
- List get tabs => permissions
- .where((screen) => screen.accessor_ == AccessedVia.navigator)
- .toList(); //the ones in tab
-}
diff --git a/lib/models/screens.dart b/lib/models/screens.dart
deleted file mode 100644
index 24dee39f..00000000
--- a/lib/models/screens.dart
+++ /dev/null
@@ -1,177 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import '../app/widgets/login_widgets.dart';
-import '../services/remote_config.dart';
-import 'action_enum.dart';
-import 'access_level.dart';
-import '../../services/auth_service.dart';
-
-enum AccessedVia {
- auto,
- widget, //example: top right button
- navigator, //bottom nav. can be linked to drawer items //handled in ScreenWidget
- drawer, //creates nav tree //handled in RootView
- bottomSheet, //context menu for web handled via the Button that calls the sheet
- fab, //handled in ScreenWidget
- singleTap, //when an item of a list is clicked
- longTap //or double click
-}
-
-enum Screen implements ActionEnum {
- HOME('/home',
- icon: Icons.home,
- label: "Home",
- accessor_: AccessedVia.drawer,
- accessLevel: AccessLevel.public), //first screen is default screen
- DASHBOARD('/dashboard',
- icon: Icons.home,
- label: "Home",
- accessor_: AccessedVia.navigator,
- accessLevel: AccessLevel.public,
- parent: HOME),
- PRODUCTS('/products',
- icon: Icons.dataset,
- label: "Products",
- accessor_: AccessedVia.navigator,
- accessLevel: AccessLevel.public,
- parent: HOME),
- PRODUCT_DETAILS('/:productId',
- accessLevel: AccessLevel.public, parent: PRODUCTS),
- LOGIN('/login',
- icon: Icons.login,
- accessor_: AccessedVia.widget,
- accessLevel: AccessLevel.notAuthed),
- PROFILE('/profile',
- icon: Icons.account_box_rounded,
- label: "Profile",
- accessor_: AccessedVia.drawer,
- accessLevel: AccessLevel.authenticated,
- remoteConfig: true),
- SETTINGS('/settings',
- icon: Icons.settings,
- label: "Settings",
- accessor_: AccessedVia.drawer,
- accessLevel: AccessLevel.authenticated,
- remoteConfig: true),
- CART('/cart',
- icon: Icons.trolley,
- label: "Cart",
- parent: HOME,
- accessor_: AccessedVia.navigator,
- accessLevel: AccessLevel.guest),
- CART_DETAILS('/:productId', parent: CART, accessLevel: AccessLevel.guest),
- CHECKOUT('/checkout',
- icon: Icons.check_outlined,
- label: "Checkout",
- accessor_: AccessedVia.fab, //fab appears in parent
- parent: CART,
- accessLevel: AccessLevel.authenticated),
- REGISTER('/register',
- accessor_: AccessedVia.auto, accessLevel: AccessLevel.authenticated),
- CATEGORIES('/categories',
- icon: Icons.category,
- label: "Categories",
- parent: HOME,
- accessor_: AccessedVia.navigator,
- accessLevel: AccessLevel.roleBased),
- TASKS('/tasks',
- icon: Icons.task,
- label: "Tasks",
- parent: HOME,
- accessor_: AccessedVia.navigator,
- accessLevel: AccessLevel.roleBased),
- TASK_DETAILS('/:taskId', parent: TASKS, accessLevel: AccessLevel.roleBased),
- USERS('/users',
- icon: Icons.verified_user,
- label: "Users",
- parent: HOME,
- accessor_: AccessedVia.navigator,
- accessLevel: AccessLevel.roleBased),
- USER_PROFILE('/:uId', parent: USERS, accessLevel: AccessLevel.roleBased),
- MY_PRODUCTS('/my-products',
- parent: HOME,
- icon: Icons.inventory,
- accessor_: AccessedVia.navigator,
- label: "Inventory",
- accessLevel: AccessLevel.roleBased),
- MY_PRODUCT_DETAILS('/:productId',
- parent: MY_PRODUCTS, accessLevel: AccessLevel.roleBased),
- LOGOUT('/login',
- icon: Icons.logout,
- label: "Logout",
- accessor_: AccessedVia.bottomSheet,
- accessLevel: AccessLevel.authenticated),
- ;
-
- const Screen(this.path,
- {this.icon,
- this.label,
- this.parent,
- this.accessor_ = AccessedVia.singleTap,
- this.accessLevel = AccessLevel.authenticated,
- this.remoteConfig = false});
-
- @override
- final IconData? icon;
- @override
- final String? label;
-
- final String path;
- final AccessedVia accessor_;
- final Screen? parent;
- final AccessLevel
- accessLevel; //if false it is role based. true means allowed for all
- final bool remoteConfig;
-
- Future get accessor async {
- if (remoteConfig &&
- (await RemoteConfig.instance).useBottomSheetForProfileOptions()) {
- return AccessedVia.bottomSheet;
- }
- return accessor_;
- }
-
- Iterable get children =>
- Screen.values.where((Screen screen) => screen.parent == this);
-
- Iterable get fabs => Screen.values.where((Screen screen) =>
- screen.parent == this && screen.accessor_ == AccessedVia.fab);
-
- Iterable get navTabs => Screen.values.where((Screen screen) =>
- screen.parent == this && screen.accessor_ == AccessedVia.navigator);
-
- String get route => (parent != null ? parent?.route : '')! + path;
-
- static Future> sheet(Screen? parent) async {
- List list = [];
- await Future.forEach(Screen.values, (Screen screen) async {
- if (screen.parent == parent &&
- (await screen.accessor) == AccessedVia.bottomSheet) {
- list.add(screen);
- }
- });
- return list;
- }
-
- static Future