diff --git a/README.md b/README.md index 877fb545..ec25f8a7 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,103 @@ -# Code-with-Google-Maps-2023 - Hack2skill +#### Team Name - Lone Tech Wolf +#### Problem Statement - “Individuals seeking to adopt a sustainable lifestyle often struggle due to the lack of a centralized platform for discovering eco-friendly resources and businesses. This, coupled with a general lack of awareness about sustainable choices, hinders their transition towards a greener lifestyle.” -Welcome to the official repository for the Code-with-Google-Maps-2023 organized by Hack2skill! +#### Team Leader Email - Tushar2010@outlook.com + +### A Brief of the Prototype: +The Sustainable Living Guide is a mobile application that uses Google Maps Platform to guide users towards a more sustainable lifestyle. It helps users discover sustainable businesses and resources in their city, such as recycling centers. It also has a community forum where people can talk about sustainability .It also has a feature named AI Support where user’s can discuss about sustainability with AI - the future of technology . The main goal of the app is to promote sustainability by increasing awareness about sustainable businesses and resources. By providing a platform for users to learn about sustainability and make more eco-friendly choices, the app contributes to environmental conservation and promotes a healthier lifestyle. -## Getting Started -To get started with the Code-with-Google-Maps-2023 repository, follow these steps: + +### Tech Stack: +Programming Language: Dart -### Submission Instruction: - 1. Fork this repository - 2. Create a folder with your Team Name - 3. Upload all the code and necessary files in the created folder - 4. Upload a **README.md** file in your folder with the below mentioned informations. - 5. Generate a Pull Request with your Team Name. (Example: submission-XYZ_team) +Framework: Flutter -### README.md must consist of the following information: +IDE: Visual Studio Code -#### Team Name - -#### Problem Statement - -#### Team Leader Email - + APIs and Libraries: -### A Brief of the Prototype: - This section must include UML Diagrams and prototype description + Google Maps API: Used to display maps and place markers on it. -### Tech Stack: - List Down all technologies used to Build the prototype - + Google Places API: Used to find nearby recycling centers. + + Geolocation API: Used to get the current location of the user. + + NewsAPI: Used to fetch news articles related to sustainability and eco-friendliness. + + OpenAI API: Used to interact with an AI model for chat support. + + supabase API : To interact with the global database . + + ### Step-by-Step Code Execution Instructions: - This Section must contain a set of instructions required to clone and run the prototype so that it can be tested and deeply analyzed + + + +1. **Clone the Repository**: Start by cloning the repository to your local machine. To do this, open your terminal or command prompt, navigate to the directory where you want to clone the repository and run: + + ```bash + git clone https://github.com/I-am-the-coder-Tusharbola/lone-tech-wolf.git + ``` + + +2. **Navigate to the Project Directory**: Once cloning is complete, navigate into the project directory: + + ```bash + cd sustainable-living-guide-app + ``` + + +3. **Get Flutter Packages**: The project depends on a set of Flutter packages defined in `pubspec.yaml`. To download these packages, run: + + ```bash + flutter pub get + ``` + +4. **Check Flutter Setup**: Before running the app, ensure that your Flutter setup is complete and there are no issues. Run this command to check: + + ```bash + flutter doctor + ``` + + This command checks your environment and displays a report to the terminal window. + +5. **Run the App in Debug Mode**: Now you're ready to run the app in debug mode. Start a debug session by running: + + ```bash + flutter run + ``` + + This command runs your application and attaches a debugger to it. + +6. **Build the App**: If you want to build a release version of your app, use the `flutter build apk` command: + + ```bash + flutter build apk + ``` + + This command generates an APK file in the `build/app/outputs/flutter-apk/` directory in your project. + + note --> You also have to change all the API keys . The google Map SDK for andriod is given in the ```andriodmainfest.xml``` file and the geolocation and places api are added in the ```welcome_screen.dart``` file present in the ``` lib folder ``` + + + + + + ### Future Scope: - Write about the scalability and futuristic aspects of the prototype developed +The Sustainable Living Guide app has a promising future scope given its focus on promoting sustainability and eco-friendly choices. Here are some potential scalability and futuristic aspects of the prototype: + +Expansion to More Cities: The app currently helps users discover recycling centres in user's city city. In the future, it could be expanded to include more cities, even globally and also display all the sustainable businesses. This would make the app useful to a larger audience and promote sustainability on a larger scale. + +Integration with Other Platforms: The app could be integrated with other platforms such as social media, e-commerce sites, and more. This would allow users to share their sustainable choices and inspire others to do the same. + +Advanced AI Support: The AI Support feature could be enhanced to provide more personalized recommendations and tips based on the user’s lifestyle and preferences. It could also be trained to answer more complex questions about sustainability. + +Gamification: To make the app more engaging, gamification elements could be introduced. For example, users could earn points for making sustainable choices, which could be redeemed for rewards. + +Partnerships: The app could partner with sustainable businesses to offer discounts or special offers to users. This would encourage users to make more sustainable choices and support businesses that are doing their part for the environment. + +Augmented Reality (AR) Features: In the future, AR technology could be incorporated into the app to provide users with an immersive experience. For example, users could see how a product is made or how much carbon footprint it has through AR. + diff --git a/sustainable-living-guide-app/.flutter-plugins b/sustainable-living-guide-app/.flutter-plugins new file mode 100644 index 00000000..b66f7e6c --- /dev/null +++ b/sustainable-living-guide-app/.flutter-plugins @@ -0,0 +1,35 @@ +# This is a generated file; do not edit or check into version control. +flutter_plugin_android_lifecycle=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\flutter_plugin_android_lifecycle-2.0.16\\ +geolocator=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\geolocator-10.1.0\\ +geolocator_android=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\geolocator_android-4.3.1\\ +geolocator_apple=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\geolocator_apple-2.3.2\\ +geolocator_web=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\geolocator_web-2.2.0\\ +geolocator_windows=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\geolocator_windows-0.2.1\\ +google_api_headers=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\google_api_headers-2.0.3\\ +google_maps_flutter=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\google_maps_flutter-2.5.0\\ +google_maps_flutter_android=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\google_maps_flutter_android-2.5.1\\ +google_maps_flutter_ios=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\google_maps_flutter_ios-2.3.2\\ +google_maps_flutter_web=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\google_maps_flutter_web-0.5.4+2\\ +package_info_plus=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\package_info_plus-4.2.0\\ +path_provider=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider-2.1.1\\ +path_provider_android=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.1\\ +path_provider_foundation=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_foundation-2.3.1\\ +path_provider_linux=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_linux-2.2.1\\ +path_provider_windows=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.2.1\\ +permission_handler=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler-11.0.1\\ +permission_handler_android=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_android-11.1.0\\ +permission_handler_apple=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_apple-9.1.4\\ +permission_handler_windows=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_windows-0.1.3\\ +shared_preferences=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences-2.2.2\\ +shared_preferences_android=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_android-2.2.1\\ +shared_preferences_foundation=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_foundation-2.3.4\\ +shared_preferences_linux=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_linux-2.3.2\\ +shared_preferences_web=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_web-2.2.1\\ +shared_preferences_windows=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_windows-2.3.2\\ +url_launcher=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher-6.1.14\\ +url_launcher_android=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_android-6.2.0\\ +url_launcher_ios=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_ios-6.2.0\\ +url_launcher_linux=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_linux-3.1.0\\ +url_launcher_macos=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_macos-3.1.0\\ +url_launcher_web=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_web-2.2.0\\ +url_launcher_windows=C:\\Users\\Tushar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_windows-3.1.0\\ diff --git a/sustainable-living-guide-app/.flutter-plugins-dependencies b/sustainable-living-guide-app/.flutter-plugins-dependencies new file mode 100644 index 00000000..5c5ca791 --- /dev/null +++ b/sustainable-living-guide-app/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"geolocator_apple","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\geolocator_apple-2.3.2\\\\","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_ios","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\google_maps_flutter_ios-2.3.2\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.2.0\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.3.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.1.4\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.3.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_ios-6.2.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_plugin_android_lifecycle-2.0.16\\\\","native_build":true,"dependencies":[]},{"name":"geolocator_android","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\geolocator_android-4.3.1\\\\","native_build":true,"dependencies":[]},{"name":"google_api_headers","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\google_api_headers-2.0.3\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"google_maps_flutter_android","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\google_maps_flutter_android-2.5.1\\\\","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info_plus","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.2.0\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.1\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-11.1.0\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.2.1\\\\","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_android-6.2.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"geolocator_apple","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\geolocator_apple-2.3.2\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.2.0\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.3.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.3.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_macos-3.1.0\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.2.0\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.3.2\\\\","native_build":false,"dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_linux-3.1.0\\\\","native_build":true,"dependencies":[]}],"windows":[{"name":"geolocator_windows","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\geolocator_windows-0.2.1\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.2.0\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.1.3\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.3.2\\\\","native_build":false,"dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_windows-3.1.0\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"geolocator_web","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\geolocator_web-2.2.0\\\\","dependencies":[]},{"name":"google_maps_flutter_web","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\google_maps_flutter_web-0.5.4+2\\\\","dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.2.0\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.2.1\\\\","dependencies":[]},{"name":"url_launcher_web","path":"C:\\\\Users\\\\Tushar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_web-2.2.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"geolocator","dependencies":["geolocator_android","geolocator_apple","geolocator_web","geolocator_windows"]},{"name":"geolocator_android","dependencies":[]},{"name":"geolocator_apple","dependencies":[]},{"name":"geolocator_web","dependencies":[]},{"name":"geolocator_windows","dependencies":[]},{"name":"google_api_headers","dependencies":["package_info_plus"]},{"name":"google_maps_flutter","dependencies":["google_maps_flutter_android","google_maps_flutter_ios","google_maps_flutter_web"]},{"name":"google_maps_flutter_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"google_maps_flutter_ios","dependencies":[]},{"name":"google_maps_flutter_web","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2023-10-29 21:45:45.393186","version":"3.16.0-0.3.pre"} \ No newline at end of file diff --git a/sustainable-living-guide-app/.gitignore b/sustainable-living-guide-app/.gitignore new file mode 100644 index 00000000..6503b5e5 --- /dev/null +++ b/sustainable-living-guide-app/.gitignore @@ -0,0 +1,43 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/sustainable-living-guide-app/.metadata b/sustainable-living-guide-app/.metadata new file mode 100644 index 00000000..147fa0b1 --- /dev/null +++ b/sustainable-living-guide-app/.metadata @@ -0,0 +1,45 @@ +# 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: "476aa717cd342d11e16439b71f4f4c9209c50712" + channel: "beta" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + - platform: android + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + - platform: ios + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + - platform: linux + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + - platform: macos + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + - platform: web + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + - platform: windows + create_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + base_revision: 476aa717cd342d11e16439b71f4f4c9209c50712 + + # 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/sustainable-living-guide-app/analysis_options.yaml b/sustainable-living-guide-app/analysis_options.yaml new file mode 100644 index 00000000..d4e0f0c8 --- /dev/null +++ b/sustainable-living-guide-app/analysis_options.yaml @@ -0,0 +1,28 @@ +# 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.dev/lints. + # + # 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/sustainable-living-guide-app/android/app/build.gradle b/sustainable-living-guide-app/android/app/build.gradle new file mode 100644 index 00000000..2fde79b4 --- /dev/null +++ b/sustainable-living-guide-app/android/app/build.gradle @@ -0,0 +1,71 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "com.example.sustainable_living_guide_app" + compileSdkVersion 33 + 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.sustainable_living_guide_app" + // 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 31 + 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 {} + + + + diff --git a/sustainable-living-guide-app/android/app/google-services.json b/sustainable-living-guide-app/android/app/google-services.json new file mode 100644 index 00000000..d5be1a8f --- /dev/null +++ b/sustainable-living-guide-app/android/app/google-services.json @@ -0,0 +1,30 @@ +{ + "project_info": { + "project_number": "827053880336", + "firebase_url": "https://community-forum-db-default-rtdb.firebaseio.com", + "project_id": "community-forum-db", + "storage_bucket": "community-forum-db.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:827053880336:android:9ce1e0bd7b71c486acc695", + "android_client_info": { + "package_name": "com.example.sustainable_living_guide_app" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCwjbs-n9EUOvKRpBi0-aDKAlyU3_2UEW0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/sustainable-living-guide-app/android/app/src/debug/AndroidManifest.xml b/sustainable-living-guide-app/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..8ffe0246 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/sustainable-living-guide-app/android/app/src/main/AndroidManifest.xml b/sustainable-living-guide-app/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..ad561db4 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sustainable-living-guide-app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/sustainable-living-guide-app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..e8286a67 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,64 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e); + } + try { + flutterEngine.getPlugins().add(new com.baseflow.geolocator.GeolocatorPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin geolocator_android, com.baseflow.geolocator.GeolocatorPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.github.zeshuaro.google_api_headers.GoogleApiHeadersPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin google_api_headers, io.github.zeshuaro.google_api_headers.GoogleApiHeadersPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.googlemaps.GoogleMapsPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin google_maps_flutter_android, io.flutter.plugins.googlemaps.GoogleMapsPlugin", e); + } + try { + flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin package_info_plus, dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); + } + try { + flutterEngine.getPlugins().add(new com.baseflow.permissionhandler.PermissionHandlerPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin permission_handler_android, com.baseflow.permissionhandler.PermissionHandlerPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e); + } + } +} diff --git a/sustainable-living-guide-app/android/app/src/main/kotlin/com/example/sustainable_living_guide_app/MainActivity.kt b/sustainable-living-guide-app/android/app/src/main/kotlin/com/example/sustainable_living_guide_app/MainActivity.kt new file mode 100644 index 00000000..93fa0023 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/kotlin/com/example/sustainable_living_guide_app/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.sustainable_living_guide_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/sustainable-living-guide-app/android/app/src/main/res/drawable-v21/launch_background.xml b/sustainable-living-guide-app/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..1cb7aa2f --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/sustainable-living-guide-app/android/app/src/main/res/drawable/launch_background.xml b/sustainable-living-guide-app/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..84037589 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/sustainable-living-guide-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/sustainable-living-guide-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/sustainable-living-guide-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/sustainable-living-guide-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/sustainable-living-guide-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/sustainable-living-guide-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/sustainable-living-guide-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/sustainable-living-guide-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/sustainable-living-guide-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/sustainable-living-guide-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/sustainable-living-guide-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/sustainable-living-guide-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/sustainable-living-guide-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/sustainable-living-guide-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/sustainable-living-guide-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/sustainable-living-guide-app/android/app/src/main/res/values-night/styles.xml b/sustainable-living-guide-app/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..360a1605 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/sustainable-living-guide-app/android/app/src/main/res/values/styles.xml b/sustainable-living-guide-app/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..5fac6796 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/sustainable-living-guide-app/android/app/src/profile/AndroidManifest.xml b/sustainable-living-guide-app/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..8ffe0246 --- /dev/null +++ b/sustainable-living-guide-app/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/sustainable-living-guide-app/android/build.gradle b/sustainable-living-guide-app/android/build.gradle new file mode 100644 index 00000000..7ff1933a --- /dev/null +++ b/sustainable-living-guide-app/android/build.gradle @@ -0,0 +1,30 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +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/sustainable-living-guide-app/android/gradle.properties b/sustainable-living-guide-app/android/gradle.properties new file mode 100644 index 00000000..13b12d1c --- /dev/null +++ b/sustainable-living-guide-app/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx4G +android.useAndroidX=true +android.enableJetifier=true + diff --git a/sustainable-living-guide-app/android/gradle/wrapper/gradle-wrapper.jar b/sustainable-living-guide-app/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..13372aef Binary files /dev/null and b/sustainable-living-guide-app/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/sustainable-living-guide-app/android/gradle/wrapper/gradle-wrapper.properties b/sustainable-living-guide-app/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..eabb85f5 --- /dev/null +++ b/sustainable-living-guide-app/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/sustainable-living-guide-app/android/gradlew b/sustainable-living-guide-app/android/gradlew new file mode 100644 index 00000000..9d82f789 --- /dev/null +++ b/sustainable-living-guide-app/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/sustainable-living-guide-app/android/gradlew.bat b/sustainable-living-guide-app/android/gradlew.bat new file mode 100644 index 00000000..aec99730 --- /dev/null +++ b/sustainable-living-guide-app/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/sustainable-living-guide-app/android/local.properties b/sustainable-living-guide-app/android/local.properties new file mode 100644 index 00000000..99241b19 --- /dev/null +++ b/sustainable-living-guide-app/android/local.properties @@ -0,0 +1,5 @@ +sdk.dir=C:\\Users\\Tushar\\AppData\\Local\\Android\\sdk +flutter.sdk=C:\\flutter +flutter.buildMode=release +flutter.versionName=1.0.0 +flutter.versionCode=1 \ No newline at end of file diff --git a/sustainable-living-guide-app/android/settings.gradle b/sustainable-living-guide-app/android/settings.gradle new file mode 100644 index 00000000..e646870a --- /dev/null +++ b/sustainable-living-guide-app/android/settings.gradle @@ -0,0 +1,29 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } + + plugins { + id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false +} + +include ":app" diff --git a/sustainable-living-guide-app/android/sustainable_living_guide_app_android.iml b/sustainable-living-guide-app/android/sustainable_living_guide_app_android.iml new file mode 100644 index 00000000..5e74ee6a --- /dev/null +++ b/sustainable-living-guide-app/android/sustainable_living_guide_app_android.iml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sustainable-living-guide-app/assets/images/logo.jpeg b/sustainable-living-guide-app/assets/images/logo.jpeg new file mode 100644 index 00000000..0b0c6f6d Binary files /dev/null and b/sustainable-living-guide-app/assets/images/logo.jpeg differ diff --git a/sustainable-living-guide-app/assets/quotes.txt b/sustainable-living-guide-app/assets/quotes.txt new file mode 100644 index 00000000..c6a310a9 --- /dev/null +++ b/sustainable-living-guide-app/assets/quotes.txt @@ -0,0 +1,23 @@ +"We do not inherit the earth from our ancestors, we borrow it from our children." - Native American Proverb +"What is the use of a house if you haven’t got a tolerable planet to put it on?" - Henry David Thoreau +"The greatest threat to our planet is the belief that someone else will save it." - Robert Swan +"Sustainability is no longer about doing less harm. It's about doing more good." - Jochen Zeitz +"The environment is where we all meet; where we all have a mutual interest; it is the one thing all of us share." - Lady Bird Johnson +"We are living on this planet as if we had another one to go to." - Terri Swearingen +"Sustainability takes forever. And that’s the point." - William McDonough +"Nature is not a place to visit. It is home." - Gary Snyder +"Conservation is a state of harmony between men and land." - Aldo Leopold +"Earth provides enough to satisfy every man's needs, but not every man's greed." - Mahatma Gandhi +"The future will either be green or not at all." - Bob Brown +"Sustainable development is the pathway to the future we want for all." - Ban Ki-moon +"We won't have a society if we destroy the environment." - Margaret Mead +"Planetary health and human health are one and the same." - Dr. Samuel Myers +"The Earth is what we all have in common." - Wendell Berry +"Buy less, choose well, make it last." - Vivienne Westwood +"Sustainability is about ecology, economy and equity." - Ralph Bicknese +"Man must feel the earth to know himself and recognize his values." - Charles Lindbergh +"We abuse land because we regard it as a commodity belonging to us. When we see land as a community to which we belong, we may begin to use it with love and respect." - Aldo Leopold +"Sustainability requires maintaining life-supporting natural capital in order for our socioeconomic goals to be met." - Warren Flint +"The more clearly we can focus our attention on the wonders and realities of the universe about us, the less taste we shall have for destruction." - Rachel Carson +"There is no such thing as 'away'. When we throw anything away it must go somewhere." - Annie Leonard +"Trees are the earth's endless effort to speak to the listening heaven." - Rabindranath Tagore diff --git a/sustainable-living-guide-app/lib/AI_support.dart b/sustainable-living-guide-app/lib/AI_support.dart new file mode 100644 index 00000000..53d015ce --- /dev/null +++ b/sustainable-living-guide-app/lib/AI_support.dart @@ -0,0 +1,115 @@ +// Importing necessary packages +import 'package:flutter/material.dart'; +import 'package:dart_openai/dart_openai.dart'; + +// Defining a stateful widget for the AI chat screen +class AIChatScreen extends StatefulWidget { + const AIChatScreen({Key? key}) : super(key: key); + + @override + _AIChatScreenState createState() => _AIChatScreenState(); +} + +// Defining the state for the AI chat screen +class _AIChatScreenState extends State { + // Initializing a text editing controller for the input field + final TextEditingController _controller = TextEditingController(); + + // Initializing a list to store the messages + final List _messages = []; + + // Function to handle the submission of a query + Future _submitQuery(String text) async { + // Setting the API key for OpenAI + OpenAI.apiKey = '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'; + + // Creating a completion with the OpenAI API + final completion = await OpenAI.instance.completion.create( + model: "text-davinci-003", + prompt: text, + maxTokens: 200, + stop: '/n', + ); + + // Updating the state with the new messages + setState(() { + _messages.insert( + 0, Message(text: 'AI: ${completion.choices[0].text}', type: 'ai')); + _messages.insert(0, Message(text: 'User: $text', type: 'user')); + }); + + // Clearing the input field + _controller.clear(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: const Text('AI Support'), + centerTitle: true, + ), + body: Column( + children: [ + Flexible( + child: ListView.builder( + padding: const EdgeInsets.all(8.0), + reverse: false, + itemBuilder: (_, int index) => _messages[index], + itemCount: _messages.length, + ), + ), + const Divider(height: 1.0), + Container( + decoration: BoxDecoration(color: Theme.of(context).cardColor), + child: IconTheme( + data: + IconThemeData(color: Theme.of(context).colorScheme.secondary), + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Flexible( + child: TextField( + controller: _controller, + onSubmitted: _submitQuery, + decoration: const InputDecoration.collapsed( + hintText: "Send a message"), + ), + ), + Container( + margin: const EdgeInsets.symmetric(horizontal: 4.0), + child: IconButton( + icon: const Icon(Icons.send), + onPressed: () => _submitQuery(_controller.text)), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + +// Defining a stateless widget for a message +class Message extends StatelessWidget { + const Message({this.text, this.type}); + + final String? text; + final String? type; + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0), + child: type == 'ai' + ? Text(text!, + style: const TextStyle(color: Colors.blue, fontSize: 14)) + : Text(text!, style: const TextStyle(fontSize: 14)), + ); + } +} diff --git a/sustainable-living-guide-app/lib/community_forum_screen.dart b/sustainable-living-guide-app/lib/community_forum_screen.dart new file mode 100644 index 00000000..28c65175 --- /dev/null +++ b/sustainable-living-guide-app/lib/community_forum_screen.dart @@ -0,0 +1,170 @@ +// Importing necessary packages +import 'dart:async'; +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:supabase/supabase.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:permission_handler/permission_handler.dart'; + +// Defining a stateful widget for the community forum screen +class CommunityForumScreen extends StatefulWidget { + @override + _CommunityForumScreenState createState() => _CommunityForumScreenState(); +} + +// Defining the state for the community forum screen +class _CommunityForumScreenState extends State { + // Initializing a Supabase client with the URL and API key + final client = SupabaseClient('https://poqhuqdfdnygffdamvhv.supabase.co', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBvcWh1cWRmZG55Z2ZmZGFtdmh2Iiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5ODU2MzE2OCwiZXhwIjoyMDE0MTM5MTY4fQ.mLsveckdJ7eAlWz3UTXjBLj2zr87BhbmW5sYwWDccpU'); + String? userName; + + @override + void initState() { + super.initState(); + getUserName(); // Fetching the username when the widget is initialized + } + + // Function to get the username from a local file + Future getUserName() async { + final status = await Permission.storage.request(); + if (status.isGranted) { + final directory = await getApplicationDocumentsDirectory(); + final file = File('${directory.path}/user_name.txt'); + userName = await file.readAsString(); // Reading the file here + setState(() {}); // Then updating the state here + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Community Forum'), + ), + body: userName == null + ? Center( + child: + CircularProgressIndicator()) // Showing a progress indicator while fetching the username + : Column( + children: [ + Expanded( + child: MessagesView(client, + userName!)), // Displaying the messages view here + MessageInput(client, + userName!), // Displaying the message input field here + ], + ), + ); + } +} + +// Defining a stateful widget for the messages view +class MessagesView extends StatefulWidget { + final SupabaseClient client; + final String userName; + + MessagesView(this.client, this.userName); + + @override + _MessagesViewState createState() => _MessagesViewState(); +} + +// Defining the state for the messages view +class _MessagesViewState extends State { + final messages = + >[]; // Initializing a list to store the messages + Timer? _timer; // Initializing a timer to fetch messages periodically + + @override + void initState() { + super.initState(); + _timer = Timer.periodic( + Duration(seconds: 2), + (timer) => + fetchMessages()); // Fetching messages every 2 seconds when the widget is initialized + } + + @override + void dispose() { + _timer?.cancel(); // Canceling the timer when disposing of the widget + super.dispose(); + } + + // Function to fetch messages from a Supabase table named 'messages' + fetchMessages() async { + final response = await widget.client.from('messages').select().execute(); + if (response.status == 200 && response.data != null) { + setState(() { + messages.clear(); // Clearing old messages here + for (var item in response.data) { + if (item is Map) { + messages.insert(0, + item); // Inserting new messages at the beginning of the list here + } + } + }); + } else { + // Removed print statement. You can handle the error here by showing it in the UI. + } + } + + @override + Widget build(BuildContext context) { + return ListView.builder( + itemCount: messages.length, + itemBuilder: (context, index) { + final message = messages[index]; + return ListTile( + title: Text('${message['text']}'), + subtitle: Text('${message['timestamp']}'), + ); + }, + ); + } +} + +// Defining a stateful widget for message input field +class MessageInput extends StatefulWidget { + final SupabaseClient client; + final String userName; + + MessageInput(this.client, this.userName); + + @override + _MessageInputState createState() => _MessageInputState(); +} + +// Defining the state for the message input field +class _MessageInputState extends State { + final controller = + TextEditingController(); // Initializing a text editing controller for the input field + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(8), + child: Row( + children: [ + Expanded( + child: TextField( + controller: controller, + decoration: InputDecoration(hintText: 'Enter message'), + ), + ), + IconButton( + icon: Icon(Icons.send), + onPressed: () async { + await widget.client.from('messages').insert({ + 'text': '${widget.userName}: ${controller.text}', + 'timestamp': DateTime.now().toIso8601String() + }); + controller + .clear(); // Clearing the input field after sending a message + }, + ), + ], + ), + ); + } +} diff --git a/sustainable-living-guide-app/lib/loading_screen.dart b/sustainable-living-guide-app/lib/loading_screen.dart new file mode 100644 index 00000000..4722e698 --- /dev/null +++ b/sustainable-living-guide-app/lib/loading_screen.dart @@ -0,0 +1,67 @@ +// Importing necessary packages +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'dart:math'; +import 'welcome_screen.dart'; + +// Defining a stateful widget for the loading screen +class LoadingScreen extends StatefulWidget { + @override + _LoadingScreenState createState() => _LoadingScreenState(); +} + +// Defining the state for the loading screen +class _LoadingScreenState extends State { + String _quote = ''; // Initializing a string to store the quote + + @override + void initState() { + super.initState(); + loadQuote().then((value) { + // Loading a quote when the widget is initialized + setState(() { + _quote = value; // Then updating the state with the loaded quote here + }); + }); + Future.delayed(Duration(seconds: 10), () { + // Navigating to the welcome screen after 10 seconds + Navigator.pushReplacement( + context, MaterialPageRoute(builder: (context) => WelcomeScreen())); + }); + } + + // Function to load a random quote from a text file + Future loadQuote() async { + String text = await rootBundle.loadString( + 'assets/quotes.txt'); // Loading the quotes from a text file here + List quotes = + text.split('\n'); // Splitting the text into individual quotes here + return quotes[ + Random().nextInt(quotes.length)]; // Returning a random quote here + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Center( + child: Container( + height: 200.0, + child: Image.asset( + 'assets/images/logo.jpeg'), // Displaying the logo here + ), + ), + ), + Text(_quote), // Displaying the quote here + + CircularProgressIndicator(), // Displaying a progress indicator here + + SizedBox(height: 20.0), + ], + ), + ); + } +} diff --git a/sustainable-living-guide-app/lib/main.dart b/sustainable-living-guide-app/lib/main.dart new file mode 100644 index 00000000..c49bbe2f --- /dev/null +++ b/sustainable-living-guide-app/lib/main.dart @@ -0,0 +1,23 @@ +// Importing necessary packages +import 'package:flutter/material.dart'; +import 'loading_screen.dart'; + +void main() { + runApp(MyApp()); // Running the app here +} + +// Defining a stateless widget for the app +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Sustainable Living Guide', // Setting the title of the app here + theme: ThemeData( + primarySwatch: + Colors.green, // Setting the primary color of the app theme here + ), + home: + LoadingScreen(), // Setting the loading screen as the home screen of the app here + ); + } +} diff --git a/sustainable-living-guide-app/lib/profile_screen.dart b/sustainable-living-guide-app/lib/profile_screen.dart new file mode 100644 index 00000000..72ebf836 --- /dev/null +++ b/sustainable-living-guide-app/lib/profile_screen.dart @@ -0,0 +1,53 @@ +// Importing necessary packages +import 'package:flutter/material.dart'; +import 'package:path_provider/path_provider.dart'; +import 'dart:io'; + +// Defining a stateful widget for the profile screen +class ProfileScreen extends StatefulWidget { + @override + _ProfileScreenState createState() => _ProfileScreenState(); +} + +// Defining the state for the profile screen +class _ProfileScreenState extends State { + String userName = ''; // Initializing a string to store the username + + @override + void initState() { + super.initState(); + _getUserName(); // Fetching the username when the widget is initialized + } + + // Function to get the username from a local file + Future _getUserName() async { + final directory = await getApplicationDocumentsDirectory(); + final file = File('${directory.path}/user_name.txt'); + bool fileExists = await file.exists(); + + if (fileExists) { + String name = await file.readAsString(); // Reading the file here + setState(() { + userName = name; // Then updating the state with the read username here + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('Profile')), + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Spacer(flex: 2), + Center( + child: Text('Welcome, $userName!', + style: TextStyle( + fontSize: 24))), // Displaying the user's name here + Spacer(flex: 3), + ], + ), + ); + } +} diff --git a/sustainable-living-guide-app/lib/sustainable_news_screen.dart b/sustainable-living-guide-app/lib/sustainable_news_screen.dart new file mode 100644 index 00000000..2d502704 --- /dev/null +++ b/sustainable-living-guide-app/lib/sustainable_news_screen.dart @@ -0,0 +1,57 @@ +// Importing necessary packages +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'dart:convert'; +import 'package:url_launcher/url_launcher.dart'; + +// Defining a stateless widget for the sustainable news screen +class SustainableNewsScreen extends StatelessWidget { + // Function to fetch news titles from NewsAPI + Future>> fetchNewsTitles() async { + final response = await http.get(Uri.parse( + 'https://newsapi.org/v2/everything?q=sustainability and eco-friendly&pageSize=20&apiKey=10b5286403674703a25c480489227484')); + + if (response.statusCode == 200) { + var jsonResponse = jsonDecode(response.body); + return List>.from(jsonResponse['articles']); + } else { + throw Exception('Failed to load news'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Sustainable News'), + leading: IconButton( + icon: Icon(Icons.arrow_back), + onPressed: () => Navigator.pop(context), + ), + ), + body: FutureBuilder>>( + future: fetchNewsTitles(), + builder: (BuildContext context, + AsyncSnapshot>> snapshot) { + if (snapshot.hasData) { + return Scrollbar( + child: ListView.builder( + itemCount: snapshot.data?.length ?? 0, + itemBuilder: (BuildContext context, int index) { + return ListTile( + title: Text(snapshot.data?[index]['title'] ?? ''), + onTap: () => launch(snapshot.data?[index]['url'] ?? ''), + ); + }, + ), + ); + } else if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else { + return CircularProgressIndicator(); + } + }, + ), + ); + } +} diff --git a/sustainable-living-guide-app/lib/user_name.txt b/sustainable-living-guide-app/lib/user_name.txt new file mode 100644 index 00000000..e69de29b diff --git a/sustainable-living-guide-app/lib/welcome_screen.dart b/sustainable-living-guide-app/lib/welcome_screen.dart new file mode 100644 index 00000000..80a789d6 --- /dev/null +++ b/sustainable-living-guide-app/lib/welcome_screen.dart @@ -0,0 +1,252 @@ +// Importing necessary packages +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:http/http.dart' as http; +import 'dart:convert'; +import 'package:path_provider/path_provider.dart'; +import 'dart:io'; +import 'AI_support.dart'; +import 'community_forum_screen.dart'; +import 'sustainable_news_screen.dart'; +import 'profile_screen.dart'; + +// Defining a stateful widget for the welcome screen +class WelcomeScreen extends StatefulWidget { + const WelcomeScreen({super.key}); + + @override + _WelcomeScreenState createState() => _WelcomeScreenState(); +} + +// Defining the state for the welcome screen +class _WelcomeScreenState extends State { + // Initializing variables for current position, Google Map controller, username and markers set. + late Position _currentPosition; + late GoogleMapController mapController; + String userName = ''; + final Set _markers = {}; + + @override + void initState() { + super.initState(); + // Requesting permission, getting current location and asking user name when widget is initialized + _requestPermission().then((_) { + _getCurrentLocation(); + }); + _askUserName(); + } + + // Function to request location permission from the user + _requestPermission() async { + PermissionStatus status = await Permission.location.request(); + if (status.isDenied) {} + } + + // Function to get the current location of the user + _getCurrentLocation() async { + Position position = await Geolocator.getCurrentPosition( + desiredAccuracy: LocationAccuracy.best); + + final response = await http.post( + Uri.parse( + 'https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyCFRmmWXEvFZSTsIt9j398LXuO5LSOiOnA'), + body: jsonEncode({ + 'considerIp': true, + }), + headers: {'Content-Type': 'application/json'}, + ); + + if (response.statusCode == 200) { + Map responseBody = jsonDecode(response.body); + position = Position( + latitude: responseBody['location']['lat'], + longitude: responseBody['location']['lng'], + timestamp: DateTime.now(), + accuracy: position.accuracy, + altitude: position.altitude, + heading: position.heading, + speed: position.speed, + speedAccuracy: position.speedAccuracy, + altitudeAccuracy: position.altitudeAccuracy, + headingAccuracy: position.headingAccuracy, + ); + } + + setState(() { + _currentPosition = position; + _markers.add(Marker( + markerId: const MarkerId('userLocation'), + position: LatLng(_currentPosition.latitude, _currentPosition.longitude), + infoWindow: const InfoWindow(title: "Your Location"), + )); + }); + + // Call the method to get nearby recycling centres + _getNearbyRecyclingCentres(); + } + + // Function to get nearby recycling centres from Google Places API + void _getNearbyRecyclingCentres() async { + final response = await http.get( + Uri.parse( + 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${_currentPosition.latitude},${_currentPosition.longitude}&radius=5000&type=recycling&key=AIzaSyD6otfJJukGu2r5lC38F4FQCyAU2rp5s5s', + ), + ); + + if (response.statusCode == 200) { + Map responseBody = jsonDecode(response.body); + List results = responseBody['results']; + + for (var result in results) { + double lat = result['geometry']['location']['lat']; + double lng = result['geometry']['location']['lng']; + + setState(() { + _markers.add(Marker( + markerId: MarkerId(result['id']), + position: LatLng(lat, lng), + icon: + BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueBlue), + infoWindow: InfoWindow(title: result['name']), + )); + }); + } + } + } + + // Function to handle map creation + void _onMapCreated(GoogleMapController controller) { + mapController = controller; + } + + // Function to animate camera to go to current location of the user + void _goToCurrentLocation() async { + mapController.animateCamera(CameraUpdate.newCameraPosition(CameraPosition( + target: LatLng(_currentPosition.latitude, _currentPosition.longitude), + zoom: 14.0, + ))); + } + + // Function to ask user name from a dialog box and save it in a local file + void _askUserName() async { + final directory = await getApplicationDocumentsDirectory(); + final file = File('${directory.path}/user_name.txt'); + bool fileExists = await file.exists(); + + if (fileExists && await file.readAsString() != '') { + userName = await file.readAsString(); + } else { + await showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Enter your name'), + content: TextField( + onChanged: (value) { + userName = value; + }, + decoration: + const InputDecoration(hintText: "Enter your name here"), + ), + actions: [ + TextButton( + onPressed: () async { + Navigator.pop(context, 'OK'); + await file.writeAsString(userName); + }, + child: const Text('OK'), + ), + ], + ); + }, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + leading: Builder( + builder: (BuildContext context) { + return IconButton( + icon: const Icon(Icons.menu), + onPressed: () { + Scaffold.of(context).openDrawer(); + }, + ); + }, + ), + ), + drawer: Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + const DrawerHeader( + decoration: BoxDecoration( + color: Colors.green, + ), + child: Text('Sustainable Living Guide'), + ), + ListTile( + leading: const Icon(Icons.assignment), + title: const Text('Community Forum'), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CommunityForumScreen())); + }, + ), + ListTile( + leading: const Icon(Icons.person), + title: const Text('Profile'), + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => ProfileScreen())); + }, + ), + ListTile( + leading: const Icon(Icons.article), + title: const Text('Sustainable News'), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SustainableNewsScreen())); + }, + ), + ListTile( + leading: const Icon(Icons.computer), + title: const Text('AI Support'), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const AIChatScreen())); + }, + ), + ], + ), + ), + body: Stack(children: [ + GoogleMap( + initialCameraPosition: CameraPosition( + target: + LatLng(_currentPosition.latitude, _currentPosition.longitude), + zoom: 10), + markers: _markers, + onMapCreated: _onMapCreated, + ), + Positioned( + bottom: 10.0, + right: 10.0, + child: FloatingActionButton( + onPressed: _goToCurrentLocation, + child: const Icon(Icons.my_location))) + ]), + ); + } +} diff --git a/sustainable-living-guide-app/pubspec.lock b/sustainable-living-guide-app/pubspec.lock new file mode 100644 index 00000000..7e3852d8 --- /dev/null +++ b/sustainable-living-guide-app/pubspec.lock @@ -0,0 +1,794 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + dart_openai: + dependency: "direct main" + description: + name: dart_openai + sha256: "707f6975454513f4a6197125b5a0fbe92ab7cbe4b8ea9111e529a09d7a3ce0c3" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + fetch_api: + dependency: transitive + description: + name: fetch_api + sha256: b88977a8f369344cbaa13a53752629185ecae0d56c6683f0a2060b652a0cf437 + url: "https://pub.dev" + source: hosted + version: "1.0.2" + fetch_client: + dependency: transitive + description: + name: fetch_client + sha256: "83c07b07a63526a43630572c72715707ca113a8aa3459efbc7b2d366b79402af" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + ffi: + dependency: transitive + description: + name: ffi + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.dev" + source: hosted + version: "2.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: f185ac890306b5779ecbd611f52502d8d4d63d27703ef73161ca0407e815f02c + url: "https://pub.dev" + source: hosted + version: "2.0.16" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + functions_client: + dependency: transitive + description: + name: functions_client + sha256: "3b157b4d3ae9e38614fd80fab76d1ef1e0e39ff3412a45de2651f27cecb9d2d2" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: e946395fc608842bb2f6c914807e9183f86f3cb787f6b8f832753e5251036f02 + url: "https://pub.dev" + source: hosted + version: "10.1.0" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: "93906636752ea4d4e778afa981fdfe7409f545b3147046300df194330044d349" + url: "https://pub.dev" + source: hosted + version: "4.3.1" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: ab90ae811c42ec2f6021e01eca71df00dee6ff1e69d2c2dafd4daeb0b793f73d + url: "https://pub.dev" + source: hosted + version: "2.3.2" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: b7aca62aa05d7e610c396a53a1936ff87fce2f735d76e93fde9269c341c46a25 + url: "https://pub.dev" + source: hosted + version: "4.1.1" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: "59083f7e0871b78299918d92bf930a14377f711d2d1156c558cd5ebae6c20d58" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "8725beaa00db2b52f53d9811584cb4488240b250b04a09763e80945017f65c9c" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + google_api_headers: + dependency: "direct main" + description: + name: google_api_headers + sha256: "59ebb30d12fea5a77525b8e66cf3cec9593a9433dc0f0168497ebca1d3142311" + url: "https://pub.dev" + source: hosted + version: "2.0.3" + google_maps: + dependency: transitive + description: + name: google_maps + sha256: "555d5d736339b0478e821167ac521c810d7b51c3b2734e6802a9f046b64ea37a" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + google_maps_flutter: + dependency: "direct main" + description: + name: google_maps_flutter + sha256: d4914cb38b3dcb62c39c085d968d434de0f8050f00f4d9f5ba4a7c7e004934cb + url: "https://pub.dev" + source: hosted + version: "2.5.0" + google_maps_flutter_android: + dependency: transitive + description: + name: google_maps_flutter_android + sha256: e6cb018169e49332f88d23b1d2119b09e8ab4e7d3a1b889a1b7b3fd113e034ba + url: "https://pub.dev" + source: hosted + version: "2.5.1" + google_maps_flutter_ios: + dependency: transitive + description: + name: google_maps_flutter_ios + sha256: "2aa28eb9b9d5dfdce6932a7b7f096430bf83a1a09b4e21e81939351f407c787f" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + google_maps_flutter_platform_interface: + dependency: transitive + description: + name: google_maps_flutter_platform_interface + sha256: a3e9e6896501e566d902c6c69f010834d410ef4b7b5c18b90c77e871c86b7907 + url: "https://pub.dev" + source: hosted + version: "2.4.1" + google_maps_flutter_web: + dependency: transitive + description: + name: google_maps_flutter_web + sha256: f893d1542c6562bc8299ef768fbbe92ade83c220ab3209b9477ec9f81ad585e4 + url: "https://pub.dev" + source: hosted + version: "0.5.4+2" + google_maps_webservice: + dependency: "direct main" + description: + name: google_maps_webservice + sha256: d0ae4e4508afd74a3f051565261a3cdbae59db29448f9b6e6beb5674545e1eb7 + url: "https://pub.dev" + source: hosted + version: "0.0.20-nullsafety.5" + gotrue: + dependency: transitive + description: + name: gotrue + sha256: c0ceef26726c6a280e835c073af50f1bea9cf1d5f57fdf309c1921ce6b6bee54 + url: "https://pub.dev" + source: hosted + version: "1.12.5" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + js_wrapping: + dependency: transitive + description: + name: js_wrapping + sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c + url: "https://pub.dev" + source: hosted + version: "0.7.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + jwt_decode: + dependency: transitive + description: + name: jwt_decode + sha256: d2e9f68c052b2225130977429d30f187aa1981d789c76ad104a32243cfdebfbb + url: "https://pub.dev" + source: hosted + version: "0.3.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" + source: hosted + version: "0.12.16" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + meta: + dependency: transitive + description: + name: meta + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" + source: hosted + version: "1.10.0" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + url: "https://pub.dev" + source: hosted + version: "4.2.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8" + url: "https://pub.dev" + source: hosted + version: "11.0.1" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: f9fddd3b46109bd69ff3f9efa5006d2d309b7aec0f3c1c5637a60a2d5659e76e + url: "https://pub.dev" + source: hosted + version: "11.1.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" + url: "https://pub.dev" + source: hosted + version: "9.1.4" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4" + url: "https://pub.dev" + source: hosted + version: "3.12.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 + url: "https://pub.dev" + source: hosted + version: "0.1.3" + platform: + dependency: transitive + description: + name: platform + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + url: "https://pub.dev" + source: hosted + version: "2.1.6" + postgrest: + dependency: transitive + description: + name: postgrest + sha256: f190eddc5779842dfa529fa239ec4b1025f6f968c18052ba6fffc0aecac93e6b + url: "https://pub.dev" + source: hosted + version: "1.5.2" + realtime_client: + dependency: transitive + description: + name: realtime_client + sha256: "2027358cdbe65d5f1770c3f768aa9adecd394de486c5dbbd2cfe19d5c6dbbc4a" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + rxdart: + dependency: "direct overridden" + description: + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" + source: hosted + version: "0.27.7" + sanitize_html: + dependency: transitive + description: + name: sanitize_html + sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" + url: "https://pub.dev" + source: hosted + version: "2.3.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a + url: "https://pub.dev" + source: hosted + version: "2.3.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf + url: "https://pub.dev" + source: hosted + version: "2.2.1" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + storage_client: + dependency: transitive + description: + name: storage_client + sha256: f02d4d8967bec77767dcaf9daf24ca5b8d5a9f1cc093f14dffb77930b52589a3 + url: "https://pub.dev" + source: hosted + version: "1.5.4" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + supabase: + dependency: "direct main" + description: + name: supabase + sha256: "4484c436cc14f78ef64bab1fe9fdaa672a02dd73c0c5f8fe66691c3fd0aa6d58" + url: "https://pub.dev" + source: hosted + version: "1.11.10" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" + source: hosted + version: "0.6.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" + url: "https://pub.dev" + source: hosted + version: "6.1.14" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: "14f1f70c51119012600c5f1f60ca68efda5a9b6077748163c6af2893ec5df8fc" + url: "https://pub.dev" + source: hosted + version: "0.2.1-beta" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + win32: + dependency: transitive + description: + name: win32 + sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" + url: "https://pub.dev" + source: hosted + version: "5.0.9" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + yet_another_json_isolate: + dependency: transitive + description: + name: yet_another_json_isolate + sha256: "86fad76026c4241a32831d6c7febd8f9bded5019e2cd36c5b148499808d8307d" + url: "https://pub.dev" + source: hosted + version: "1.1.1" +sdks: + dart: ">=3.2.0-210.3.beta <4.0.0" + flutter: ">=3.13.0" diff --git a/sustainable-living-guide-app/pubspec.yaml b/sustainable-living-guide-app/pubspec.yaml new file mode 100644 index 00000000..e14df788 --- /dev/null +++ b/sustainable-living-guide-app/pubspec.yaml @@ -0,0 +1,46 @@ +name: sustainable_living_guide +description: "A new Flutter project." +publish_to: 'none' + +version: 1.0.0+1 + +environment: + sdk: '>=3.2.0-210.3.beta <4.0.0' + +dependencies: + flutter: + sdk: flutter + google_maps_flutter: ^2.5.0 + geolocator: ^10.1.0 + permission_handler: ^11.0.1 + http: ^1.1.0 + shared_preferences: ^2.2.2 + url_launcher: ^6.1.14 + path_provider: ^2.1.1 + + google_maps_webservice: ^0.0.19 + google_api_headers: ^2.0.3 + dart_openai: ^4.0.0 + supabase: ^1.11.10 + + + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 + +flutter: + uses-material-design: true + assets: + - assets/images/logo.jpeg + - assets/quotes.txt + +dependency_overrides: + http: ^0.13.1 + google_api_headers: ^2.0.3 + rxdart: ^0.27.4 + + + + diff --git a/sustainable-living-guide-app/sustainable_living_guide_app.iml b/sustainable-living-guide-app/sustainable_living_guide_app.iml new file mode 100644 index 00000000..4a179b7d --- /dev/null +++ b/sustainable-living-guide-app/sustainable_living_guide_app.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/sustainable-living-guide-app/test/widget_test.dart b/sustainable-living-guide-app/test/widget_test.dart new file mode 100644 index 00000000..6b5337eb --- /dev/null +++ b/sustainable-living-guide-app/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:sustainable_living_guide_app/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}