├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ ├── LaunchImage.imageset
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ ├── README.md
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── firebase_app_id_file.json
└── .gitignore
├── lib
├── globals.dart
├── screens
│ ├── chat
│ │ ├── chat_dao.dart
│ │ ├── message.dart
│ │ ├── message_dao.dart
│ │ ├── chats.dart
│ │ └── chat_room.dart
│ ├── patient
│ │ ├── appointments.dart
│ │ ├── main_page_patient.dart
│ │ └── doctor_list.dart
│ ├── doctor_or_patient.dart
│ ├── setting.dart
│ ├── doctor
│ │ └── main_page_doctor.dart
│ ├── skip.dart
│ ├── disease.dart
│ ├── firebase_auth.dart
│ ├── explore_list.dart
│ └── diseasedetail.dart
├── services
│ └── chat_methods.dart
├── model
│ ├── banner_model.dart
│ ├── card_model.dart
│ └── update_user_details.dart
├── splash_screen.dart
├── firestore_data
│ ├── notification_list.dart
│ ├── user_details.dart
│ ├── appointment_history_list.dart
│ ├── top_rated_list.dart
│ ├── search_list.dart
│ └── appointment_list.dart
├── helperFunction
│ └── sharedpref_helper.dart
├── main.dart
├── firebase_options.dart
└── carousel_slider.dart
├── assets
├── 414.jpg
├── doc.png
├── 19834.jpg
├── 19835.jpg
├── 414-bg.png
├── covid.jpg
├── disease.png
├── person.jpg
├── poster2.png
├── search.jpg
├── virus.jpg
├── 19834-bg.png
├── covid-bg.png
├── error-404.jpg
├── search-bg.png
├── appointment.jpg
├── icon
│ └── appicon.png
├── medical-red.png
├── vector-doc.jpg
├── vector-doc2.jpg
├── image-medical.jpg
├── Medic.ly_poster1.png
├── image-medical-2.jpg
├── image-medical-3.jpg
├── fonts
│ └── MyFlutterApp.ttf
├── personas-vector-set.jpg
└── doctor-consulting-with-patient-vector.webp
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── manifest.json
└── index.html
├── .vscode
└── settings.json
├── screenshots
├── auth.png
├── icon.png
├── history.png
├── profile.png
├── start.jpg
├── chatting.png
├── database.png
├── tech_used.png
├── patientAccount.png
├── bookedAppointment.png
└── appointmentBooking.png
├── android
├── gradle.properties
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values-night
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── health_app
│ │ │ │ │ └── MainActivity.kt
│ │ │ ├── java
│ │ │ │ └── io
│ │ │ │ │ └── flutter
│ │ │ │ │ └── app
│ │ │ │ │ └── FlutterMultiDexApplication.java
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── google-services.json
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
└── build.gradle
├── windows
├── runner
│ ├── resources
│ │ └── app_icon.ico
│ ├── resource.h
│ ├── utils.h
│ ├── runner.exe.manifest
│ ├── flutter_window.h
│ ├── CMakeLists.txt
│ ├── main.cpp
│ ├── utils.cpp
│ ├── flutter_window.cpp
│ ├── Runner.rc
│ ├── win32_window.h
│ └── win32_window.cpp
├── .gitignore
├── flutter
│ ├── generated_plugin_registrant.h
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugins.cmake
│ └── CMakeLists.txt
└── CMakeLists.txt
├── .gitignore
├── .metadata
├── analysis_options.yaml
├── README.md
└── pubspec.yaml
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/lib/globals.dart:
--------------------------------------------------------------------------------
1 | library globals;
2 | bool isDoctor = false;
3 |
4 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/assets/414.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/414.jpg
--------------------------------------------------------------------------------
/assets/doc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/doc.png
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/assets/19834.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/19834.jpg
--------------------------------------------------------------------------------
/assets/19835.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/19835.jpg
--------------------------------------------------------------------------------
/assets/414-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/414-bg.png
--------------------------------------------------------------------------------
/assets/covid.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/covid.jpg
--------------------------------------------------------------------------------
/assets/disease.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/disease.png
--------------------------------------------------------------------------------
/assets/person.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/person.jpg
--------------------------------------------------------------------------------
/assets/poster2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/poster2.png
--------------------------------------------------------------------------------
/assets/search.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/search.jpg
--------------------------------------------------------------------------------
/assets/virus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/virus.jpg
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "java.configuration.updateBuildConfiguration": "automatic",
3 | }
--------------------------------------------------------------------------------
/assets/19834-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/19834-bg.png
--------------------------------------------------------------------------------
/assets/covid-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/covid-bg.png
--------------------------------------------------------------------------------
/assets/error-404.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/error-404.jpg
--------------------------------------------------------------------------------
/assets/search-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/search-bg.png
--------------------------------------------------------------------------------
/screenshots/auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/auth.png
--------------------------------------------------------------------------------
/screenshots/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/icon.png
--------------------------------------------------------------------------------
/assets/appointment.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/appointment.jpg
--------------------------------------------------------------------------------
/assets/icon/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/icon/appicon.png
--------------------------------------------------------------------------------
/assets/medical-red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/medical-red.png
--------------------------------------------------------------------------------
/assets/vector-doc.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/vector-doc.jpg
--------------------------------------------------------------------------------
/assets/vector-doc2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/vector-doc2.jpg
--------------------------------------------------------------------------------
/screenshots/history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/history.png
--------------------------------------------------------------------------------
/screenshots/profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/profile.png
--------------------------------------------------------------------------------
/screenshots/start.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/start.jpg
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/assets/image-medical.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/image-medical.jpg
--------------------------------------------------------------------------------
/screenshots/chatting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/chatting.png
--------------------------------------------------------------------------------
/screenshots/database.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/database.png
--------------------------------------------------------------------------------
/screenshots/tech_used.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/tech_used.png
--------------------------------------------------------------------------------
/assets/Medic.ly_poster1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/Medic.ly_poster1.png
--------------------------------------------------------------------------------
/assets/image-medical-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/image-medical-2.jpg
--------------------------------------------------------------------------------
/assets/image-medical-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/image-medical-3.jpg
--------------------------------------------------------------------------------
/assets/fonts/MyFlutterApp.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/fonts/MyFlutterApp.ttf
--------------------------------------------------------------------------------
/assets/personas-vector-set.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/personas-vector-set.jpg
--------------------------------------------------------------------------------
/screenshots/patientAccount.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/patientAccount.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/screenshots/bookedAppointment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/bookedAppointment.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/screenshots/appointmentBooking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/screenshots/appointmentBooking.png
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/assets/doctor-consulting-with-patient-vector.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/assets/doctor-consulting-with-patient-vector.webp
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sailesh307/health_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/health_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.health_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/firebase_app_id_file.json:
--------------------------------------------------------------------------------
1 | {
2 | "file_generated_by": "FlutterFire CLI",
3 | "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
4 | "GOOGLE_APP_ID": "1:131647123287:ios:db03c51f647df00dd89812",
5 | "FIREBASE_PROJECT_ID": "health-app-99603",
6 | "GCM_SENDER_ID": "131647123287"
7 | }
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/lib/screens/chat/chat_dao.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_database/firebase_database.dart';
2 |
3 | class ChatDao {
4 | late DatabaseReference _chatRef;
5 | final String yourId;
6 | ChatDao(this.yourId) {
7 | _chatRef =
8 | FirebaseDatabase.instance.ref('users').child(yourId);
9 | }
10 |
11 | Query getChatQuery() {
12 | return _chatRef;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 |
11 | void RegisterPlugins(flutter::PluginRegistry* registry) {
12 | UrlLauncherWindowsRegisterWithRegistrar(
13 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
14 | }
15 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/screens/chat/message.dart:
--------------------------------------------------------------------------------
1 | class Message {
2 | final String senderId;
3 | final String message;
4 | final String time;
5 |
6 | Message({required this.senderId, required this.message, required this.time});
7 |
8 | Message.fromJson(Map json)
9 | : senderId = json['senderId'],
10 | message = json['message'],
11 | time = json['time'];
12 |
13 | Map toJson() => {
14 | 'senderId': senderId,
15 | 'message': message,
16 | 'time': time,
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/lib/services/chat_methods.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_database/firebase_database.dart';
2 | import 'package:health_app/helperFunction/sharedpref_helper.dart';
3 |
4 | class ChatMethods {
5 | Future addMessage({required String chatRoomId, required String message}) {
6 |
7 | // add message to real time database
8 | return FirebaseDatabase.instance.ref('chats').child(chatRoomId).child('chat').push().set({
9 | 'message': message,
10 | 'timestamp': DateTime.now().toUtc(),
11 | 'sender': SharedPreferenceHelper().getUserId(),
12 | });
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/model/banner_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class BannerModel {
4 | String text;
5 | List cardBackground;
6 | String image;
7 |
8 | BannerModel(this.text, this.cardBackground, this.image);
9 | }
10 |
11 | List bannerCards = [
12 | BannerModel(
13 | "Check Disease",
14 | [
15 | const Color(0xffa1d4ed),
16 | const Color(0xffc0eaff),
17 | ],
18 | "assets/414-bg.png"),
19 | BannerModel(
20 | "Covid-19",
21 | [
22 | const Color(0xffb6d4fa),
23 | const Color(0xffcfe3fc),
24 | ],
25 | "assets/covid-bg.png"),
26 | ];
27 |
--------------------------------------------------------------------------------
/lib/model/card_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:tabler_icons/tabler_icons.dart';
3 |
4 | class CardModel {
5 | String doctor;
6 | int cardBackground;
7 | var cardIcon;
8 |
9 | CardModel(this.doctor, this.cardBackground, this.cardIcon);
10 | }
11 |
12 | List cards = [
13 | CardModel("Cardiologist", 0xFFec407a, Icons.heart_broken),
14 | CardModel("Dentist", 0xFF5c6bc0, const IconData(0x1F9B7)),
15 | CardModel("Eye Special", 0xFFfbc02d, TablerIcons.eye),
16 | CardModel("Orthopaedic", 0xFF1565C0, Icons.wheelchair_pickup_sharp),
17 | CardModel("Paediatrician", 0xFF2E7D32, const IconData(0x1f476)),
18 | ];
19 |
--------------------------------------------------------------------------------
/lib/splash_screen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class SplashScreen extends StatefulWidget {
6 | const SplashScreen({Key? key}) : super(key: key);
7 |
8 | @override
9 | State createState() => _SplashScreenState();
10 | }
11 |
12 | class _SplashScreenState extends State {
13 | @override
14 | void initState() {
15 | super.initState();
16 | Timer(const Duration(seconds: 3), () {
17 | Navigator.of(context).pushReplacementNamed('/home');
18 | });
19 | }
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return const Scaffold(body: Text('hi'));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.1.2'
10 | classpath 'com.google.gms:google-services:4.3.10'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.buildDir = '../build'
23 | subprojects {
24 | project.buildDir = "${rootProject.buildDir}/${project.name}"
25 | }
26 | subprojects {
27 | project.evaluationDependsOn(':app')
28 | }
29 |
30 | task clean(type: Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java:
--------------------------------------------------------------------------------
1 | // Generated file.
2 | //
3 | // If you wish to remove Flutter's multidex support, delete this entire file.
4 | //
5 | // Modifications to this file should be done in a copy under a different name
6 | // as this file may be regenerated.
7 |
8 | package io.flutter.app;
9 |
10 | import android.app.Application;
11 | import android.content.Context;
12 | import androidx.annotation.CallSuper;
13 | import androidx.multidex.MultiDex;
14 |
15 | /**
16 | * Extension of {@link android.app.Application}, adding multidex support.
17 | */
18 | public class FlutterMultiDexApplication extends Application {
19 | @Override
20 | @CallSuper
21 | protected void attachBaseContext(Context base) {
22 | super.attachBaseContext(base);
23 | MultiDex.install(this);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | url_launcher_windows
7 | )
8 |
9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Web related
36 | lib/generated_plugin_registrant.dart
37 |
38 | # Symbolication related
39 | app.*.symbols
40 |
41 | # Obfuscation related
42 | app.*.map.json
43 |
44 | # Android Studio will place build artifacts here
45 | /android/app/debug
46 | /android/app/profile
47 | /android/app/release
48 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 25caf1461b8f643092a9f6f5b224453b5c057d10
8 | channel: dev
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 25caf1461b8f643092a9f6f5b224453b5c057d10
17 | base_revision: 25caf1461b8f643092a9f6f5b224453b5c057d10
18 | - platform: windows
19 | create_revision: 25caf1461b8f643092a9f6f5b224453b5c057d10
20 | base_revision: 25caf1461b8f643092a9f6f5b224453b5c057d10
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "health_app",
3 | "short_name": "health_app",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/lib/firestore_data/notification_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 |
4 | class NotificationList extends StatefulWidget {
5 | const NotificationList({Key? key}) : super(key: key);
6 |
7 | @override
8 | State createState() => _NotificationListState();
9 | }
10 |
11 | class _NotificationListState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | appBar: AppBar(
16 | backgroundColor: Colors.white,
17 | leading: IconButton(
18 | splashRadius: 20,
19 | icon: const Icon(
20 | Icons.arrow_back_ios,
21 | color: Colors.indigo,
22 | ),
23 | onPressed: () {
24 | Navigator.pop(context);
25 | }),
26 | title: Text(
27 | 'Notifications',
28 | style: GoogleFonts.lato(
29 | color: Colors.indigo,
30 | fontSize: 18,
31 | fontWeight: FontWeight.bold,
32 | ),
33 | ),
34 | ),
35 | );
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/screens/patient/appointments.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:health_app/firestore_data/appointment_list.dart';
4 |
5 | class Appointments extends StatefulWidget {
6 | const Appointments({Key? key}) : super(key: key);
7 |
8 | @override
9 | State createState() => _AppointmentsState();
10 | }
11 |
12 | class _AppointmentsState extends State {
13 | @override
14 | Widget build(BuildContext context) {
15 | return Scaffold(
16 | backgroundColor: Colors.white,
17 | appBar: AppBar(
18 | backgroundColor: Colors.white,
19 | title: Container(
20 | alignment: Alignment.center,
21 | padding: const EdgeInsets.symmetric(vertical: 10),
22 | child: Text(
23 | 'My Appointments',
24 | style: GoogleFonts.lato(
25 | color: Colors.black,
26 | fontWeight: FontWeight.bold,
27 | ),
28 | ),
29 | ),
30 | iconTheme: const IconThemeData(color: Colors.black),
31 | ),
32 | body: Container(
33 | padding: const EdgeInsets.only(right: 10, left: 10, top: 10),
34 | child: const AppointmentList(),
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Disable Windows macros that collide with C++ standard library functions.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
25 |
26 | # Add dependency libraries and include directories. Add any application-specific
27 | # dependencies here.
28 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
29 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
30 |
31 | # Run the Flutter tool portions of the build. This must not be removed.
32 | add_dependencies(${BINARY_NAME} flutter_assemble)
33 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.CreateAndShow(L"health_app", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/android/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "131647123287",
4 | "firebase_url": "https://health-app-99603-default-rtdb.firebaseio.com",
5 | "project_id": "health-app-99603",
6 | "storage_bucket": "health-app-99603.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:131647123287:android:d9d8893b246e5f78d89812",
12 | "android_client_info": {
13 | "package_name": "com.example.health_app"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "131647123287-26ltlj6v6m2basjgrs89cl21jsbalnu7.apps.googleusercontent.com",
19 | "client_type": 3
20 | }
21 | ],
22 | "api_key": [
23 | {
24 | "current_key": "AIzaSyCv28h-Zp2q-bw1AhiPT0-rtVvM-9LBFQI"
25 | }
26 | ],
27 | "services": {
28 | "appinvite_service": {
29 | "other_platform_oauth_client": [
30 | {
31 | "client_id": "131647123287-26ltlj6v6m2basjgrs89cl21jsbalnu7.apps.googleusercontent.com",
32 | "client_type": 3
33 | },
34 | {
35 | "client_id": "131647123287-bs4vp3qrgi8cqnt1rg26nhjtfa0d2qj9.apps.googleusercontent.com",
36 | "client_type": 2,
37 | "ios_info": {
38 | "bundle_id": "com.example.healthApp"
39 | }
40 | }
41 | ]
42 | }
43 | }
44 | }
45 | ],
46 | "configuration_version": "1"
47 | }
--------------------------------------------------------------------------------
/lib/screens/doctor_or_patient.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:health_app/globals.dart';
5 | import 'package:health_app/screens/doctor/main_page_doctor.dart';
6 | import 'package:health_app/screens/patient/main_page_patient.dart';
7 |
8 | class DoctorOrPatient extends StatefulWidget {
9 | const DoctorOrPatient({Key? key}) : super(key: key);
10 |
11 | @override
12 | State createState() => _DoctorOrPatientState();
13 | }
14 |
15 | class _DoctorOrPatientState extends State {
16 | bool _isLoading = true;
17 | void _setUser() async {
18 | final User? user = FirebaseAuth.instance.currentUser;
19 | DocumentSnapshot snap = await FirebaseFirestore.instance
20 | .collection('users')
21 | .doc(user!.uid)
22 | .get();
23 |
24 | var basicInfo = snap.data() as Map;
25 |
26 | isDoctor = basicInfo['type'] == 'doctor' ? true : false;
27 | print('isdoctor : $isDoctor');
28 | setState(() {
29 | _isLoading = false;
30 | });
31 | }
32 |
33 | @override
34 | void initState() {
35 | super.initState();
36 | _setUser();
37 | }
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return _isLoading
42 | ? const Scaffold(body: Center(child: CircularProgressIndicator()))
43 | : isDoctor
44 | ? const MainPageDoctor()
45 | : const MainPagePatient();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Health App
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | health_app
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CADisableMinimumFrameDurationOnPhone
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/lib/helperFunction/sharedpref_helper.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:shared_preferences/shared_preferences.dart';
3 |
4 | class SharedPreferenceHelper {
5 |
6 | final String _userIdKey = "USERIDKEY";
7 | final String _userNameKey = "USERNAMEKEY";
8 | final String _accountTypeKey = "ACCOUNTTYPEKEY";
9 | final String _profileUrlKey = "PROFILEURLKEY";
10 |
11 | // save data
12 | Future saveUserName(String userName) async {
13 | SharedPreferences prefs = await SharedPreferences.getInstance();
14 | return prefs.setString(_userNameKey, userName);
15 | }
16 |
17 | Future saveUserId(String userId) async {
18 | SharedPreferences prefs = await SharedPreferences.getInstance();
19 | return prefs.setString(_userIdKey, userId);
20 | }
21 |
22 | Future saveAccountType(bool accountType) async {
23 | SharedPreferences prefs = await SharedPreferences.getInstance();
24 | return prefs.setBool(_accountTypeKey, accountType);
25 | }
26 |
27 | Future saveProfileUrl(String profileUrl) async {
28 | SharedPreferences prefs = await SharedPreferences.getInstance();
29 | return prefs.setString(_profileUrlKey, profileUrl);
30 | }
31 |
32 | // get data
33 | Future getUserName() async {
34 | SharedPreferences prefs = await SharedPreferences.getInstance();
35 | return prefs.getString(_userNameKey);
36 | }
37 |
38 | Future getUserId() async {
39 | SharedPreferences prefs = await SharedPreferences.getInstance();
40 | return prefs.getString(_userIdKey);
41 | }
42 |
43 | Future getAccountType() async {
44 | SharedPreferences prefs = await SharedPreferences.getInstance();
45 | return prefs.getBool(_accountTypeKey);
46 | }
47 |
48 | Future getProfileUrl() async {
49 | SharedPreferences prefs = await SharedPreferences.getInstance();
50 | return prefs.getString(_profileUrlKey);
51 | }
52 |
53 |
54 | }
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr);
51 | std::string utf8_string;
52 | if (target_length == 0 || target_length > utf8_string.max_size()) {
53 | return utf8_string;
54 | }
55 | utf8_string.resize(target_length);
56 | int converted_length = ::WideCharToMultiByte(
57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
58 | -1, utf8_string.data(),
59 | target_length, nullptr, nullptr);
60 | if (converted_length == 0) {
61 | return std::string();
62 | }
63 | return utf8_string;
64 | }
65 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 | return true;
30 | }
31 |
32 | void FlutterWindow::OnDestroy() {
33 | if (flutter_controller_) {
34 | flutter_controller_ = nullptr;
35 | }
36 |
37 | Win32Window::OnDestroy();
38 | }
39 |
40 | LRESULT
41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
42 | WPARAM const wparam,
43 | LPARAM const lparam) noexcept {
44 | // Give Flutter, including plugins, an opportunity to handle window messages.
45 | if (flutter_controller_) {
46 | std::optional result =
47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
48 | lparam);
49 | if (result) {
50 | return *result;
51 | }
52 | }
53 |
54 | switch (message) {
55 | case WM_FONTCHANGE:
56 | flutter_controller_->engine()->ReloadSystemFonts();
57 | break;
58 | }
59 |
60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
61 | }
62 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | health_app
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/lib/screens/chat/message_dao.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart' as store;
2 | import 'package:firebase_database/firebase_database.dart';
3 | import 'package:health_app/screens/chat/message.dart';
4 |
5 | class MessageDao {
6 | late DatabaseReference _messageRef;
7 | final String user1;
8 | final String user2;
9 |
10 | MessageDao({required this.user1, required this.user2}) {
11 | var users = [user1, user2];
12 | users.sort();
13 |
14 | String chatRoomId = users.join('-');
15 |
16 | // create gateway of two chats
17 | createGateWay();
18 |
19 | _messageRef =
20 | FirebaseDatabase.instance.ref('chats').child(chatRoomId).child('chat');
21 | }
22 |
23 | Future createGateWay() async {
24 | // make two way terminal if not present
25 | store.DocumentSnapshot snap1 = await store.FirebaseFirestore.instance
26 | .collection('users')
27 | .doc(user1)
28 | .get();
29 | store.DocumentSnapshot snap2 = await store.FirebaseFirestore.instance
30 | .collection('users')
31 | .doc(user2)
32 | .get();
33 |
34 | var user1Info = snap1.data() as Map;
35 | var user2Info = snap2.data() as Map;
36 |
37 | var user1Data = {
38 | 'uid': user1,
39 | 'name': user1Info['name'],
40 | 'photo': user1Info['profilePhoto']
41 | };
42 | var user2Data = {
43 | 'uid': user2,
44 | 'name': user2Info['name'],
45 | 'photo': user2Info['profilePhoto']
46 | };
47 | print(user1Data);
48 | print(user2Data);
49 | FirebaseDatabase.instance
50 | .ref('users')
51 | .child(user1)
52 | .child(user2)
53 | .set(user2Data);
54 | FirebaseDatabase.instance
55 | .ref('users')
56 | .child(user2)
57 | .child(user1)
58 | .set(user1Data);
59 | }
60 |
61 | void saveMessage(Message message) {
62 | print(message.toJson());
63 | _messageRef.push().set(message.toJson());
64 | }
65 |
66 | Query getMessageQuery() {
67 | return _messageRef;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:firebase_core/firebase_core.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:health_app/globals.dart';
5 | import 'package:health_app/screens/doctor/main_page_doctor.dart';
6 | import 'package:health_app/screens/doctor_or_patient.dart';
7 | import 'package:health_app/screens/firebase_auth.dart';
8 | import 'package:health_app/screens/my_profile.dart';
9 | import 'package:health_app/screens/patient/appointments.dart';
10 | import 'package:health_app/screens/patient/doctor_profile.dart';
11 | import 'package:health_app/screens/patient/main_page_patient.dart';
12 | import 'package:health_app/screens/skip.dart';
13 |
14 | import 'firebase_options.dart';
15 |
16 | void main() async {
17 | WidgetsFlutterBinding.ensureInitialized();
18 | // Initialize Firebase for all platforms(android, ios, web)
19 | await Firebase.initializeApp(
20 | options: DefaultFirebaseOptions.currentPlatform,
21 | );
22 |
23 | runApp(const MyApp());
24 | }
25 |
26 | class MyApp extends StatefulWidget {
27 | const MyApp({Key? key}) : super(key: key);
28 |
29 | @override
30 | State createState() => _MyAppState();
31 | }
32 |
33 | class _MyAppState extends State {
34 | final FirebaseAuth _auth = FirebaseAuth.instance;
35 |
36 | User? user;
37 |
38 | Future _getUser() async {
39 | user = _auth.currentUser!;
40 | }
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | _getUser();
45 | return MaterialApp(
46 | initialRoute: '/',
47 | routes: {
48 | // When navigating to the "/" route, build the FirstScreen widget.
49 | '/': (context) => user == null
50 | ? const Skip()
51 | : const DoctorOrPatient(),
52 | '/login': (context) => const FireBaseAuth(),
53 | '/home': (context) =>
54 | isDoctor ? const MainPageDoctor() : const MainPagePatient(),
55 | '/profile': (context) => const MyProfile(),
56 | '/MyAppointments': (context) => const Appointments(),
57 | '/DoctorProfile': (context) => DoctorProfile(),
58 | },
59 | theme: ThemeData(brightness: Brightness.light),
60 | debugShowCheckedModeBanner: false,
61 | // home: MainPageDoctor(),
62 | // home: ChatRoom(
63 | // userId: '1234',
64 | // ),
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply plugin: 'com.google.gms.google-services'
27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
28 |
29 | android {
30 | compileSdkVersion flutter.compileSdkVersion
31 | ndkVersion flutter.ndkVersion
32 |
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 |
38 | kotlinOptions {
39 | jvmTarget = '1.8'
40 | }
41 |
42 | sourceSets {
43 | main.java.srcDirs += 'src/main/kotlin'
44 | }
45 |
46 | defaultConfig {
47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48 | applicationId "com.example.health_app"
49 | // You can update the following values to match your application needs.
50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
51 | minSdkVersion 19
52 | targetSdkVersion flutter.targetSdkVersion
53 | versionCode flutterVersionCode.toInteger()
54 | versionName flutterVersionName
55 | multiDexEnabled true
56 | }
57 |
58 | buildTypes {
59 | release {
60 | // TODO: Add your own signing config for the release build.
61 | // Signing with the debug keys for now, so `flutter run --release` works.
62 | signingConfig signingConfigs.debug
63 | }
64 | }
65 | }
66 |
67 | flutter {
68 | source '../..'
69 | }
70 |
71 | dependencies {
72 | implementation 'com.android.support:multidex:1.0.3'
73 | implementation platform('com.google.firebase:firebase-bom:30.0.0')
74 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
75 | }
76 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Health-App
2 |
3 |
4 |
5 |
6 | - Click on the above icon to open the app(web version).
7 | - It is a Cross-Platform Application.
8 | - Helps a patient to search doctor as per their need
9 | - view complete profile of the doctor.
10 | - book an appointment with the doctor.
11 | - Call and message directly with the doctor.
12 |
13 | - Helps Doctor to reach patient all over the world.
14 |
15 | ## Featues
16 | - Common App for `patient` and `doctor`
17 | - Doctor Searching
18 | - Appointment Booking (cancelling & history also)
19 | - Calling
20 | - Realtime Chatting
21 | - Easy to use
22 |
23 | ## Technologies Used
24 | - Flutter
25 | - Dart language
26 | - Frontend + Backend
27 | - Firebase
28 | - Authentication ------> for authentication of the user
29 | - Database -----> for storing the data of patient and doctor
30 | - Storage ------> for profile images
31 | - Realtime Database -------> for real time Chatting
32 |
33 |
34 |
35 |
36 |
37 |
38 | ## Screenshots
39 | ## 1. Start Screen
40 |
41 |
42 | ## 1. Sign / Sign Up
43 |
44 |
45 | ## 3. Profile [Patient(left) and Doctor(right)]
46 | - Profile of the patientis is on left side and of doctor is on right side.
47 | - see bottom nav bar
48 |
49 |
50 |
51 | ## 4. Patient Account
52 | - shows all available options to the patient.
53 |
54 |
55 |
56 | ## 5. Appointment
57 | ### 5.1 Booking Screen
58 | - shows complete profile of the doctor
59 | - patient can book `appointment`, `call` and `message` directly with the doctor
60 |
61 |
62 |
63 | ### 5.2 Booked Appointment
64 | - shows all the booked appointments for both patient(see right) and doctor(see left)
65 | - also they can cancel the appointment
66 |
67 |
68 |
69 | ### 5.3 History
70 | - shows all the history of appointments for both patient(see right) and doctor(see left)
71 |
72 |
73 |
74 | ## 6 Chatting
75 | - doctor and patient can chat directly with each other.
76 |
77 |
78 |
79 | ## 7 Database
80 | - all data is stored in the database.
81 |
82 |
83 | ---
84 | Thank You 😁😀
85 |
--------------------------------------------------------------------------------
/lib/screens/setting.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 | import 'package:health_app/firestore_data/user_details.dart';
5 |
6 | class UserSettings extends StatefulWidget {
7 | const UserSettings({Key? key}) : super(key: key);
8 |
9 | @override
10 | State createState() => _UserSettingsState();
11 | }
12 |
13 | class _UserSettingsState extends State {
14 | UserDetails detail = const UserDetails();
15 |
16 | final FirebaseAuth _auth = FirebaseAuth.instance;
17 | User? user;
18 |
19 | Future _getUser() async {
20 | user = _auth.currentUser;
21 | }
22 |
23 | Future _signOut() async {
24 | await _auth.signOut();
25 | }
26 |
27 | @override
28 | void initState() {
29 | super.initState();
30 | _getUser();
31 | }
32 |
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | appBar: AppBar(
37 | elevation: 2,
38 | backgroundColor: Colors.white,
39 | leading: Padding(
40 | padding: const EdgeInsets.only(left: 10),
41 | child: IconButton(
42 | splashRadius: 25,
43 | icon: const Icon(
44 | Icons.arrow_back_ios,
45 | color: Colors.indigo,
46 | ),
47 | onPressed: () => Navigator.of(context).pop(),
48 | ),
49 | ),
50 | title: Text(
51 | 'User Settings',
52 | style: GoogleFonts.lato(
53 | color: Colors.indigo, fontSize: 20, fontWeight: FontWeight.bold),
54 | ),
55 | ),
56 | body: SingleChildScrollView(
57 | child: Column(
58 | children: [
59 | // info to edit
60 | const UserDetails(),
61 |
62 | // log out button
63 | Container(
64 | margin: const EdgeInsets.only(
65 | left: 15, right: 15, bottom: 30, top: 5),
66 | padding: const EdgeInsets.symmetric(horizontal: 14),
67 | height: MediaQuery.of(context).size.height / 14,
68 | width: MediaQuery.of(context).size.width,
69 | decoration: BoxDecoration(
70 | borderRadius: BorderRadius.circular(10),
71 | color: Colors.red,
72 | ),
73 | child: TextButton(
74 | onPressed: () {
75 | Navigator.of(context).pushNamedAndRemoveUntil(
76 | '/login', (Route route) => false);
77 | _signOut();
78 | },
79 | style: TextButton.styleFrom(primary: Colors.grey),
80 | child: Text(
81 | 'Sign out',
82 | style: GoogleFonts.lato(
83 | color: Colors.black,
84 | fontSize: 16,
85 | fontWeight: FontWeight.bold,
86 | ),
87 | ),
88 | ),
89 | ),
90 | ],
91 | ),
92 | ),
93 | );
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/firebase_options.dart:
--------------------------------------------------------------------------------
1 | // File generated by FlutterFire CLI.
2 | // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4 | import 'package:flutter/foundation.dart'
5 | show defaultTargetPlatform, kIsWeb, TargetPlatform;
6 |
7 | /// Default [FirebaseOptions] for use with your Firebase apps.
8 | ///
9 | /// Example:
10 | /// ```dart
11 | /// import 'firebase_options.dart';
12 | /// // ...
13 | /// await Firebase.initializeApp(
14 | /// options: DefaultFirebaseOptions.currentPlatform,
15 | /// );
16 | /// ```
17 | class DefaultFirebaseOptions {
18 | static FirebaseOptions get currentPlatform {
19 | if (kIsWeb) {
20 | return web;
21 | }
22 | switch (defaultTargetPlatform) {
23 | case TargetPlatform.android:
24 | return android;
25 | case TargetPlatform.iOS:
26 | return ios;
27 | case TargetPlatform.macOS:
28 | throw UnsupportedError(
29 | 'DefaultFirebaseOptions have not been configured for macos - '
30 | 'you can reconfigure this by running the FlutterFire CLI again.',
31 | );
32 | case TargetPlatform.windows:
33 | throw UnsupportedError(
34 | 'DefaultFirebaseOptions have not been configured for windows - '
35 | 'you can reconfigure this by running the FlutterFire CLI again.',
36 | );
37 | case TargetPlatform.linux:
38 | throw UnsupportedError(
39 | 'DefaultFirebaseOptions have not been configured for linux - '
40 | 'you can reconfigure this by running the FlutterFire CLI again.',
41 | );
42 | default:
43 | throw UnsupportedError(
44 | 'DefaultFirebaseOptions are not supported for this platform.',
45 | );
46 | }
47 | }
48 |
49 | static const FirebaseOptions web = FirebaseOptions(
50 | apiKey: 'AIzaSyB3vfG0mrND01mAOC4OZ0pOwTQdgVjwJOs',
51 | appId: '1:131647123287:web:a351efe36bd16bf9d89812',
52 | messagingSenderId: '131647123287',
53 | projectId: 'health-app-99603',
54 | authDomain: 'health-app-99603.firebaseapp.com',
55 | databaseURL: 'https://health-app-99603-default-rtdb.firebaseio.com',
56 | storageBucket: 'health-app-99603.appspot.com',
57 | );
58 |
59 | static const FirebaseOptions android = FirebaseOptions(
60 | apiKey: 'AIzaSyCv28h-Zp2q-bw1AhiPT0-rtVvM-9LBFQI',
61 | appId: '1:131647123287:android:d9d8893b246e5f78d89812',
62 | messagingSenderId: '131647123287',
63 | projectId: 'health-app-99603',
64 | databaseURL: 'https://health-app-99603-default-rtdb.firebaseio.com',
65 | storageBucket: 'health-app-99603.appspot.com',
66 | );
67 |
68 | static const FirebaseOptions ios = FirebaseOptions(
69 | apiKey: 'AIzaSyB45rGly5QSTN-jF4qez-GSyB0U8G6WD8M',
70 | appId: '1:131647123287:ios:db03c51f647df00dd89812',
71 | messagingSenderId: '131647123287',
72 | projectId: 'health-app-99603',
73 | databaseURL: 'https://health-app-99603-default-rtdb.firebaseio.com',
74 | storageBucket: 'health-app-99603.appspot.com',
75 | iosClientId: '131647123287-bs4vp3qrgi8cqnt1rg26nhjtfa0d2qj9.apps.googleusercontent.com',
76 | iosBundleId: 'com.example.healthApp',
77 | );
78 | }
79 |
--------------------------------------------------------------------------------
/lib/screens/doctor/main_page_doctor.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:google_nav_bar/google_nav_bar.dart';
4 | import 'package:health_app/screens/chat/chats.dart';
5 | import 'package:health_app/screens/my_profile.dart';
6 | import 'package:health_app/screens/patient/appointments.dart';
7 | import 'package:typicons_flutter/typicons_flutter.dart';
8 |
9 | class MainPageDoctor extends StatefulWidget {
10 | const MainPageDoctor({Key? key}) : super(key: key);
11 |
12 | @override
13 | State createState() => _MainPageDoctorState();
14 | }
15 |
16 | class _MainPageDoctorState extends State {
17 | final GlobalKey _scaffoldKey = GlobalKey();
18 | int _selectedIndex = 2;
19 | final List _pages = [
20 | const Chats(),
21 | const Appointments(),
22 | const MyProfile(),
23 | ];
24 |
25 | void _onItemTapped(int index) {
26 | setState(() {
27 | _selectedIndex = index;
28 | });
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return Container(
34 | color: Colors.white,
35 | child: Scaffold(
36 | backgroundColor: Colors.transparent,
37 | key: _scaffoldKey,
38 | body: _pages[_selectedIndex],
39 | bottomNavigationBar: Container(
40 | decoration: BoxDecoration(
41 | color: Colors.white,
42 | borderRadius: const BorderRadius.only(
43 | topLeft: Radius.circular(20),
44 | topRight: Radius.circular(20),
45 | ),
46 | boxShadow: [
47 | BoxShadow(
48 | blurRadius: 20,
49 | color: Colors.black.withOpacity(.2),
50 | ),
51 | ],
52 | ),
53 | child: SafeArea(
54 | child: Padding(
55 | padding:
56 | const EdgeInsets.symmetric(horizontal: 10.0, vertical: 8),
57 | child: GNav(
58 | curve: Curves.easeOutExpo,
59 | rippleColor: Colors.grey.shade300,
60 | hoverColor: Colors.grey.shade100,
61 | haptic: true,
62 | tabBorderRadius: 20,
63 | gap: 5,
64 | activeColor: Colors.white,
65 | padding:
66 | const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
67 | duration: const Duration(milliseconds: 200),
68 | tabBackgroundColor: Colors.blue.withOpacity(0.7),
69 | textStyle: GoogleFonts.lato(
70 | color: Colors.white,
71 | ),
72 | iconSize: 30,
73 | tabs: const [
74 | GButton(
75 | icon: Icons.chat_outlined /* Typicons.group_outline */,
76 | text: 'Chats',
77 | ),
78 | GButton(
79 | icon: Typicons.calendar,
80 | text: 'All Appointments',
81 | ),
82 | GButton(
83 | icon: Typicons.user,
84 | text: 'Profile',
85 | ),
86 | ],
87 | selectedIndex: _selectedIndex,
88 | onTabChange: _onItemTapped,
89 | ),
90 | ),
91 | ),
92 | ),
93 | ),
94 | );
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "health_app" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "health_app" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "health_app.exe" "\0"
98 | VALUE "ProductName", "health_app" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates and shows a win32 window with |title| and position and size using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size to will treat the width height passed in to this function
35 | // as logical pixels and scale to appropriate for the default monitor. Returns
36 | // true if the window was created successfully.
37 | bool CreateAndShow(const std::wstring& title,
38 | const Point& origin,
39 | const Size& size);
40 |
41 | // Release OS resources associated with window.
42 | void Destroy();
43 |
44 | // Inserts |content| into the window tree.
45 | void SetChildContent(HWND content);
46 |
47 | // Returns the backing Window handle to enable clients to set icon and other
48 | // window properties. Returns nullptr if the window has been destroyed.
49 | HWND GetHandle();
50 |
51 | // If true, closing this window will quit the application.
52 | void SetQuitOnClose(bool quit_on_close);
53 |
54 | // Return a RECT representing the bounds of the current client area.
55 | RECT GetClientArea();
56 |
57 | protected:
58 | // Processes and route salient window messages for mouse handling,
59 | // size change and DPI. Delegates handling of these to member overloads that
60 | // inheriting classes can handle.
61 | virtual LRESULT MessageHandler(HWND window,
62 | UINT const message,
63 | WPARAM const wparam,
64 | LPARAM const lparam) noexcept;
65 |
66 | // Called when CreateAndShow is called, allowing subclass window-related
67 | // setup. Subclasses should return false if setup fails.
68 | virtual bool OnCreate();
69 |
70 | // Called when Destroy is called.
71 | virtual void OnDestroy();
72 |
73 | private:
74 | friend class WindowClassRegistrar;
75 |
76 | // OS callback called by message pump. Handles the WM_NCCREATE message which
77 | // is passed when the non-client area is being created and enables automatic
78 | // non-client DPI scaling so that the non-client area automatically
79 | // responsponds to changes in DPI. All other messages are handled by
80 | // MessageHandler.
81 | static LRESULT CALLBACK WndProc(HWND const window,
82 | UINT const message,
83 | WPARAM const wparam,
84 | LPARAM const lparam) noexcept;
85 |
86 | // Retrieves a class instance pointer for |window|
87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
88 |
89 | bool quit_on_close_ = false;
90 |
91 | // window handle for top level window.
92 | HWND window_handle_ = nullptr;
93 |
94 | // window handle for hosted content.
95 | HWND child_content_ = nullptr;
96 | };
97 |
98 | #endif // RUNNER_WIN32_WINDOW_H_
99 |
--------------------------------------------------------------------------------
/lib/carousel_slider.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import 'package:carousel_slider/carousel_slider.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:google_fonts/google_fonts.dart';
7 | import 'package:health_app/model/banner_model.dart';
8 | import 'package:health_app/screens/disease.dart';
9 | import 'package:health_app/screens/diseasedetail.dart';
10 |
11 | class Carouselslider extends StatelessWidget {
12 | const Carouselslider({Key? key}) : super(key: key);
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return SizedBox(
17 | height: 150,
18 | width: MediaQuery.of(context).size.width,
19 | child: CarouselSlider.builder(
20 | itemCount: bannerCards.length,
21 | itemBuilder: (context, index, realIndex) {
22 | return Container(
23 | //alignment: Alignment.centerLeft,
24 | //width: MediaQuery.of(context).size.width,
25 | height: 140,
26 | margin: const EdgeInsets.only(left: 0, right: 0, bottom: 20),
27 | padding: const EdgeInsets.only(left: 0),
28 | decoration: BoxDecoration(
29 | borderRadius: BorderRadius.circular(20),
30 | gradient: LinearGradient(
31 | stops: const [0.3, 0.7],
32 | begin: Alignment.centerLeft,
33 | end: Alignment.centerRight,
34 | colors: bannerCards[index].cardBackground,
35 | ),
36 | ),
37 | child: GestureDetector(
38 | onTap: () {
39 | index == 0
40 | ? Navigator.push(context,
41 | MaterialPageRoute(builder: (BuildContext context) {
42 | return const Disease();
43 | }))
44 | : Navigator.push(context,
45 | MaterialPageRoute(builder: (BuildContext context) {
46 | return const DiseaseDetail(disease: 'Covid-19');
47 | }));
48 | },
49 | child: Stack(
50 | children: [
51 | Image.asset(
52 | bannerCards[index].image,
53 | //'assets/414.jpg',
54 | fit: BoxFit.fitHeight,
55 | ),
56 | Container(
57 | padding: const EdgeInsets.only(top: 7, right: 5),
58 | alignment: Alignment.topRight,
59 | child: Row(
60 | crossAxisAlignment: CrossAxisAlignment.start,
61 | mainAxisAlignment: MainAxisAlignment.end,
62 | children: [
63 | Text(
64 | bannerCards[index].text,
65 | //'Check Disease',
66 | style: GoogleFonts.lato(
67 | color: Colors.lightBlue[900],
68 | fontWeight: FontWeight.bold,
69 | fontSize: 15,
70 | ),
71 | ),
72 | Icon(
73 | Icons.chevron_right_rounded,
74 | color: Colors.lightBlue[900],
75 | size: 20,
76 | )
77 | ],
78 | ),
79 | ),
80 | ],
81 | ),
82 | ),
83 | );
84 | },
85 | options: CarouselOptions(
86 | autoPlay: true,
87 | enlargeCenterPage: true,
88 | enableInfiniteScroll: false,
89 | scrollPhysics: const ClampingScrollPhysics(),
90 | ),
91 | ),
92 | );
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # === Flutter Library ===
14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
15 |
16 | # Published to parent scope for install step.
17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
21 |
22 | list(APPEND FLUTTER_LIBRARY_HEADERS
23 | "flutter_export.h"
24 | "flutter_windows.h"
25 | "flutter_messenger.h"
26 | "flutter_plugin_registrar.h"
27 | "flutter_texture_registrar.h"
28 | )
29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
30 | add_library(flutter INTERFACE)
31 | target_include_directories(flutter INTERFACE
32 | "${EPHEMERAL_DIR}"
33 | )
34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
35 | add_dependencies(flutter flutter_assemble)
36 |
37 | # === Wrapper ===
38 | list(APPEND CPP_WRAPPER_SOURCES_CORE
39 | "core_implementations.cc"
40 | "standard_codec.cc"
41 | )
42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
44 | "plugin_registrar.cc"
45 | )
46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
47 | list(APPEND CPP_WRAPPER_SOURCES_APP
48 | "flutter_engine.cc"
49 | "flutter_view_controller.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
52 |
53 | # Wrapper sources needed for a plugin.
54 | add_library(flutter_wrapper_plugin STATIC
55 | ${CPP_WRAPPER_SOURCES_CORE}
56 | ${CPP_WRAPPER_SOURCES_PLUGIN}
57 | )
58 | apply_standard_settings(flutter_wrapper_plugin)
59 | set_target_properties(flutter_wrapper_plugin PROPERTIES
60 | POSITION_INDEPENDENT_CODE ON)
61 | set_target_properties(flutter_wrapper_plugin PROPERTIES
62 | CXX_VISIBILITY_PRESET hidden)
63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
64 | target_include_directories(flutter_wrapper_plugin PUBLIC
65 | "${WRAPPER_ROOT}/include"
66 | )
67 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
68 |
69 | # Wrapper sources needed for the runner.
70 | add_library(flutter_wrapper_app STATIC
71 | ${CPP_WRAPPER_SOURCES_CORE}
72 | ${CPP_WRAPPER_SOURCES_APP}
73 | )
74 | apply_standard_settings(flutter_wrapper_app)
75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
76 | target_include_directories(flutter_wrapper_app PUBLIC
77 | "${WRAPPER_ROOT}/include"
78 | )
79 | add_dependencies(flutter_wrapper_app flutter_assemble)
80 |
81 | # === Flutter tool backend ===
82 | # _phony_ is a non-existent file to force this command to run every time,
83 | # since currently there's no way to get a full input/output list from the
84 | # flutter tool.
85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
87 | add_custom_command(
88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
90 | ${CPP_WRAPPER_SOURCES_APP}
91 | ${PHONY_OUTPUT}
92 | COMMAND ${CMAKE_COMMAND} -E env
93 | ${FLUTTER_TOOL_ENVIRONMENT}
94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
95 | windows-x64 $
96 | VERBATIM
97 | )
98 | add_custom_target(flutter_assemble DEPENDS
99 | "${FLUTTER_LIBRARY}"
100 | ${FLUTTER_LIBRARY_HEADERS}
101 | ${CPP_WRAPPER_SOURCES_CORE}
102 | ${CPP_WRAPPER_SOURCES_PLUGIN}
103 | ${CPP_WRAPPER_SOURCES_APP}
104 | )
105 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: health_app
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.17.0-260.0.dev <3.0.0"
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | carousel_slider: ^4.1.1
31 | cloud_firestore: ^3.1.14
32 | cupertino_icons: ^1.0.2
33 | firebase_auth: ^3.3.20
34 | firebase_core: ^1.18.0
35 | firebase_database: ^9.0.16
36 | firebase_storage: ^10.2.18
37 | flutter:
38 | sdk: flutter
39 | fluttericon: ^2.0.0
40 | google_fonts: ^2.3.2
41 | google_nav_bar: ^5.0.6
42 | icon: ^2.2.1
43 | image_picker: ^0.8.5+3
44 | intl: ^0.17.0
45 | introduction_screen: ^3.0.2
46 | shared_preferences: ^2.0.15
47 | tabler_icons: ^0.0.3
48 | typicons_flutter: ^0.5.0
49 | url_launcher: ^6.1.0
50 |
51 | dev_dependencies:
52 | flutter_launcher_icons: ^0.9.2
53 | flutter_lints: ^2.0.0
54 | flutter_test:
55 | sdk: flutter
56 |
57 | flutter_icons:
58 | android: "launcher_icon"
59 | ios: true
60 | image_path: "assets/icon/appicon.png"
61 |
62 | # For information on the generic Dart part of this file, see the
63 | # following page: https://dart.dev/tools/pub/pubspec
64 | # The following section is specific to Flutter packages.
65 | flutter:
66 | # The following line ensures that the Material Icons font is
67 | # included with your application, so that you can use the icons in
68 | # the material Icons class.
69 | uses-material-design: true
70 | # To add assets to your application, add an assets section, like this:
71 | assets:
72 | - assets/
73 | # An image asset can refer to one or more resolution-specific "variants", see
74 | # https://flutter.dev/assets-and-images/#resolution-aware
75 | # For details regarding adding assets from package dependencies, see
76 | # https://flutter.dev/assets-and-images/#from-packages
77 | # To add custom fonts to your application, add a fonts section here,
78 | # in this "flutter" section. Each entry in this list should have a
79 | # "family" key with the font family name, and a "fonts" key with a
80 | # list giving the asset and other descriptors for the font. For
81 | # example:
82 | # fonts:
83 | # - family: Schyler
84 | # fonts:
85 | # - asset: fonts/Schyler-Regular.ttf
86 | # - asset: fonts/Schyler-Italic.ttf
87 | # style: italic
88 | # - family: Trajan Pro
89 | # fonts:
90 | # - asset: fonts/TrajanPro.ttf
91 | # - asset: fonts/TrajanPro_Bold.ttf
92 | # weight: 700
93 | #
94 | # For details regarding fonts from package dependencies,
95 | # see https://flutter.dev/custom-fonts/#from-packages
96 |
--------------------------------------------------------------------------------
/lib/screens/skip.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:introduction_screen/introduction_screen.dart';
4 |
5 | import 'firebase_auth.dart';
6 |
7 | class Skip extends StatefulWidget {
8 | const Skip({Key? key}) : super(key: key);
9 |
10 | @override
11 | State createState() => _SkipState();
12 | }
13 |
14 | class _SkipState extends State {
15 | List getpages() {
16 | return [
17 | PageViewModel(
18 | title: '',
19 | image: Image.asset(
20 | 'assets/doc.png',
21 | //fit: BoxFit.cover,
22 | ),
23 | //body: "Search Doctors",
24 | bodyWidget: Column(
25 | mainAxisAlignment: MainAxisAlignment.center,
26 | children: [
27 | Text(
28 | 'Search Doctors',
29 | style:
30 | GoogleFonts.lato(fontSize: 30, fontWeight: FontWeight.w900),
31 | ),
32 | Text(
33 | 'Find popular doctors nearby you',
34 | style: GoogleFonts.lato(
35 | fontSize: 15,
36 | color: Colors.grey[500],
37 | fontWeight: FontWeight.w800),
38 | ),
39 | ],
40 | ),
41 | ),
42 | PageViewModel(
43 | title: '',
44 | image: Image.asset(
45 | 'assets/disease.png',
46 | //fit: BoxFit.cover,
47 | ),
48 | //body: "Search Doctors",
49 | bodyWidget: Column(
50 | mainAxisAlignment: MainAxisAlignment.center,
51 | children: [
52 | Text(
53 | 'Search Disease',
54 | style:
55 | GoogleFonts.lato(fontSize: 30, fontWeight: FontWeight.w900),
56 | ),
57 | Text(
58 | 'Find information about disease',
59 | style: GoogleFonts.lato(
60 | fontSize: 15,
61 | color: Colors.grey[500],
62 | fontWeight: FontWeight.w800),
63 | ),
64 | ],
65 | ),
66 | ),
67 | ];
68 | }
69 |
70 | @override
71 | Widget build(BuildContext context) {
72 | return Scaffold(
73 | body: IntroductionScreen(
74 | globalBackgroundColor: Colors.lightBlue[100],
75 | pages: getpages(),
76 | showNextButton: false,
77 | showSkipButton: true,
78 | skip: SizedBox(
79 | width: 80,
80 | height: 48,
81 | child: Card(
82 | shape:
83 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
84 | color: Colors.blue[300],
85 | shadowColor: Colors.blueGrey[100],
86 | elevation: 5,
87 | child: Center(
88 | child: Text(
89 | 'Skip',
90 | textAlign: TextAlign.center,
91 | style:
92 | GoogleFonts.lato(fontSize: 25, fontWeight: FontWeight.w900),
93 | ),
94 | ),
95 | ),
96 | ),
97 | done: SizedBox(
98 | height: 48,
99 | child: Card(
100 | shape:
101 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
102 | color: Colors.blue[300],
103 | shadowColor: Colors.blueGrey[200],
104 | elevation: 5,
105 | child: Center(
106 | child: Text(
107 | 'Continue',
108 | textAlign: TextAlign.center,
109 | style:
110 | GoogleFonts.lato(fontSize: 15, fontWeight: FontWeight.w900),
111 | ),
112 | ),
113 | ),
114 | ),
115 | onDone: () => _pushPage(context, const FireBaseAuth()),
116 | ),
117 | );
118 | }
119 |
120 | void _pushPage(BuildContext context, Widget page) {
121 | Navigator.of(context).push(
122 | MaterialPageRoute(builder: (_) => page),
123 | );
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/lib/firestore_data/user_details.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:cloud_firestore/cloud_firestore.dart';
4 | import 'package:firebase_auth/firebase_auth.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:google_fonts/google_fonts.dart';
7 | import 'package:health_app/globals.dart';
8 | import 'package:health_app/model/update_user_details.dart';
9 |
10 | class UserDetails extends StatefulWidget {
11 | const UserDetails({Key? key}) : super(key: key);
12 |
13 | @override
14 | State createState() => _UserDetailsState();
15 | }
16 |
17 | class _UserDetailsState extends State {
18 | final FirebaseAuth _auth = FirebaseAuth.instance;
19 | late User user;
20 |
21 | // map of all the details
22 | Map details = {};
23 |
24 | Future _getUser() async {
25 | user = _auth.currentUser!;
26 |
27 | DocumentSnapshot snap = await FirebaseFirestore.instance
28 | .collection(isDoctor ? 'doctor' : 'patient')
29 | .doc(user.uid)
30 | .get();
31 |
32 | setState(() {
33 | details = snap.data() as Map;
34 | });
35 | print(snap.data());
36 | }
37 |
38 | @override
39 | void initState() {
40 | super.initState();
41 | _getUser();
42 | }
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | return Padding(
47 | padding: const EdgeInsets.only(top: 8.0),
48 | child: ListView.builder(
49 | controller: ScrollController(),
50 | shrinkWrap: true,
51 | itemCount: details.length,
52 | itemBuilder: (context, index) {
53 | String key = details.keys.elementAt(index);
54 | String value =
55 | details[key] == null ? 'Not Added' : details[key].toString();
56 | String label = key[0].toUpperCase() + key.substring(1);
57 |
58 | return Container(
59 | margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
60 | child: InkWell(
61 | splashColor: Colors.grey.withOpacity(0.5),
62 | borderRadius: BorderRadius.circular(10),
63 | onTap: () {
64 | Navigator.push(
65 | context,
66 | MaterialPageRoute(
67 | builder: (context) => UpdateUserDetails(
68 | label: label,
69 | field: key,
70 | value: value,
71 | ),
72 | ),
73 | ).then((value) {
74 | // reload page
75 | _getUser();
76 | setState(() {});
77 | });
78 | },
79 | child: Ink(
80 | decoration: BoxDecoration(
81 | borderRadius: BorderRadius.circular(10),
82 | color: Colors.grey[200],
83 | ),
84 | child: Container(
85 | padding: const EdgeInsets.symmetric(horizontal: 14),
86 | height: MediaQuery.of(context).size.height / 14,
87 | width: MediaQuery.of(context).size.width,
88 | child: Row(
89 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
90 | children: [
91 | Text(
92 | label,
93 | style: GoogleFonts.lato(
94 | color: Colors.black,
95 | fontSize: 16,
96 | fontWeight: FontWeight.bold,
97 | ),
98 | ),
99 | Text(
100 | value.substring(0, min(20, value.length)),
101 | style: GoogleFonts.lato(
102 | color: Colors.black54,
103 | fontSize: 15,
104 | fontWeight: FontWeight.bold,
105 | ),
106 | ),
107 | ],
108 | ),
109 | ),
110 | ),
111 | ),
112 | );
113 | },
114 | ),
115 | );
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/lib/screens/disease.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 | import 'package:health_app/screens/diseasedetail.dart';
5 |
6 | class Disease extends StatefulWidget {
7 | const Disease({Key? key}) : super(key: key);
8 |
9 | @override
10 | State createState() => _DiseaseState();
11 | }
12 |
13 | class _DiseaseState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | appBar: AppBar(
18 | backgroundColor: Colors.white,
19 | title: Text(
20 | 'Disease',
21 | style: GoogleFonts.lato(
22 | color: Colors.black,
23 | fontSize: 20,
24 | fontWeight: FontWeight.bold,
25 | ),
26 | ),
27 | iconTheme: const IconThemeData(
28 | color: Colors.black,
29 | ),
30 | ),
31 | body: StreamBuilder(
32 | stream: FirebaseFirestore.instance
33 | .collection('disease')
34 | .orderBy('Name')
35 | .startAt(['']).endAt(['' '\uf8ff']).snapshots(),
36 | builder:
37 | (BuildContext context, AsyncSnapshot snapshot) {
38 | if (!snapshot.hasData) {
39 | return const Center(
40 | child: CircularProgressIndicator(),
41 | );
42 | }
43 | return ListView(
44 | physics: const BouncingScrollPhysics(),
45 | children: snapshot.data!.docs.map((document) {
46 | return Container(
47 | padding:
48 | const EdgeInsets.only(left: 10, right: 10, top: 0),
49 | width: MediaQuery.of(context).size.width,
50 | height: MediaQuery.of(context).size.height / 10,
51 | decoration: const BoxDecoration(
52 | border: Border(
53 | bottom: BorderSide(
54 | color: Colors.black87,
55 | width: 0.2,
56 | ),
57 | ),
58 | ),
59 | child: TextButton(
60 | onPressed: () {
61 | Navigator.push(
62 | context,
63 | MaterialPageRoute(
64 | builder: (context) => DiseaseDetail(
65 | disease: document['Name'],
66 | ),
67 | ),
68 | );
69 | },
70 | child: Row(
71 | children: [
72 | const SizedBox(
73 | width: 20,
74 | ),
75 | Column(
76 | crossAxisAlignment: CrossAxisAlignment.start,
77 | mainAxisAlignment: MainAxisAlignment.center,
78 | children: [
79 | Text(
80 | document['Name'],
81 | style: GoogleFonts.lato(
82 | fontWeight: FontWeight.bold,
83 | fontSize: 16,
84 | color: Colors.black87,
85 | ),
86 | ),
87 | Text(
88 | document['Symtomps'],
89 | style: GoogleFonts.lato(
90 | fontSize: 14, color: Colors.black54),
91 | ),
92 | ],
93 | ),
94 | ],
95 | ),
96 | ));
97 | }).toList(),
98 | );
99 | }));
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.14)
3 | project(health_app LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "health_app")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(SET CMP0063 NEW)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 | # Generated plugin build rules, which manage building the plugins and adding
56 | # them to the application.
57 | include(flutter/generated_plugins.cmake)
58 |
59 |
60 | # === Installation ===
61 | # Support files are copied into place next to the executable, so that it can
62 | # run in place. This is done instead of making a separate bundle (as on Linux)
63 | # so that building and running from within Visual Studio will work.
64 | set(BUILD_BUNDLE_DIR "$")
65 | # Make the "install" step default, as it's required to run.
66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
69 | endif()
70 |
71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
73 |
74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
75 | COMPONENT Runtime)
76 |
77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
78 | COMPONENT Runtime)
79 |
80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
81 | COMPONENT Runtime)
82 |
83 | if(PLUGIN_BUNDLED_LIBRARIES)
84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
86 | COMPONENT Runtime)
87 | endif()
88 |
89 | # Fully re-copy the assets directory on each build to avoid having stale files
90 | # from a previous install.
91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
92 | install(CODE "
93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
94 | " COMPONENT Runtime)
95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
97 |
98 | # Install the AOT library on non-Debug builds only.
99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
100 | CONFIGURATIONS Profile;Release
101 | COMPONENT Runtime)
102 |
--------------------------------------------------------------------------------
/lib/screens/patient/main_page_patient.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 | import 'package:google_nav_bar/google_nav_bar.dart';
5 | import 'package:health_app/screens/chat/chats.dart';
6 | import 'package:health_app/screens/my_profile.dart';
7 | import 'package:health_app/screens/patient/doctor_list.dart';
8 | import 'package:health_app/screens/patient/home_page.dart';
9 | import 'package:health_app/screens/patient/appointments.dart';
10 | import 'package:typicons_flutter/typicons_flutter.dart';
11 |
12 | class MainPagePatient extends StatefulWidget {
13 | const MainPagePatient({Key? key}) : super(key: key);
14 |
15 | @override
16 | State createState() => _MainPagePatientState();
17 | }
18 |
19 | class _MainPagePatientState extends State {
20 | final GlobalKey _scaffoldKey = GlobalKey();
21 | int _selectedIndex = 0;
22 | final List _pages = [
23 | const HomePage(),
24 | const DoctorsList(),
25 | const Appointments(),
26 | const Chats(),
27 | const MyProfile(),
28 | ];
29 |
30 | final FirebaseAuth _auth = FirebaseAuth.instance;
31 | User? user;
32 |
33 | Future _getUser() async {
34 | user = _auth.currentUser;
35 | }
36 |
37 | @override
38 | void initState() {
39 | super.initState();
40 | _getUser();
41 | }
42 |
43 | void _onItemTapped(int index) {
44 | setState(() {
45 | _selectedIndex = index;
46 | });
47 | }
48 |
49 | @override
50 | Widget build(BuildContext context) {
51 | return Container(
52 | color: Colors.white,
53 | child: Scaffold(
54 | backgroundColor: Colors.transparent,
55 | key: _scaffoldKey,
56 | body: _pages[_selectedIndex],
57 | bottomNavigationBar: Container(
58 | decoration: BoxDecoration(
59 | color: Colors.white,
60 | borderRadius: const BorderRadius.only(
61 | topLeft: Radius.circular(20),
62 | topRight: Radius.circular(20),
63 | ),
64 | boxShadow: [
65 | BoxShadow(
66 | blurRadius: 20,
67 | color: Colors.black.withOpacity(.2),
68 | ),
69 | ],
70 | ),
71 | child: SafeArea(
72 | child: Padding(
73 | padding:
74 | const EdgeInsets.symmetric(horizontal: 10.0, vertical: 8),
75 | child: GNav(
76 | curve: Curves.easeOutExpo,
77 | rippleColor: Colors.grey.shade300,
78 | hoverColor: Colors.grey.shade100,
79 | haptic: true,
80 | tabBorderRadius: 20,
81 | gap: 5,
82 | activeColor: Colors.white,
83 | padding:
84 | const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
85 | duration: const Duration(milliseconds: 200),
86 | tabBackgroundColor: Colors.blue.withOpacity(0.7),
87 | textStyle: GoogleFonts.lato(
88 | color: Colors.white,
89 | ),
90 | tabs: const [
91 | GButton(
92 | iconSize: 28,
93 | icon: Icons.home,
94 | // text: 'Home',
95 | ),
96 | GButton(
97 | icon: Icons.search,
98 | // text: 'Search',
99 | ),
100 | GButton(
101 | iconSize: 28,
102 | icon: Typicons.calendar,
103 | // text: 'Appointments',
104 | ),
105 | GButton(
106 | iconSize: 28,
107 | icon: Icons.chat,
108 | // text: 'Chat',
109 | ),
110 | GButton(
111 | iconSize: 28,
112 | icon: Typicons.user,
113 | // text: 'Profile',
114 | ),
115 | ],
116 | selectedIndex: _selectedIndex,
117 | onTabChange: _onItemTapped,
118 | ),
119 | ),
120 | ),
121 | ),
122 | ),
123 | );
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/lib/screens/chat/chats.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:firebase_database/ui/firebase_animated_list.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:google_fonts/google_fonts.dart';
5 | import 'package:health_app/screens/chat/chat_dao.dart';
6 | import 'package:health_app/screens/chat/chat_room.dart';
7 |
8 | class Chats extends StatefulWidget {
9 | const Chats({Key? key}) : super(key: key);
10 |
11 | @override
12 | State createState() => _ChatsState();
13 | }
14 |
15 | class _ChatsState extends State {
16 | final ScrollController _scrollController = ScrollController();
17 | final FirebaseAuth _auth = FirebaseAuth.instance;
18 | late User user;
19 | late var chatDao;
20 |
21 | Future _getUser() async {
22 | user = _auth.currentUser!;
23 | }
24 |
25 | Future _set() async {
26 | chatDao = ChatDao(user.uid);
27 | }
28 |
29 | @override
30 | void initState() {
31 | super.initState();
32 | _getUser();
33 | _set();
34 | setState(() {});
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return SafeArea(
40 | child: Scaffold(
41 | body: Column(
42 | children: [_getChatList()],
43 | ),
44 | ),
45 | );
46 | }
47 |
48 | Widget _getChatList() {
49 | return Expanded(
50 | child: FirebaseAnimatedList(
51 | controller: _scrollController,
52 | query: chatDao.getChatQuery(),
53 | itemBuilder: (context, snapshot, animation, index) {
54 | final json = snapshot.value as Map;
55 | print('ok:' + json.toString());
56 | return ChatCard(
57 | userId: json['uid'] ?? 'No id',
58 | profileUrl: json['photo'] ?? " ",
59 | userName: json['name'] ?? 'Not Set');
60 | },
61 | ),
62 | );
63 | }
64 | }
65 |
66 | class ChatCard extends StatelessWidget {
67 | final String userId;
68 | final String profileUrl;
69 | final String userName;
70 | const ChatCard(
71 | {Key? key,
72 | required this.userId,
73 | required this.profileUrl,
74 | required this.userName})
75 | : super(key: key);
76 |
77 | @override
78 | Widget build(BuildContext context) {
79 | return Container(
80 | padding: const EdgeInsets.symmetric(vertical: 1, horizontal: 14),
81 | child: Card(
82 | color: Colors.blue[50],
83 | elevation: 1,
84 | shape: RoundedRectangleBorder(
85 | borderRadius: BorderRadius.circular(10),
86 | ),
87 | child: Container(
88 | padding: const EdgeInsets.only(left: 10, right: 10),
89 | width: MediaQuery.of(context).size.width,
90 | height: MediaQuery.of(context).size.height / 9,
91 | child: TextButton(
92 | onPressed: () {
93 | Navigator.push(
94 | context,
95 | MaterialPageRoute(
96 | builder: (context) => ChatRoom(
97 | user2Id: userId,
98 | user2Name: userName,
99 | profileUrl: profileUrl),
100 | ),
101 | );
102 | },
103 | child: Row(
104 | crossAxisAlignment: CrossAxisAlignment.center,
105 | //mainAxisAlignment: MainAxisAlignment.spaceAround,
106 | children: [
107 | CircleAvatar(
108 | backgroundImage: NetworkImage(profileUrl),
109 | backgroundColor: Colors.grey[300],
110 | radius: 30,
111 | ),
112 | const SizedBox(
113 | width: 20,
114 | ),
115 | Column(
116 | crossAxisAlignment: CrossAxisAlignment.start,
117 | mainAxisAlignment: MainAxisAlignment.center,
118 | children: [
119 | Text(
120 | userName,
121 | style: GoogleFonts.lato(
122 | fontWeight: FontWeight.bold,
123 | fontSize: 19,
124 | color: Colors.black87,
125 | ),
126 | ),
127 | ],
128 | ),
129 | ],
130 | ),
131 | ),
132 | ),
133 | ),
134 | );
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/lib/model/update_user_details.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:health_app/globals.dart';
6 |
7 | class UpdateUserDetails extends StatefulWidget {
8 | final String label;
9 | final String field;
10 | final String value;
11 | const UpdateUserDetails(
12 | {Key? key, required this.label, required this.field, required this.value})
13 | : super(key: key);
14 |
15 | @override
16 | State createState() => _UpdateUserDetailsState();
17 | }
18 |
19 | class _UpdateUserDetailsState extends State {
20 | final TextEditingController _textcontroller = TextEditingController();
21 | late FocusNode f1;
22 | final FirebaseAuth _auth = FirebaseAuth.instance;
23 | User? user;
24 | String? userID;
25 |
26 | Future _getUser() async {
27 | user = _auth.currentUser!;
28 | userID = user!.uid;
29 | }
30 |
31 | @override
32 | void initState() {
33 | super.initState();
34 | _getUser();
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | _textcontroller.text = widget.value;
40 | return Scaffold(
41 | appBar: AppBar(
42 | backgroundColor: Colors.white,
43 | elevation: 2,
44 | // back button
45 | leading: GestureDetector(
46 | onTap: () {
47 | Navigator.pop(context);
48 | },
49 | child: const Icon(
50 | Icons.arrow_back_ios,
51 | color: Colors.indigo,
52 | ),
53 | ),
54 | title: Container(
55 | alignment: Alignment.centerLeft,
56 | child: Text(
57 | widget.label,
58 | style: GoogleFonts.lato(
59 | color: Colors.indigo,
60 | fontSize: 21,
61 | fontWeight: FontWeight.bold,
62 | ),
63 | ),
64 | ),
65 | ),
66 | body: Padding(
67 | padding: const EdgeInsets.fromLTRB(5, 20, 5, 0),
68 | child: Column(
69 | children: [
70 | Container(
71 | margin: const EdgeInsets.symmetric(horizontal: 15),
72 | child: TextFormField(
73 | controller: _textcontroller,
74 | style: GoogleFonts.lato(
75 | fontSize: 20,
76 | fontWeight: FontWeight.bold,
77 | ),
78 | onFieldSubmitted: (String data) {
79 | _textcontroller.text = data;
80 | },
81 | textInputAction: TextInputAction.done,
82 | validator: (value) {
83 | if (value == null) {
84 | return 'Please Enter the ${widget.label}';
85 | }
86 | return null;
87 | },
88 | ),
89 | ),
90 | const SizedBox(
91 | height: 50,
92 | ),
93 | Container(
94 | padding: const EdgeInsets.symmetric(horizontal: 30),
95 | height: 50,
96 | width: MediaQuery.of(context).size.width,
97 | child: ElevatedButton(
98 | onPressed: () {
99 | FocusScope.of(context).unfocus();
100 | updateData();
101 | Navigator.of(context).pop(context);
102 | },
103 | style: ElevatedButton.styleFrom(
104 | elevation: 2,
105 | primary: Colors.indigo.withOpacity(0.9),
106 | onPrimary: Colors.black,
107 | shape: RoundedRectangleBorder(
108 | borderRadius: BorderRadius.circular(32.0),
109 | ),
110 | ),
111 | child: Text(
112 | 'Update',
113 | style: GoogleFonts.lato(
114 | color: Colors.white,
115 | fontSize: 18,
116 | fontWeight: FontWeight.bold),
117 | ),
118 | ),
119 | )
120 | ],
121 | ),
122 | ),
123 | );
124 | }
125 |
126 | Future updateData() async {
127 | FirebaseFirestore.instance
128 | .collection(isDoctor ? 'doctor' : 'patient')
129 | .doc(userID)
130 | .set({
131 | widget.field: _textcontroller.text,
132 | }, SetOptions(merge: true));
133 | if (widget.field.compareTo('name') == 0) {
134 | await user!.updateDisplayName(_textcontroller.text);
135 | }
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/lib/firestore_data/appointment_history_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:google_fonts/google_fonts.dart';
5 | import 'package:health_app/globals.dart';
6 | import 'package:intl/intl.dart';
7 |
8 | class AppointmentHistoryList extends StatefulWidget {
9 | const AppointmentHistoryList({Key? key}) : super(key: key);
10 |
11 | @override
12 | State createState() => _AppointmentHistoryListState();
13 | }
14 |
15 | class _AppointmentHistoryListState extends State {
16 | final FirebaseAuth _auth = FirebaseAuth.instance;
17 | late User user;
18 | late String _documentID;
19 |
20 | Future _getUser() async {
21 | user = _auth.currentUser!;
22 | }
23 |
24 | String _dateFormatter(String timestamp) {
25 | String formattedDate =
26 | DateFormat('dd-MM-yyyy').format(DateTime.parse(timestamp));
27 | return formattedDate;
28 | }
29 |
30 | Future deleteAppointment(String docID) {
31 | return FirebaseFirestore.instance
32 | .collection('appointments')
33 | .doc(user.uid)
34 | .collection('all')
35 | .doc(docID)
36 | .delete();
37 | }
38 |
39 | @override
40 | void initState() {
41 | super.initState();
42 | _getUser();
43 | }
44 |
45 | @override
46 | Widget build(BuildContext context) {
47 | return Scaffold(
48 | body: SafeArea(
49 | child: StreamBuilder(
50 | stream: FirebaseFirestore.instance
51 | .collection('appointments')
52 | .doc(user.uid)
53 | .collection('all')
54 | .orderBy('date', descending: true)
55 | .snapshots(),
56 | builder:
57 | (BuildContext context, AsyncSnapshot snapshot) {
58 | if (!snapshot.hasData) {
59 | return const Center(
60 | child: CircularProgressIndicator(),
61 | );
62 | }
63 | return snapshot.data!.size == 0
64 | ? Text(
65 | 'History Appears here...',
66 | style: GoogleFonts.lato(
67 | color: Colors.grey,
68 | fontSize: 18,
69 | ),
70 | )
71 | : ListView.builder(
72 | scrollDirection: Axis.vertical,
73 | physics: const ClampingScrollPhysics(),
74 | shrinkWrap: true,
75 | itemCount: snapshot.data!.size,
76 | itemBuilder: (context, index) {
77 | DocumentSnapshot document = snapshot.data!.docs[index];
78 | return Column(
79 | crossAxisAlignment: CrossAxisAlignment.start,
80 | children: [
81 | Container(
82 | margin: const EdgeInsets.fromLTRB(5, 5, 5, 0),
83 | padding: const EdgeInsets.only(left: 10, top: 5),
84 | height: 70,
85 | width: MediaQuery.of(context).size.width,
86 | decoration: BoxDecoration(
87 | borderRadius: BorderRadius.circular(5),
88 | color: Colors.blueGrey[50],
89 | ),
90 | child: Column(
91 | crossAxisAlignment: CrossAxisAlignment.start,
92 | children: [
93 | // doctor name
94 | Text(
95 | '${index + 1}. ${isDoctor ? '${document['patientName']}' : '${document['doctorName']}'}',
96 | style: GoogleFonts.lato(
97 | fontSize: 15,
98 | ),
99 | ),
100 | // date
101 | Text(
102 | _dateFormatter(
103 | document['date'].toDate().toString()),
104 | style: GoogleFonts.lato(
105 | fontSize: 12,
106 | fontWeight: FontWeight.bold),
107 | ),
108 | // reason
109 | Text(
110 | document['description'] ?? 'No description')
111 | ],
112 | ),
113 | ),
114 | const SizedBox(
115 | height: 10,
116 | ),
117 | ],
118 | );
119 | },
120 | );
121 | },
122 | ),
123 | ),
124 | );
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/lib/screens/patient/doctor_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 | import 'package:health_app/firestore_data/search_list.dart';
4 |
5 | class DoctorsList extends StatefulWidget {
6 | const DoctorsList({Key? key}) : super(key: key);
7 |
8 | @override
9 | State createState() => _DoctorsListState();
10 | }
11 |
12 | class _DoctorsListState extends State {
13 | final TextEditingController _textController = TextEditingController();
14 | late String search;
15 | var _length = 0;
16 |
17 | @override
18 | void initState() {
19 | super.initState();
20 | search = _textController.text;
21 | _length = search.length;
22 | }
23 |
24 | @override
25 | void dispose() {
26 | _textController.dispose();
27 | super.dispose();
28 | }
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return Scaffold(
33 | appBar: AppBar(
34 | backgroundColor: Colors.white,
35 | title: const Text('Find Doctors'),
36 | actions: [
37 | SafeArea(
38 | child: Container(
39 | padding: const EdgeInsets.symmetric(vertical: 7, horizontal: 15),
40 | width: MediaQuery.of(context).size.width,
41 | child: TextFormField(
42 | textCapitalization: TextCapitalization.words,
43 | controller: _textController,
44 | decoration: InputDecoration(
45 | contentPadding:
46 | const EdgeInsets.only(left: 20, top: 10, bottom: 10),
47 | border: OutlineInputBorder(
48 | borderRadius: BorderRadius.circular(10),
49 | borderSide: BorderSide.none,
50 | ),
51 | filled: true,
52 | fillColor: Colors.grey[300],
53 | hintText: 'Search Doctor',
54 | hintStyle: GoogleFonts.lato(
55 | color: Colors.black26,
56 | fontSize: 18,
57 | fontWeight: FontWeight.w800,
58 | ),
59 | prefixIcon: const Icon(
60 | Icons.search,
61 | size: 20,
62 | ),
63 | prefixStyle: TextStyle(
64 | color: Colors.grey[300],
65 | ),
66 | suffixIcon: _textController.text.isNotEmpty
67 | ? TextButton(
68 | onPressed: () {
69 | setState(() {
70 | _textController.clear();
71 | _length = search.length;
72 | });
73 | },
74 | child: const Icon(
75 | Icons.close_rounded,
76 | size: 20,
77 | ),
78 | )
79 | : const SizedBox(),
80 | ),
81 | // onFieldSubmitted: (String _searchKey) {
82 | // setState(
83 | // () {
84 | // print('>>>' + _searchKey);
85 | // search = _searchKey;
86 | // },
87 | // );
88 | // },
89 | onChanged: (String searchKey) {
90 | setState(
91 | () {
92 | print('>>>$searchKey');
93 | search = searchKey;
94 | _length = search.length;
95 | },
96 | );
97 | },
98 | style: GoogleFonts.lato(
99 | fontSize: 18,
100 | fontWeight: FontWeight.bold,
101 | ),
102 | textInputAction: TextInputAction.search,
103 | autofocus: false,
104 | ),
105 | ),
106 | )
107 | ],
108 | ),
109 | body: Container(
110 | padding: const EdgeInsets.all(10),
111 | child: _length == 0
112 | ? Center(
113 | child: Column(
114 | mainAxisAlignment: MainAxisAlignment.center,
115 | children: [
116 | TextButton(
117 | onPressed: () {
118 | setState(() {
119 | _length = 1;
120 | });
121 | },
122 | child: Text(
123 | 'Show All',
124 | style: GoogleFonts.lato(
125 | fontSize: 18,
126 | fontWeight: FontWeight.bold,
127 | ),
128 | ),
129 | ),
130 | const Image(image: AssetImage('assets/search-bg.png')),
131 | ],
132 | ),
133 | )
134 | : SearchList(
135 | searchKey: search,
136 | ),
137 | ),
138 | );
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/lib/firestore_data/top_rated_list.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:cloud_firestore/cloud_firestore.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:google_fonts/google_fonts.dart';
6 | import 'package:health_app/screens/patient/doctor_profile.dart';
7 | import 'package:typicons_flutter/typicons_flutter.dart';
8 |
9 | class TopRatedList extends StatefulWidget {
10 | const TopRatedList({Key? key}) : super(key: key);
11 |
12 | @override
13 | State createState() => _TopRatedListState();
14 | }
15 |
16 | class _TopRatedListState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return SafeArea(
20 | child: StreamBuilder(
21 | stream: FirebaseFirestore.instance
22 | .collection('doctor')
23 | .orderBy('rating', descending: true)
24 | .snapshots(),
25 | builder: (BuildContext context, AsyncSnapshot snapshot) {
26 | if (!snapshot.hasData) {
27 | return const Center(
28 | child: CircularProgressIndicator(),
29 | );
30 | }
31 | return ListView.builder(
32 | scrollDirection: Axis.vertical,
33 | physics: const ClampingScrollPhysics(),
34 | shrinkWrap: true,
35 | itemCount: min(5, snapshot.data!.docs.length),
36 | itemBuilder: (context, index) {
37 | DocumentSnapshot doctor = snapshot.data!.docs[index];
38 | return Padding(
39 | padding: const EdgeInsets.only(top: 3.0),
40 | child: Card(
41 | color: Colors.blue[50],
42 | elevation: 0,
43 | shape: RoundedRectangleBorder(
44 | borderRadius: BorderRadius.circular(10),
45 | ),
46 | child: Container(
47 | padding: const EdgeInsets.only(left: 10, right: 10, top: 0),
48 | width: MediaQuery.of(context).size.width,
49 | height: MediaQuery.of(context).size.height / 9,
50 | child: TextButton(
51 | onPressed: () {
52 | Navigator.push(
53 | context,
54 | MaterialPageRoute(
55 | builder: (context) => DoctorProfile(
56 | doctor: doctor['name'],
57 | ),
58 | ),
59 | );
60 | },
61 | child: Row(
62 | crossAxisAlignment: CrossAxisAlignment.center,
63 | //mainAxisAlignment: MainAxisAlignment.spaceAround,
64 | children: [
65 | CircleAvatar(
66 | backgroundImage:
67 | NetworkImage(doctor['profilePhoto'] ?? ''),
68 | backgroundColor: Colors.blue,
69 | radius: 25,
70 | ),
71 | const SizedBox(
72 | width: 20,
73 | ),
74 | Column(
75 | crossAxisAlignment: CrossAxisAlignment.start,
76 | mainAxisAlignment: MainAxisAlignment.center,
77 | children: [
78 | Text(
79 | doctor['name'],
80 | style: GoogleFonts.lato(
81 | fontWeight: FontWeight.bold,
82 | fontSize: 17,
83 | color: Colors.black87,
84 | ),
85 | ),
86 | Text(
87 | doctor['specialization'],
88 | style: GoogleFonts.lato(
89 | fontSize: 16, color: Colors.black54),
90 | ),
91 | ],
92 | ),
93 | const SizedBox(
94 | width: 10,
95 | ),
96 | Expanded(
97 | child: Container(
98 | alignment: Alignment.centerRight,
99 | child: Row(
100 | crossAxisAlignment: CrossAxisAlignment.end,
101 | mainAxisAlignment: MainAxisAlignment.end,
102 | children: [
103 | Icon(
104 | Typicons.star_full_outline,
105 | size: 20,
106 | color: Colors.indigo[400],
107 | ),
108 | const SizedBox(
109 | width: 3,
110 | ),
111 | Text(
112 | doctor['rating'].toString(),
113 | style: GoogleFonts.lato(
114 | fontWeight: FontWeight.bold,
115 | fontSize: 15,
116 | color: Colors.indigo,
117 | ),
118 | ),
119 | ],
120 | ),
121 | ),
122 | ),
123 | ],
124 | ),
125 | ),
126 | ),
127 | ),
128 | );
129 | },
130 | );
131 | },
132 | ),
133 | );
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/lib/screens/firebase_auth.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_fonts/google_fonts.dart';
3 |
4 | import 'register.dart';
5 | import 'sign_in.dart';
6 |
7 | class FireBaseAuth extends StatefulWidget {
8 | const FireBaseAuth({Key? key}) : super(key: key);
9 |
10 | @override
11 | State createState() => _FireBaseAuthState();
12 |
13 | // void out2(BuildContext context) {
14 | // Navigator.pop(context);
15 | // }
16 | }
17 |
18 | class _FireBaseAuthState extends State {
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | body: Stack(
23 | children: [
24 | Container(
25 | constraints: const BoxConstraints.expand(),
26 | decoration: const BoxDecoration(
27 | image: DecorationImage(
28 | image: AssetImage(
29 | "assets/image-medical.jpg",
30 | ),
31 | fit: BoxFit.cover,
32 | ),
33 | ),
34 | ),
35 | SafeArea(
36 | child: Align(
37 | alignment: Alignment.topCenter,
38 | child: Container(
39 | alignment: Alignment.topLeft,
40 | padding: const EdgeInsets.only(top: 80.0, left: 25),
41 | child: Column(
42 | crossAxisAlignment: CrossAxisAlignment.start,
43 | children: [
44 | Text(
45 | 'HELLO',
46 | style: GoogleFonts.b612(
47 | color: Colors.black,
48 | fontSize: 50,
49 | fontWeight: FontWeight.w700),
50 | ),
51 | Text(
52 | 'Welcome to Medico!',
53 | style: GoogleFonts.b612(
54 | color: Colors.indigo[800],
55 | fontSize: 17,
56 | fontWeight: FontWeight.w400),
57 | ),
58 | ],
59 | ),
60 | ),
61 | ),
62 | ),
63 | SafeArea(
64 | child: Align(
65 | alignment: Alignment.bottomCenter,
66 | child: Column(
67 | mainAxisAlignment: MainAxisAlignment.end,
68 | children: [
69 | Container(
70 | height: 220,
71 | decoration: BoxDecoration(
72 | color: Colors.black26.withOpacity(0.25),
73 | borderRadius: BorderRadius.circular(20),
74 | ),
75 | child: Column(
76 | crossAxisAlignment: CrossAxisAlignment.center,
77 | mainAxisAlignment: MainAxisAlignment.center,
78 | children: [
79 | Container(
80 | width: MediaQuery.of(context).size.width / 1.1,
81 | padding: const EdgeInsets.all(16),
82 | alignment: Alignment.center,
83 | child: SizedBox(
84 | width: double.infinity,
85 | height: 50.0,
86 | child: ElevatedButton(
87 | onPressed: () => _pushPage(context, const SignIn()),
88 | style: ElevatedButton.styleFrom(
89 | elevation: 2,
90 | primary: Colors.indigo[800],
91 | onPrimary: Colors.indigo[800],
92 | shape: RoundedRectangleBorder(
93 |
94 | borderRadius: BorderRadius.circular(32.0),
95 | ),
96 | ),
97 | child: Text(
98 | "Sign in",
99 | style: GoogleFonts.lato(
100 | color: Colors.white,
101 | fontSize: 18.0,
102 | fontWeight: FontWeight.bold,
103 | ),
104 | ),
105 | ),
106 | ),
107 | ),
108 | Container(
109 | width: MediaQuery.of(context).size.width / 1.1,
110 | padding: const EdgeInsets.all(16),
111 | alignment: Alignment.center,
112 | child: SizedBox(
113 | width: double.infinity,
114 | height: 50.0,
115 | child: ElevatedButton(
116 | onPressed: () => _pushPage(context, const Register()),
117 | style: ElevatedButton.styleFrom(
118 | elevation: 2,
119 | primary: Colors.white,
120 | onPrimary: Colors.white,
121 | shape: RoundedRectangleBorder(
122 |
123 | borderRadius: BorderRadius.circular(32.0),
124 | ),
125 | ),
126 | child: Text(
127 | "Create an Account",
128 | style: GoogleFonts.lato(
129 | color: Colors.black,
130 | fontSize: 18.0,
131 | fontWeight: FontWeight.bold,
132 | ),
133 | ),
134 | ),
135 | ),
136 | ),
137 |
138 | ],
139 | ),
140 | ),
141 | const SizedBox(
142 | height: 80,
143 | ),
144 | ],
145 | ),
146 | ),
147 | ),
148 | ],
149 | ), //<--
150 | );
151 | }
152 |
153 | void _pushPage(BuildContext context, Widget page) {
154 | Navigator.of(context).push(
155 | MaterialPageRoute(builder: (_) => page),
156 | );
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/lib/screens/explore_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 | import 'package:health_app/screens/patient/doctor_profile.dart';
5 | import 'package:typicons_flutter/typicons_flutter.dart';
6 |
7 | class ExploreList extends StatefulWidget {
8 | final String type;
9 | const ExploreList({Key? key, required this.type}) : super(key: key);
10 |
11 | @override
12 | State createState() => _ExploreListState();
13 | }
14 |
15 | class _ExploreListState extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | backgroundColor: Colors.white,
21 | title: Text(
22 | '${widget.type}s',
23 | style: GoogleFonts.lato(
24 | color: Colors.black,
25 | fontSize: 20,
26 | fontWeight: FontWeight.bold,
27 | ),
28 | ),
29 | iconTheme: const IconThemeData(
30 | color: Colors.black,
31 | ),
32 | ),
33 | body: Padding(
34 | padding: const EdgeInsets.only(top: 10),
35 | child: StreamBuilder(
36 | stream: FirebaseFirestore.instance
37 | .collection('doctor')
38 | .orderBy('specialization')
39 | .startAt([widget.type]).endAt(
40 | ['${widget.type}\uf8ff']).snapshots(),
41 | builder:
42 | (BuildContext context, AsyncSnapshot snapshot) {
43 | if (!snapshot.hasData) {
44 | return const Center(
45 | child: CircularProgressIndicator(),
46 | );
47 | }
48 | return ListView.builder(
49 | scrollDirection: Axis.vertical,
50 | physics: const ClampingScrollPhysics(),
51 | shrinkWrap: true,
52 | itemCount: snapshot.data!.size,
53 | itemBuilder: (context, index) {
54 | DocumentSnapshot doctor = snapshot.data!.docs[index];
55 | return Padding(
56 | padding: const EdgeInsets.symmetric(horizontal: 10),
57 | child: Card(
58 | color: Colors.blue[50],
59 | elevation: 0,
60 | shape: RoundedRectangleBorder(
61 | borderRadius: BorderRadius.circular(10),
62 | ),
63 | child: Container(
64 | padding: const EdgeInsets.only(left: 10, right: 10),
65 | width: MediaQuery.of(context).size.width,
66 | height: MediaQuery.of(context).size.height / 9,
67 | child: TextButton(
68 | onPressed: () {
69 | Navigator.push(
70 | context,
71 | MaterialPageRoute(
72 | builder: (context) => DoctorProfile(
73 | doctor: doctor['name'],
74 | ),
75 | ),
76 | );
77 | },
78 | child: Row(
79 | crossAxisAlignment: CrossAxisAlignment.center,
80 | //mainAxisAlignment: MainAxisAlignment.spaceAround,
81 | children: [
82 | CircleAvatar(
83 | backgroundImage:
84 | NetworkImage(doctor['profilePhoto']),
85 | backgroundColor: Colors.blue,
86 | radius: 25,
87 | ),
88 | const SizedBox(
89 | width: 20,
90 | ),
91 | Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.center,
94 | children: [
95 | Text(
96 | doctor['name'],
97 | style: GoogleFonts.lato(
98 | fontWeight: FontWeight.bold,
99 | fontSize: 17,
100 | color: Colors.black87,
101 | ),
102 | ),
103 | Text(
104 | doctor['specialization'],
105 | style: GoogleFonts.lato(
106 | fontSize: 16, color: Colors.black54),
107 | ),
108 | ],
109 | ),
110 | const SizedBox(
111 | width: 10,
112 | ),
113 | Expanded(
114 | child: Container(
115 | alignment: Alignment.centerRight,
116 | child: Row(
117 | crossAxisAlignment: CrossAxisAlignment.end,
118 | mainAxisAlignment: MainAxisAlignment.end,
119 | children: [
120 | Icon(
121 | Typicons.star_full_outline,
122 | size: 20,
123 | color: Colors.indigo[400],
124 | ),
125 | const SizedBox(
126 | width: 3,
127 | ),
128 | Text(
129 | doctor['rating'].toString(),
130 | style: GoogleFonts.lato(
131 | fontWeight: FontWeight.bold,
132 | fontSize: 15,
133 | color: Colors.indigo,
134 | ),
135 | ),
136 | ],
137 | ),
138 | ),
139 | ),
140 | ],
141 | ),
142 | ),
143 | ),
144 | ),
145 | );
146 | },
147 | );
148 | },
149 | ),
150 | ),
151 | );
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/lib/screens/chat/chat_room.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:math';
3 |
4 | import 'package:firebase_auth/firebase_auth.dart';
5 | import 'package:firebase_database/ui/firebase_animated_list.dart';
6 | import 'package:flutter/material.dart';
7 |
8 | import 'message.dart';
9 | import 'message_dao.dart';
10 |
11 | class ChatRoom extends StatefulWidget {
12 | final String user2Id;
13 | final String user2Name;
14 | String defaultProfileUrl =
15 | 'https://cdn.icon-icons.com/icons2/1378/PNG/512/avatardefault_92824.png';
16 | final String profileUrl;
17 |
18 | ChatRoom(
19 | {Key? key,
20 | required this.user2Id,
21 | required this.user2Name,
22 | required this.profileUrl})
23 | : super(key: key);
24 |
25 | ////////////////////////////////////////
26 | // final chatRoomId = "";
27 |
28 | @override
29 | State createState() => _ChatRoomState();
30 | }
31 |
32 | class _ChatRoomState extends State {
33 | final TextEditingController _messageController = TextEditingController();
34 | final ScrollController _scrollController = ScrollController();
35 |
36 | final FirebaseAuth _auth = FirebaseAuth.instance;
37 | late User user;
38 | late var messageDao;
39 |
40 | Future _getUser() async {
41 | user = _auth.currentUser!;
42 | }
43 |
44 | Future _setChatRoomId() async {
45 | messageDao = MessageDao(user1: user.uid, user2: widget.user2Id);
46 | }
47 |
48 | bool _canSendMessage() {
49 | return _messageController.text.isNotEmpty;
50 | }
51 |
52 | void _sendMessage() {
53 | if (_canSendMessage()) {
54 | var currTime = DateTime.now().toUtc().toString();
55 | final message = Message(
56 | message: _messageController.text, senderId: user.uid, time: currTime);
57 | messageDao.saveMessage(message);
58 | _messageController.clear();
59 | setState(() {});
60 | }
61 | }
62 |
63 | @override
64 | void initState() {
65 | super.initState();
66 | _getUser();
67 | _setChatRoomId();
68 | setState(() {});
69 | }
70 |
71 | @override
72 | Widget build(BuildContext context) {
73 | return Scaffold(
74 | // app bar with back button, profile picture, and name, and call button
75 | appBar: AppBar(
76 | leading: IconButton(
77 | icon: const Icon(Icons.arrow_back),
78 | onPressed: () => Navigator.pop(context),
79 | ),
80 | title: Row(
81 | children: [
82 | CircleAvatar(
83 | backgroundImage: NetworkImage(widget.profileUrl),
84 | ),
85 | const SizedBox(width: 10),
86 | // prevent over flow text if name is too long
87 | Text(
88 | widget.user2Name.substring(0, min(widget.user2Name.length, 12)),
89 | ),
90 | ],
91 | ),
92 | actions: [
93 | IconButton(
94 | icon: const Icon(Icons.call),
95 | onPressed: () {},
96 | ),
97 | IconButton(
98 | icon: const Icon(Icons.videocam),
99 | onPressed: () {},
100 | ),
101 | IconButton(
102 | icon: const Icon(Icons.more_vert),
103 | onPressed: () {},
104 | ),
105 | ],
106 | ),
107 |
108 | // body with messages
109 | body: Column(children: [_getMessageList()]),
110 |
111 | // type message and send button
112 | bottomSheet: BottomAppBar(
113 | child: SizedBox(
114 | height: 50,
115 | child: Row(
116 | children: [
117 | IconButton(
118 | icon: const Icon(Icons.attach_file),
119 | onPressed: () {},
120 | ),
121 | Expanded(
122 | child: Container(
123 | margin: const EdgeInsets.symmetric(horizontal: 10),
124 | decoration: BoxDecoration(
125 | borderRadius: BorderRadius.circular(30),
126 | color: Colors.grey[200],
127 | ),
128 | child: Row(
129 | children: [
130 | const SizedBox(width: 10),
131 | const Icon(Icons.insert_emoticon),
132 | const SizedBox(width: 10),
133 | Expanded(
134 | child: TextField(
135 | controller: _messageController,
136 | keyboardType: TextInputType.text,
137 | decoration: const InputDecoration(
138 | border: InputBorder.none,
139 | hintText: 'Type a message',
140 | ),
141 | ),
142 | ),
143 | IconButton(
144 | icon: const Icon(Icons.send),
145 | onPressed: () {
146 | _sendMessage();
147 | }),
148 | ],
149 | ),
150 | ),
151 | ),
152 | ],
153 | ),
154 | ),
155 | ),
156 | );
157 | }
158 |
159 | Widget _getMessageList() {
160 | return Expanded(
161 | child: FirebaseAnimatedList(
162 | controller: _scrollController,
163 | query: messageDao.getMessageQuery(),
164 | itemBuilder: (context, snapshot, animation, index) {
165 | final json = snapshot.value as Map;
166 | final message = Message.fromJson(json);
167 | return MessageWidget(
168 | message: message.message,
169 | time: message.time,
170 | isMe: message.senderId == user.uid);
171 | },
172 | ),
173 | );
174 | }
175 | }
176 |
177 | class MessageWidget extends StatelessWidget {
178 | final String message;
179 | final String time;
180 | final bool isMe;
181 | const MessageWidget(
182 | {Key? key, required this.message, required this.time, required this.isMe})
183 | : super(key: key);
184 |
185 | @override
186 | Widget build(BuildContext context) {
187 | // final size = msg.length;
188 |
189 | return Container(
190 | alignment: isMe ? Alignment.centerRight : Alignment.centerLeft,
191 | // margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
192 |
193 | child: Container(
194 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14),
195 | // margin: const EdgeInsets.symmetric(vertical: 5, horizontal: 8),
196 | margin: EdgeInsets.fromLTRB(isMe ? 60 : 8, 5, isMe ? 8 : 60, 5),
197 | decoration: BoxDecoration(
198 | // borderRadius: BorderRadius.circular(15),
199 | borderRadius: BorderRadius.only(
200 | topLeft: isMe ? const Radius.circular(15) : Radius.zero,
201 | topRight: isMe ? Radius.zero : const Radius.circular(15),
202 | bottomLeft: const Radius.circular(15),
203 | bottomRight: const Radius.circular(15),
204 | ),
205 | color: isMe ? Colors.blue[300] : Colors.grey[300],
206 | ),
207 | child: Text(
208 | message,
209 | style: const TextStyle(
210 | fontSize: 16,
211 | ),
212 | ),
213 | ),
214 | );
215 | }
216 | }
217 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.cpp:
--------------------------------------------------------------------------------
1 | #include "win32_window.h"
2 |
3 | #include
4 |
5 | #include "resource.h"
6 |
7 | namespace {
8 |
9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
10 |
11 | // The number of Win32Window objects that currently exist.
12 | static int g_active_window_count = 0;
13 |
14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
15 |
16 | // Scale helper to convert logical scaler values to physical using passed in
17 | // scale factor
18 | int Scale(int source, double scale_factor) {
19 | return static_cast(source * scale_factor);
20 | }
21 |
22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
23 | // This API is only needed for PerMonitor V1 awareness mode.
24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) {
25 | HMODULE user32_module = LoadLibraryA("User32.dll");
26 | if (!user32_module) {
27 | return;
28 | }
29 | auto enable_non_client_dpi_scaling =
30 | reinterpret_cast(
31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
32 | if (enable_non_client_dpi_scaling != nullptr) {
33 | enable_non_client_dpi_scaling(hwnd);
34 | FreeLibrary(user32_module);
35 | }
36 | }
37 |
38 | } // namespace
39 |
40 | // Manages the Win32Window's window class registration.
41 | class WindowClassRegistrar {
42 | public:
43 | ~WindowClassRegistrar() = default;
44 |
45 | // Returns the singleton registar instance.
46 | static WindowClassRegistrar* GetInstance() {
47 | if (!instance_) {
48 | instance_ = new WindowClassRegistrar();
49 | }
50 | return instance_;
51 | }
52 |
53 | // Returns the name of the window class, registering the class if it hasn't
54 | // previously been registered.
55 | const wchar_t* GetWindowClass();
56 |
57 | // Unregisters the window class. Should only be called if there are no
58 | // instances of the window.
59 | void UnregisterWindowClass();
60 |
61 | private:
62 | WindowClassRegistrar() = default;
63 |
64 | static WindowClassRegistrar* instance_;
65 |
66 | bool class_registered_ = false;
67 | };
68 |
69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
70 |
71 | const wchar_t* WindowClassRegistrar::GetWindowClass() {
72 | if (!class_registered_) {
73 | WNDCLASS window_class{};
74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
75 | window_class.lpszClassName = kWindowClassName;
76 | window_class.style = CS_HREDRAW | CS_VREDRAW;
77 | window_class.cbClsExtra = 0;
78 | window_class.cbWndExtra = 0;
79 | window_class.hInstance = GetModuleHandle(nullptr);
80 | window_class.hIcon =
81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
82 | window_class.hbrBackground = 0;
83 | window_class.lpszMenuName = nullptr;
84 | window_class.lpfnWndProc = Win32Window::WndProc;
85 | RegisterClass(&window_class);
86 | class_registered_ = true;
87 | }
88 | return kWindowClassName;
89 | }
90 |
91 | void WindowClassRegistrar::UnregisterWindowClass() {
92 | UnregisterClass(kWindowClassName, nullptr);
93 | class_registered_ = false;
94 | }
95 |
96 | Win32Window::Win32Window() {
97 | ++g_active_window_count;
98 | }
99 |
100 | Win32Window::~Win32Window() {
101 | --g_active_window_count;
102 | Destroy();
103 | }
104 |
105 | bool Win32Window::CreateAndShow(const std::wstring& title,
106 | const Point& origin,
107 | const Size& size) {
108 | Destroy();
109 |
110 | const wchar_t* window_class =
111 | WindowClassRegistrar::GetInstance()->GetWindowClass();
112 |
113 | const POINT target_point = {static_cast(origin.x),
114 | static_cast(origin.y)};
115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
117 | double scale_factor = dpi / 96.0;
118 |
119 | HWND window = CreateWindow(
120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor),
123 | nullptr, nullptr, GetModuleHandle(nullptr), this);
124 |
125 | if (!window) {
126 | return false;
127 | }
128 |
129 | return OnCreate();
130 | }
131 |
132 | // static
133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window,
134 | UINT const message,
135 | WPARAM const wparam,
136 | LPARAM const lparam) noexcept {
137 | if (message == WM_NCCREATE) {
138 | auto window_struct = reinterpret_cast(lparam);
139 | SetWindowLongPtr(window, GWLP_USERDATA,
140 | reinterpret_cast(window_struct->lpCreateParams));
141 |
142 | auto that = static_cast(window_struct->lpCreateParams);
143 | EnableFullDpiSupportIfAvailable(window);
144 | that->window_handle_ = window;
145 | } else if (Win32Window* that = GetThisFromHandle(window)) {
146 | return that->MessageHandler(window, message, wparam, lparam);
147 | }
148 |
149 | return DefWindowProc(window, message, wparam, lparam);
150 | }
151 |
152 | LRESULT
153 | Win32Window::MessageHandler(HWND hwnd,
154 | UINT const message,
155 | WPARAM const wparam,
156 | LPARAM const lparam) noexcept {
157 | switch (message) {
158 | case WM_DESTROY:
159 | window_handle_ = nullptr;
160 | Destroy();
161 | if (quit_on_close_) {
162 | PostQuitMessage(0);
163 | }
164 | return 0;
165 |
166 | case WM_DPICHANGED: {
167 | auto newRectSize = reinterpret_cast(lparam);
168 | LONG newWidth = newRectSize->right - newRectSize->left;
169 | LONG newHeight = newRectSize->bottom - newRectSize->top;
170 |
171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
173 |
174 | return 0;
175 | }
176 | case WM_SIZE: {
177 | RECT rect = GetClientArea();
178 | if (child_content_ != nullptr) {
179 | // Size and position the child window.
180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
181 | rect.bottom - rect.top, TRUE);
182 | }
183 | return 0;
184 | }
185 |
186 | case WM_ACTIVATE:
187 | if (child_content_ != nullptr) {
188 | SetFocus(child_content_);
189 | }
190 | return 0;
191 | }
192 |
193 | return DefWindowProc(window_handle_, message, wparam, lparam);
194 | }
195 |
196 | void Win32Window::Destroy() {
197 | OnDestroy();
198 |
199 | if (window_handle_) {
200 | DestroyWindow(window_handle_);
201 | window_handle_ = nullptr;
202 | }
203 | if (g_active_window_count == 0) {
204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
205 | }
206 | }
207 |
208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
209 | return reinterpret_cast(
210 | GetWindowLongPtr(window, GWLP_USERDATA));
211 | }
212 |
213 | void Win32Window::SetChildContent(HWND content) {
214 | child_content_ = content;
215 | SetParent(content, window_handle_);
216 | RECT frame = GetClientArea();
217 |
218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
219 | frame.bottom - frame.top, true);
220 |
221 | SetFocus(child_content_);
222 | }
223 |
224 | RECT Win32Window::GetClientArea() {
225 | RECT frame;
226 | GetClientRect(window_handle_, &frame);
227 | return frame;
228 | }
229 |
230 | HWND Win32Window::GetHandle() {
231 | return window_handle_;
232 | }
233 |
234 | void Win32Window::SetQuitOnClose(bool quit_on_close) {
235 | quit_on_close_ = quit_on_close;
236 | }
237 |
238 | bool Win32Window::OnCreate() {
239 | // No-op; provided for subclasses.
240 | return true;
241 | }
242 |
243 | void Win32Window::OnDestroy() {
244 | // No-op; provided for subclasses.
245 | }
246 |
--------------------------------------------------------------------------------
/lib/screens/diseasedetail.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 |
5 | class DiseaseDetail extends StatefulWidget {
6 | final String disease;
7 |
8 | const DiseaseDetail({Key? key, required this.disease}) : super(key: key);
9 | @override
10 | State createState() => _DiseaseDetailState();
11 | }
12 |
13 | class _DiseaseDetailState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | backgroundColor: Colors.white,
18 | appBar: AppBar(
19 | iconTheme: const IconThemeData(color: Colors.black),
20 | backgroundColor: Colors.white,
21 | elevation: 0,
22 | title: Text(
23 | widget.disease,
24 | style: GoogleFonts.lato(color: Colors.black),
25 | ),
26 | ),
27 | body: StreamBuilder(
28 | stream: FirebaseFirestore.instance
29 | .collection('disease')
30 | .orderBy('Name')
31 | .startAt([widget.disease]).endAt(
32 | ['${widget.disease}\uf8ff']).snapshots(),
33 | builder:
34 | (BuildContext context, AsyncSnapshot snapshot) {
35 | if (!snapshot.hasData) {
36 | return const Center(
37 | child: CircularProgressIndicator(),
38 | );
39 | }
40 | return ListView(
41 | physics: const ClampingScrollPhysics(),
42 | children: snapshot.data!.docs.map((document) {
43 | return Container(
44 | margin: const EdgeInsets.only(top: 10),
45 | child: Column(
46 | children: [
47 | const SizedBox(
48 | height: 20,
49 | ),
50 | Container(
51 | margin: const EdgeInsets.only(left: 15, right: 15),
52 | padding: const EdgeInsets.only(left: 20, right: 20),
53 | alignment: Alignment.centerLeft,
54 | decoration: BoxDecoration(
55 | borderRadius: BorderRadius.circular(10),
56 | color: Colors.blueGrey[50],
57 | ),
58 | child: Text(
59 | document['Description'],
60 | style: GoogleFonts.lato(
61 | color: Colors.black54, fontSize: 18),
62 | )),
63 | const SizedBox(
64 | height: 20,
65 | ),
66 | Container(
67 | margin: const EdgeInsets.only(left: 15, right: 15),
68 | padding: const EdgeInsets.only(left: 20, right: 20),
69 | alignment: Alignment.centerLeft,
70 | decoration: BoxDecoration(
71 | borderRadius: BorderRadius.circular(10),
72 | color: Colors.blueGrey[50],
73 | ),
74 | child: Column(
75 | crossAxisAlignment: CrossAxisAlignment.start,
76 | children: [
77 | Text(
78 | 'How does it spread?',
79 | style: GoogleFonts.lato(
80 | color: Colors.black87,
81 | fontSize: 20,
82 | fontWeight: FontWeight.bold),
83 | textAlign: TextAlign.left,
84 | ),
85 | const SizedBox(
86 | height: 15,
87 | ),
88 | Text(
89 | document['Spread'],
90 | style: GoogleFonts.lato(
91 | color: Colors.black54,
92 | fontSize: 18,
93 | ),
94 | )
95 | ],
96 | )),
97 | const SizedBox(
98 | height: 20,
99 | ),
100 | Container(
101 | margin: const EdgeInsets.only(left: 15, right: 15),
102 | padding: const EdgeInsets.only(left: 20, right: 20),
103 | alignment: Alignment.centerLeft,
104 | decoration: BoxDecoration(
105 | borderRadius: BorderRadius.circular(10),
106 | color: Colors.blueGrey[50],
107 | ),
108 | child: Column(
109 | crossAxisAlignment: CrossAxisAlignment.start,
110 | children: [
111 | Text(
112 | 'Symtomps',
113 | style: GoogleFonts.lato(
114 | color: Colors.black87,
115 | fontSize: 20,
116 | fontWeight: FontWeight.bold),
117 | textAlign: TextAlign.left,
118 | ),
119 | const SizedBox(
120 | height: 15,
121 | ),
122 | Text(
123 | document['Symtomps'],
124 | style: GoogleFonts.lato(
125 | color: Colors.black54,
126 | fontSize: 18,
127 | ),
128 | )
129 | ],
130 | )),
131 | const SizedBox(
132 | height: 20,
133 | ),
134 | Container(
135 | margin: const EdgeInsets.only(left: 15, right: 15),
136 | padding: const EdgeInsets.only(left: 20, right: 20),
137 | alignment: Alignment.centerLeft,
138 | decoration: BoxDecoration(
139 | borderRadius: BorderRadius.circular(10),
140 | color: Colors.blueGrey[50],
141 | ),
142 | child: Column(
143 | crossAxisAlignment: CrossAxisAlignment.start,
144 | children: [
145 | Text(
146 | 'Warning Signs - Seek medical attention',
147 | style: GoogleFonts.lato(
148 | color: Colors.black87,
149 | fontSize: 20,
150 | fontWeight: FontWeight.bold),
151 | textAlign: TextAlign.left,
152 | ),
153 | const SizedBox(
154 | height: 15,
155 | ),
156 | Text(
157 | document['Warning'],
158 | style: GoogleFonts.lato(
159 | color: Colors.black54,
160 | fontSize: 18,
161 | ),
162 | )
163 | ],
164 | )),
165 | ],
166 | ),
167 | );
168 | }).toList());
169 | }),
170 | );
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/lib/firestore_data/search_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:google_fonts/google_fonts.dart';
4 | import 'package:health_app/screens/patient/doctor_profile.dart';
5 | import 'package:typicons_flutter/typicons_flutter.dart';
6 |
7 | class SearchList extends StatefulWidget {
8 | final String searchKey;
9 |
10 | const SearchList({Key? key, required this.searchKey}) : super(key: key);
11 |
12 | @override
13 | State createState() => _SearchListState();
14 | }
15 |
16 | class _SearchListState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | backgroundColor: Colors.white,
21 | body: SafeArea(
22 | child: StreamBuilder(
23 | stream: FirebaseFirestore.instance
24 | .collection('doctor')
25 | .orderBy('name')
26 | .startAt(['Dr. ${widget.searchKey}']).endAt(
27 | ['Dr. ${widget.searchKey}\uf8ff']).snapshots(),
28 | builder:
29 | (BuildContext context, AsyncSnapshot snapshot) {
30 | if (!snapshot.hasData) {
31 | return const Center(
32 | child: CircularProgressIndicator(),
33 | );
34 | }
35 | return snapshot.data!.size == 0
36 | ? Center(
37 | child: Column(
38 | crossAxisAlignment: CrossAxisAlignment.center,
39 | mainAxisAlignment: MainAxisAlignment.center,
40 | children: [
41 | Text(
42 | 'No Doctor found!',
43 | style: GoogleFonts.lato(
44 | color: Colors.blue[800],
45 | fontSize: 25,
46 | fontWeight: FontWeight.bold,
47 | ),
48 | ),
49 | const Image(
50 | image: AssetImage('assets/error-404.jpg'),
51 | height: 250,
52 | width: 250,
53 | ),
54 | ],
55 | ),
56 | )
57 | : Scrollbar(
58 | child: ListView.builder(
59 | scrollDirection: Axis.vertical,
60 | physics: const ClampingScrollPhysics(),
61 | shrinkWrap: true,
62 | itemCount: snapshot.data!.size,
63 | itemBuilder: (context, index) {
64 | DocumentSnapshot doctor = snapshot.data!.docs[index];
65 | return Padding(
66 | padding: const EdgeInsets.only(top: 0.0),
67 | child: Card(
68 | color: Colors.blue[50],
69 | elevation: 0,
70 | shape: RoundedRectangleBorder(
71 | borderRadius: BorderRadius.circular(10),
72 | ),
73 | child: Container(
74 | padding: const EdgeInsets.only(
75 | left: 10, right: 10, top: 0),
76 | width: MediaQuery.of(context).size.width,
77 | height: MediaQuery.of(context).size.height / 9,
78 | child: TextButton(
79 | onPressed: () {
80 | Navigator.push(
81 | context,
82 | MaterialPageRoute(
83 | builder: (context) => DoctorProfile(
84 | doctor: doctor['name'],
85 | ),
86 | ),
87 | );
88 | },
89 | child: Row(
90 | crossAxisAlignment: CrossAxisAlignment.center,
91 | //mainAxisAlignment: MainAxisAlignment.spaceAround,
92 | children: [
93 | CircleAvatar(
94 | backgroundImage:
95 | NetworkImage(doctor['profilePhoto']),
96 | backgroundColor: Colors.blue,
97 | radius: 25,
98 | ),
99 | const SizedBox(
100 | width: 20,
101 | ),
102 | Column(
103 | crossAxisAlignment:
104 | CrossAxisAlignment.start,
105 | mainAxisAlignment:
106 | MainAxisAlignment.center,
107 | children: [
108 | Text(
109 | doctor['name'],
110 | style: GoogleFonts.lato(
111 | fontWeight: FontWeight.bold,
112 | fontSize: 17,
113 | color: Colors.black87,
114 | ),
115 | ),
116 | Text(
117 | doctor['specialization'],
118 | style: GoogleFonts.lato(
119 | fontSize: 16,
120 | color: Colors.black54),
121 | ),
122 | ],
123 | ),
124 | const SizedBox(
125 | width: 10,
126 | ),
127 | Expanded(
128 | child: Container(
129 | alignment: Alignment.centerRight,
130 | child: Row(
131 | crossAxisAlignment:
132 | CrossAxisAlignment.end,
133 | mainAxisAlignment:
134 | MainAxisAlignment.end,
135 | children: [
136 | Icon(
137 | Typicons.star_full_outline,
138 | size: 20,
139 | color: Colors.indigo[400],
140 | ),
141 | const SizedBox(
142 | width: 3,
143 | ),
144 | Text(
145 | doctor['rating'].toString(),
146 | style: GoogleFonts.lato(
147 | fontWeight: FontWeight.bold,
148 | fontSize: 15,
149 | color: Colors.indigo,
150 | ),
151 | ),
152 | ],
153 | ),
154 | ),
155 | ),
156 | ],
157 | ),
158 | ),
159 | ),
160 | ),
161 | );
162 | },
163 | ),
164 | );
165 | },
166 | ),
167 | ),
168 | );
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/lib/firestore_data/appointment_list.dart:
--------------------------------------------------------------------------------
1 | import 'package:cloud_firestore/cloud_firestore.dart';
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:google_fonts/google_fonts.dart';
5 | import 'package:health_app/globals.dart';
6 | import 'package:intl/intl.dart';
7 |
8 | class AppointmentList extends StatefulWidget {
9 | const AppointmentList({Key? key}) : super(key: key);
10 |
11 | @override
12 | State createState() => _AppointmentListState();
13 | }
14 |
15 | class _AppointmentListState extends State {
16 | final FirebaseAuth _auth = FirebaseAuth.instance;
17 | late User user;
18 | late String _documentID;
19 |
20 | Future _getUser() async {
21 | user = _auth.currentUser!;
22 | }
23 |
24 | // delete appointment from both patient and doctor
25 | Future deleteAppointment(
26 | String docID, String doctorId, String patientId) async {
27 | FirebaseFirestore.instance
28 | .collection('appointments')
29 | .doc(doctorId)
30 | .collection('pending')
31 | .doc(docID)
32 | .delete();
33 | return FirebaseFirestore.instance
34 | .collection('appointments')
35 | .doc(patientId)
36 | .collection('pending')
37 | .doc(docID)
38 | .delete();
39 | }
40 |
41 | String _dateFormatter(String timestamp) {
42 | String formattedDate =
43 | DateFormat('dd-MM-yyyy').format(DateTime.parse(timestamp));
44 | return formattedDate;
45 | }
46 |
47 | String _timeFormatter(String timestamp) {
48 | String formattedTime =
49 | DateFormat('kk:mm').format(DateTime.parse(timestamp));
50 | return formattedTime;
51 | }
52 |
53 | // alert box for confirmation of deleting appointment
54 | showAlertDialog(BuildContext context, String doctorId, String patientId) {
55 | // No
56 | Widget cancelButton = TextButton(
57 | child: const Text("No"),
58 | onPressed: () {
59 | Navigator.of(context).pop();
60 | },
61 | );
62 |
63 | // YES
64 | Widget continueButton = TextButton(
65 | child: const Text("Yes"),
66 | onPressed: () {
67 | deleteAppointment(_documentID, doctorId, patientId);
68 | Navigator.of(context).pop();
69 | },
70 | );
71 |
72 | // set up the AlertDialog
73 | AlertDialog alert = AlertDialog(
74 | title: const Text("Confirm Delete"),
75 | content: const Text("Are you sure you want to delete this Appointment?"),
76 | actions: [
77 | cancelButton,
78 | continueButton,
79 | ],
80 | );
81 |
82 | // show the dialog
83 | showDialog(
84 | context: context,
85 | builder: (BuildContext context) {
86 | return alert;
87 | },
88 | );
89 | }
90 |
91 | // helping in removing pending appointment
92 | _checkDiff(DateTime date) {
93 | print(date);
94 | var diff = DateTime.now().difference(date).inSeconds;
95 | print('date difference : $diff');
96 | if (diff > 0) {
97 | return true;
98 | } else {
99 | return false;
100 | }
101 | }
102 |
103 | // for comparing date
104 | _compareDate(String date) {
105 | if (_dateFormatter(DateTime.now().toString())
106 | .compareTo(_dateFormatter(date)) ==
107 | 0) {
108 | return true;
109 | } else {
110 | return false;
111 | }
112 | }
113 |
114 | @override
115 | void initState() {
116 | super.initState();
117 | _getUser();
118 | }
119 |
120 | @override
121 | Widget build(BuildContext context) {
122 | return SafeArea(
123 | child: StreamBuilder(
124 | stream: FirebaseFirestore.instance
125 | .collection('appointments')
126 | .doc(user.uid)
127 | .collection('pending')
128 | .orderBy('date')
129 | .snapshots(),
130 | builder: (BuildContext context, AsyncSnapshot snapshot) {
131 | if (!snapshot.hasData) {
132 | return const Center(
133 | child: CircularProgressIndicator(),
134 | );
135 | }
136 | return snapshot.data!.size == 0
137 | ? Center(
138 | child: Text(
139 | 'No Appointment Scheduled',
140 | style: GoogleFonts.lato(
141 | color: Colors.grey,
142 | fontSize: 18,
143 | ),
144 | ),
145 | )
146 | : ListView.builder(
147 | scrollDirection: Axis.vertical,
148 | physics: const ClampingScrollPhysics(),
149 | shrinkWrap: true,
150 | itemCount: snapshot.data!.size,
151 | itemBuilder: (context, index) {
152 | DocumentSnapshot document = snapshot.data!.docs[index];
153 |
154 | // delete past appointments from pending appointment list
155 | if (_checkDiff(document['date'].toDate())) {
156 | deleteAppointment(document.id, document['doctorId'],
157 | document['patientId']);
158 | }
159 |
160 | // each appointment
161 | return Card(
162 | elevation: 2,
163 | child: InkWell(
164 | onTap: () {},
165 | child: ExpansionTile(
166 | initiallyExpanded: true,
167 |
168 | // main info of appointment
169 | title: Row(
170 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
171 | children: [
172 | // doctor name
173 | Padding(
174 | padding: const EdgeInsets.only(left: 5),
175 | child: Text(
176 | isDoctor
177 | ? document['patientName']
178 | : document['doctorName'],
179 | style: GoogleFonts.lato(
180 | fontSize: 16,
181 | fontWeight: FontWeight.bold,
182 | ),
183 | ),
184 | ),
185 |
186 | // Today label
187 | Text(
188 | _compareDate(
189 | document['date'].toDate().toString())
190 | ? "TODAY"
191 | : "",
192 | style: GoogleFonts.lato(
193 | color: Colors.green,
194 | fontSize: 18,
195 | fontWeight: FontWeight.bold),
196 | ),
197 |
198 | const SizedBox(
199 | width: 0,
200 | ),
201 | ],
202 | ),
203 |
204 | // appointment date
205 | subtitle: Padding(
206 | padding: const EdgeInsets.only(left: 5),
207 | child: Text(
208 | _dateFormatter(
209 | document['date'].toDate().toString()),
210 | style: GoogleFonts.lato(),
211 | ),
212 | ),
213 |
214 | // patient info
215 | children: [
216 | Padding(
217 | padding: const EdgeInsets.only(
218 | bottom: 20, right: 10, left: 16),
219 | child: Row(
220 | mainAxisAlignment:
221 | MainAxisAlignment.spaceBetween,
222 | children: [
223 | // patient info
224 | Column(
225 | crossAxisAlignment:
226 | CrossAxisAlignment.start,
227 | children: [
228 | // patient name
229 | Text(
230 | isDoctor
231 | ? ''
232 | : "Patient name: ${document['patientName']}",
233 | style: GoogleFonts.lato(
234 | fontSize: 16,
235 | ),
236 | ),
237 | const SizedBox(
238 | height: 10,
239 | ),
240 |
241 | // Appointment time
242 | Text(
243 | 'Time: ${_timeFormatter(document['date'].toDate().toString())}',
244 | style: GoogleFonts.lato(fontSize: 16),
245 | ),
246 |
247 | const SizedBox(
248 | height: 10,
249 | ),
250 |
251 | Text(
252 | 'Description : ${document['description']}',
253 | style: GoogleFonts.lato(fontSize: 16),
254 | )
255 | ],
256 | ),
257 |
258 | // delete button
259 | IconButton(
260 | tooltip: 'Delete Appointment',
261 | icon: const Icon(
262 | Icons.delete,
263 | color: Colors.red,
264 | ),
265 | onPressed: () {
266 | _documentID = document.id;
267 | showAlertDialog(
268 | context,
269 | document['doctorId'],
270 | document['patientId']);
271 | },
272 | ),
273 | ],
274 | ),
275 | ),
276 | ],
277 | ),
278 | ),
279 | );
280 | },
281 | );
282 | },
283 | ),
284 | );
285 | }
286 | }
287 |
--------------------------------------------------------------------------------