├── linux ├── .gitignore ├── runner │ ├── main.cc │ ├── my_application.h │ ├── CMakeLists.txt │ └── my_application.cc ├── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugin_registrant.cc │ ├── generated_plugins.cmake │ └── CMakeLists.txt └── CMakeLists.txt ├── 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-50x50@1x.png │ │ │ ├── Icon-App-50x50@2x.png │ │ │ ├── Icon-App-57x57@1x.png │ │ │ ├── Icon-App-57x57@2x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-72x72@1x.png │ │ │ ├── Icon-App-72x72@2x.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 │ │ └── LaunchBackground.imageset │ │ │ ├── background.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 ├── RunnerTests │ └── RunnerTests.swift └── .gitignore ├── macos ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_512.png │ │ │ └── Contents.json │ ├── Release.entitlements │ ├── AppDelegate.swift │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme └── RunnerTests │ └── RunnerTests.swift ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── splash │ └── img │ │ ├── dark-1x.png │ │ ├── dark-2x.png │ │ ├── dark-3x.png │ │ ├── dark-4x.png │ │ ├── light-1x.png │ │ ├── light-2x.png │ │ ├── light-3x.png │ │ └── light-4x.png ├── manifest.json └── index.html ├── assets └── app_icon.png ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── runner.exe.manifest │ ├── utils.h │ ├── flutter_window.h │ ├── main.cpp │ ├── CMakeLists.txt │ ├── 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 ├── android ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── drawable │ │ │ │ │ ├── background.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── splash.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── splash.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── splash.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-v21 │ │ │ │ │ ├── background.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── splash.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── splash.png │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ └── ic_launcher.xml │ │ │ │ ├── values-v31 │ │ │ │ │ └── styles.xml │ │ │ │ ├── values-night-v31 │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── docbuddy │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── google-services.json │ └── build.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle.kts └── settings.gradle.kts ├── lib ├── models │ └── user_model.dart ├── screens │ ├── nearby_screen.dart │ ├── splash_screen.dart │ ├── reset_password_screen.dart │ ├── update_username_screen.dart │ ├── update_password_screen.dart │ ├── login_screen.dart │ ├── profile_screen.dart │ ├── register_screen.dart │ └── home_screen.dart ├── services │ ├── firebase_auth_service.dart │ └── firestore_service.dart ├── firebase_options.dart └── main.dart ├── firebase.json ├── .gitignore ├── test └── widget_test.dart ├── pubspec.yaml ├── analysis_options.yaml ├── .metadata └── README.md /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/favicon.png -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /assets/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/assets/app_icon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/splash/img/dark-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/dark-1x.png -------------------------------------------------------------------------------- /web/splash/img/dark-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/dark-2x.png -------------------------------------------------------------------------------- /web/splash/img/dark-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/dark-3x.png -------------------------------------------------------------------------------- /web/splash/img/dark-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/dark-4x.png -------------------------------------------------------------------------------- /web/splash/img/light-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/light-1x.png -------------------------------------------------------------------------------- /web/splash/img/light-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/light-2x.png -------------------------------------------------------------------------------- /web/splash/img/light-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/light-3x.png -------------------------------------------------------------------------------- /web/splash/img/light-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/splash/img/light-4x.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ffffff 4 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obito8010/DocBuddyNew/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/obito8010/DocBuddyNew/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/docbuddy/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.docbuddy 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity : FlutterActivity() 6 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /linux/runner/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/models/user_model.dart: -------------------------------------------------------------------------------- 1 | class UserModel { 2 | String email; 3 | String username; 4 | String password; 5 | 6 | UserModel({ 7 | required this.email, 8 | required this.username, 9 | required this.password, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip 6 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.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 | .cxx/ 9 | 10 | # Remember to never publicly share your keystore. 11 | # See https://flutter.dev/to/reference-keystore 12 | key.properties 13 | **/*.keystore 14 | **/*.jks 15 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | {"flutter":{"platforms":{"android":{"default":{"projectId":"docbuddy-1af65","appId":"1:237165671850:android:5e19af5043ee4f81bb27d3","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"docbuddy-1af65","configurations":{"android":"1:237165671850:android:5e19af5043ee4f81bb27d3","ios":"1:237165671850:ios:9026e5d43979352bbb27d3"}}}}}} -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | 10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { 11 | return true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /linux/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 fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @main 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 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /linux/runner/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /linux/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 fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) open_file_linux_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "OpenFileLinuxPlugin"); 14 | open_file_linux_plugin_register_with_registrar(open_file_linux_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() 9 | rootProject.layout.buildDirectory.value(newBuildDir) 10 | 11 | subprojects { 12 | val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) 13 | project.layout.buildDirectory.value(newSubprojectBuildDir) 14 | } 15 | subprojects { 16 | project.evaluationDependsOn(":app") 17 | } 18 | 19 | tasks.register("clean") { 20 | delete(rootProject.layout.buildDirectory) 21 | } 22 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /lib/screens/nearby_screen.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | 4 | class NearbyScreen extends StatelessWidget { 5 | const NearbyScreen({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text("Nearby Medical Services"), 12 | backgroundColor: Colors.teal, 13 | ), 14 | body: const Center( 15 | child: Text( 16 | "Coming soon: Locate nearby hospitals and medical stores!", 17 | textAlign: TextAlign.center, 18 | style: TextStyle(fontSize: 18), 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = docbuddy 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.docbuddy 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /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/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "237165671850", 4 | "project_id": "docbuddy-1af65", 5 | "storage_bucket": "docbuddy-1af65.firebasestorage.app" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:237165671850:android:5e19af5043ee4f81bb27d3", 11 | "android_client_info": { 12 | "package_name": "com.example.docbuddy" 13 | } 14 | }, 15 | "oauth_client": [], 16 | "api_key": [ 17 | { 18 | "current_key": "AIzaSyByeC5hGpI0q5Kg_dihTN_pPYCOouNk5IY" 19 | } 20 | ], 21 | "services": { 22 | "appinvite_service": { 23 | "other_platform_oauth_client": [] 24 | } 25 | } 26 | } 27 | ], 28 | "configuration_version": "1" 29 | } -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | open_file_linux 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}/linux 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}/linux 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 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .build/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .swiftpm/ 13 | migrate_working_dir/ 14 | 15 | .env 16 | 17 | 18 | # IntelliJ related 19 | *.iml 20 | *.ipr 21 | *.iws 22 | .idea/ 23 | 24 | # The .vscode folder contains launch configuration and tasks you configure in 25 | # VS Code which you may wish to be included in version control, so this line 26 | # is commented out by default. 27 | #.vscode/ 28 | 29 | # Flutter/Dart/Pub related 30 | **/doc/api/ 31 | **/ios/Flutter/.last_build_id 32 | .dart_tool/ 33 | .flutter-plugins 34 | .flutter-plugins-dependencies 35 | .pub-cache/ 36 | .pub/ 37 | /build/ 38 | 39 | # Symbolication related 40 | app.*.symbols 41 | 42 | # Obfuscation related 43 | app.*.map.json 44 | 45 | # Android Studio will place build artifacts here 46 | /android/app/debug 47 | /android/app/profile 48 | /android/app/release 49 | -------------------------------------------------------------------------------- /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 | #include 11 | #include 12 | #include 13 | 14 | void RegisterPlugins(flutter::PluginRegistry* registry) { 15 | CloudFirestorePluginCApiRegisterWithRegistrar( 16 | registry->GetRegistrarForPlugin("CloudFirestorePluginCApi")); 17 | FirebaseAuthPluginCApiRegisterWithRegistrar( 18 | registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); 19 | FirebaseCorePluginCApiRegisterWithRegistrar( 20 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); 21 | FlutterTtsPluginRegisterWithRegistrar( 22 | registry->GetRegistrarForPlugin("FlutterTtsPlugin")); 23 | } 24 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | cloud_firestore 7 | firebase_auth 8 | firebase_core 9 | flutter_tts 10 | ) 11 | 12 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 13 | ) 14 | 15 | set(PLUGIN_BUNDLED_LIBRARIES) 16 | 17 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 18 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 19 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 22 | endforeach(plugin) 23 | 24 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 25 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 26 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 27 | endforeach(ffi_plugin) 28 | -------------------------------------------------------------------------------- /android/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | val flutterSdkPath = run { 3 | val properties = java.util.Properties() 4 | file("local.properties").inputStream().use { properties.load(it) } 5 | val flutterSdkPath = properties.getProperty("flutter.sdk") 6 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } 7 | flutterSdkPath 8 | } 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id("dev.flutter.flutter-plugin-loader") version "1.0.0" 21 | id("com.android.application") version "8.7.0" apply false 22 | // START: FlutterFire Configuration 23 | id("com.google.gms.google-services") version("4.3.15") apply false 24 | // END: FlutterFire Configuration 25 | id("org.jetbrains.kotlin.android") version "1.8.22" apply false 26 | } 27 | 28 | include(":app") 29 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docbuddy", 3 | "short_name": "docbuddy", 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 | -------------------------------------------------------------------------------- /linux/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 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} 10 | "main.cc" 11 | "my_application.cc" 12 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 13 | ) 14 | 15 | # Apply the standard set of build settings. This can be removed for applications 16 | # that need different build settings. 17 | apply_standard_settings(${BINARY_NAME}) 18 | 19 | # Add preprocessor definitions for the application ID. 20 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 21 | 22 | # Add dependency libraries. Add any application-specific dependencies here. 23 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 24 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 25 | 26 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 27 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /lib/screens/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lottie/lottie.dart'; 3 | import 'home_screen.dart'; 4 | 5 | class SplashScreen extends StatefulWidget { 6 | const SplashScreen({super.key}); 7 | 8 | @override 9 | State createState() => _SplashScreenState(); 10 | } 11 | 12 | class _SplashScreenState extends State { 13 | @override 14 | void initState() { 15 | super.initState(); 16 | Future.delayed(const Duration(seconds: 3), () { 17 | Navigator.pushReplacement( 18 | context, 19 | MaterialPageRoute(builder: (_) => const HomeScreen()), 20 | ); 21 | }); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | final isDark = Theme.of(context).brightness == Brightness.dark; 27 | 28 | return Scaffold( 29 | backgroundColor: isDark ? Colors.black : Colors.white, 30 | body: Center( 31 | child: Lottie.asset( 32 | 'assets/animation/health_loading.json', 33 | width: 200, 34 | height: 200, 35 | fit: BoxFit.contain, 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:docbuddy/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const DocBuddyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: docbuddy 2 | description: "A new Flutter project." 3 | publish_to: 'none' 4 | 5 | version: 1.0.0+1 6 | 7 | environment: 8 | sdk: ^3.7.0 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | cupertino_icons: ^1.0.8 14 | firebase_core: ^3.14.0 15 | firebase_auth: ^5.6.0 16 | cloud_firestore: ^5.6.9 17 | speech_to_text: ^7.0.0 18 | flutter_tts: ^4.0.2 19 | http: ^1.2.1 20 | path_provider: ^2.1.3 21 | pdf: ^3.10.8 22 | open_file: ^3.3.2 23 | logger: ^2.2.0 24 | lottie: ^3.3.1 25 | flutter_native_splash: ^2.4.6 26 | flutter_dotenv: ^5.1.0 27 | shared_preferences: ^2.2.2 28 | animated_text_kit: ^4.2.3 29 | flutter_local_notifications: ^17.0.0 30 | timezone: ^0.9.2 31 | 32 | dev_dependencies: 33 | flutter_test: 34 | sdk: flutter 35 | flutter_launcher_icons: ^0.13.1 36 | flutter_lints: ^5.0.0 37 | 38 | flutter_icons: 39 | android: true 40 | ios: true 41 | image_path: "assets/app_icon.png" 42 | adaptive_icon_background: "#ffffff" 43 | adaptive_icon_foreground: "assets/app_icon.png" 44 | 45 | flutter_native_splash: 46 | android: false 47 | ios: false 48 | 49 | flutter: 50 | uses-material-design: true 51 | 52 | assets: 53 | - assets/app_icon.png 54 | - assets/animation/health_loading.json 55 | - .env 56 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import cloud_firestore 9 | import firebase_auth 10 | import firebase_core 11 | import flutter_local_notifications 12 | import flutter_tts 13 | import open_file_mac 14 | import path_provider_foundation 15 | import shared_preferences_foundation 16 | import speech_to_text 17 | 18 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 19 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 20 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 21 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 22 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 23 | FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin")) 24 | OpenFilePlugin.register(with: registry.registrar(forPlugin: "OpenFilePlugin")) 25 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 26 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 27 | SpeechToTextPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextPlugin")) 28 | } 29 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /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.Create(L"docbuddy", 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 | -------------------------------------------------------------------------------- /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 https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /lib/services/firebase_auth_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | 3 | class FirebaseAuthService { 4 | static final FirebaseAuth _auth = FirebaseAuth.instance; 5 | 6 | static User? get currentUser => _auth.currentUser; 7 | 8 | static Future register(String email, String password) async { 9 | try { 10 | await _auth.createUserWithEmailAndPassword(email: email, password: password); 11 | return null; 12 | } on FirebaseAuthException catch (e) { 13 | return e.message; 14 | } 15 | } 16 | 17 | static Future login(String email, String password) async { 18 | try { 19 | await _auth.signInWithEmailAndPassword(email: email, password: password); 20 | return null; 21 | } on FirebaseAuthException catch (e) { 22 | return e.message; 23 | } 24 | } 25 | 26 | static Future resetPassword(String email) async { 27 | await _auth.sendPasswordResetEmail(email: email); 28 | } 29 | 30 | static Future logout() async { 31 | await _auth.signOut(); 32 | } 33 | 34 | static Future deleteAccount() async { 35 | try { 36 | await _auth.currentUser?.delete(); 37 | return null; 38 | } on FirebaseAuthException catch (e) { 39 | return e.message; 40 | } 41 | } 42 | 43 | static Future updatePassword(String newPassword) async { 44 | try { 45 | await _auth.currentUser?.updatePassword(newPassword); 46 | return null; 47 | } on FirebaseAuthException catch (e) { 48 | return e.message; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /android/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | // START: FlutterFire Configuration 4 | id("com.google.gms.google-services") 5 | // END: FlutterFire Configuration 6 | id("kotlin-android") 7 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 8 | id("dev.flutter.flutter-gradle-plugin") 9 | } 10 | 11 | android { 12 | namespace = "com.example.docbuddy" 13 | compileSdk = flutter.compileSdkVersion 14 | ndkVersion = "27.0.12077973" 15 | 16 | compileOptions { 17 | sourceCompatibility = JavaVersion.VERSION_11 18 | targetCompatibility = JavaVersion.VERSION_11 19 | } 20 | 21 | kotlinOptions { 22 | jvmTarget = JavaVersion.VERSION_11.toString() 23 | } 24 | 25 | defaultConfig { 26 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 27 | applicationId = "com.example.docbuddy" 28 | // You can update the following values to match your application needs. 29 | // For more information, see: https://flutter.dev/to/review-gradle-config. 30 | minSdk = 23 31 | targetSdk = flutter.targetSdkVersion 32 | versionCode = flutter.versionCode 33 | versionName = flutter.versionName 34 | } 35 | 36 | buildTypes { 37 | release { 38 | // TODO: Add your own signing config for the release build. 39 | // Signing with the debug keys for now, so `flutter run --release` works. 40 | signingConfig = signingConfigs.getByName("debug") 41 | } 42 | } 43 | } 44 | 45 | flutter { 46 | source = "../.." 47 | } 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 17 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 18 | - platform: android 19 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 20 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 21 | - platform: ios 22 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 23 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 24 | - platform: linux 25 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 26 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 27 | - platform: macos 28 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 29 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 30 | - platform: web 31 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 32 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 33 | - platform: windows 34 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 35 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /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 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Docbuddy 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | docbuddy 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 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | UIStatusBarHidden 49 | 50 | UIViewControllerBasedStatusBarAppearance 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 | unsigned int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length == 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🩺 DocBuddy – Your AI-Powered Virtual Doctor & Health Companion 2 | 3 | **DocBuddy** is an AI-powered medical chatbot and virtual health assistant built using Flutter and Firebase. It simulates a professional doctor you can **chat or talk to**, helping users track their health, form good habits, and access smart, friendly, and realistic medical advice — all while gamifying healthy living. 4 | 5 | --- 6 | 7 | ## 🌟 Key Features 8 | 9 | ### 🧠 1. Smart Chatbot (DocBuddy) 10 | - Chat with a professional virtual doctor powered by **Groq (ChatGPT)**. 11 | - Focused only on **medical-related conversations**: symptoms, treatments, precautions, and more. 12 | - **Chats are saved** in Firebase Firestore. 13 | - Easily **switch between old chats**, rename or delete them. 14 | - Download conversation history as a **PDF** styled like a medical prescription. 15 | 16 | ### 🎤 2. Voice-Enabled Virtual Assistant 17 | - **Talk to DocBuddy** using voice commands and receive voice replies. 18 | - Choose from **multiple voice options** (male/female/neutral). 19 | - Control **voice speed** (0.5x, 1x, 1.5x, 2x). 20 | - Voice output stops when navigating away. 21 | 22 | ### 🕹️ 3. Gamified Health Tracker 23 | - **Drink Water Tracker** with reminders. 24 | - **Medicine Reminders**: Add custom medicines, get notified. 25 | - Earn **XP and level up** by completing health tasks. 26 | - Track **daily streaks** for motivation and consistency. 27 | - Customizable goals (e.g. number of glasses per day). 28 | 29 | ### 🎨 4. Modern, Responsive UI 30 | - Beautiful **Glassmorphism design** with gradient backgrounds. 31 | - Fully supports **Dark Mode** and **Light Mode**. 32 | - Animated transitions and sleek UI interactions. 33 | - Transparent app bars and modern iconography. 34 | 35 | --- 36 | 37 | ## 🔐 Tech Stack 38 | 39 | | Technology | Description | 40 | |----------------|--------------------------------------------| 41 | | **Flutter** | Cross-platform mobile framework | 42 | | **Firebase** | Auth, Firestore DB, Notifications | 43 | | **Groq API** | Chatbot intelligence (powered by ChatGPT) | 44 | | **Flutter TTS**| Voice assistant playback and control | 45 | | **Local Notifications** | Health reminders for medicine & water intake | 46 | | **PDF Generator** | Medical-style report exports | 47 | 48 | --- 49 | 50 | ## 📂 Folder Structure 51 | 52 | -------------------------------------------------------------------------------- /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 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /lib/firebase_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; 2 | import 'package:flutter/foundation.dart' 3 | show defaultTargetPlatform, kIsWeb, TargetPlatform; 4 | 5 | /// Default [FirebaseOptions] for use with your Firebase apps. 6 | /// 7 | /// Example: 8 | /// ```dart 9 | /// import 'firebase_options.dart'; 10 | /// // ... 11 | /// await Firebase.initializeApp( 12 | /// options: DefaultFirebaseOptions.currentPlatform, 13 | /// ); 14 | /// ``` 15 | class DefaultFirebaseOptions { 16 | static FirebaseOptions get currentPlatform { 17 | if (kIsWeb) { 18 | throw UnsupportedError( 19 | 'DefaultFirebaseOptions have not been configured for web - ' 20 | 'you can reconfigure this by running the FlutterFire CLI again.', 21 | ); 22 | } 23 | switch (defaultTargetPlatform) { 24 | case TargetPlatform.android: 25 | return android; 26 | case TargetPlatform.iOS: 27 | return ios; 28 | case TargetPlatform.macOS: 29 | throw UnsupportedError( 30 | 'DefaultFirebaseOptions have not been configured for macos - ' 31 | 'you can reconfigure this by running the FlutterFire CLI again.', 32 | ); 33 | case TargetPlatform.windows: 34 | throw UnsupportedError( 35 | 'DefaultFirebaseOptions have not been configured for windows - ' 36 | 'you can reconfigure this by running the FlutterFire CLI again.', 37 | ); 38 | case TargetPlatform.linux: 39 | throw UnsupportedError( 40 | 'DefaultFirebaseOptions have not been configured for linux - ' 41 | 'you can reconfigure this by running the FlutterFire CLI again.', 42 | ); 43 | default: 44 | throw UnsupportedError( 45 | 'DefaultFirebaseOptions are not supported for this platform.', 46 | ); 47 | } 48 | } 49 | 50 | static const FirebaseOptions android = FirebaseOptions( 51 | apiKey: 'AIzaSyByeC5hGpI0q5Kg_dihTN_pPYCOouNk5IY', 52 | appId: '1:237165671850:android:5e19af5043ee4f81bb27d3', 53 | messagingSenderId: '237165671850', 54 | projectId: 'docbuddy-1af65', 55 | storageBucket: 'docbuddy-1af65.firebasestorage.app', 56 | ); 57 | 58 | static const FirebaseOptions ios = FirebaseOptions( 59 | apiKey: 'AIzaSyB5IEGHaT0w7WACkVIQJaQpJnJbNRxWRJQ', 60 | appId: '1:237165671850:ios:9026e5d43979352bbb27d3', 61 | messagingSenderId: '237165671850', 62 | projectId: 'docbuddy-1af65', 63 | storageBucket: 'docbuddy-1af65.firebasestorage.app', 64 | iosBundleId: 'com.example.docbuddy', 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 18 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 36 | 37 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 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 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | docbuddy 31 | 32 | 33 | 34 | 35 | 36 | 37 | 95 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /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 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 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", "docbuddy" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "docbuddy" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "docbuddy.exe" "\0" 98 | VALUE "ProductName", "docbuddy" "\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 | -------------------------------------------------------------------------------- /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 a win32 window with |title| that is positioned and sized 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 this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /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 | # Set fallback configurations for older versions of the flutter tool. 14 | if (NOT DEFINED FLUTTER_TARGET_PLATFORM) 15 | set(FLUTTER_TARGET_PLATFORM "windows-x64") 16 | endif() 17 | 18 | # === Flutter Library === 19 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 20 | 21 | # Published to parent scope for install step. 22 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 23 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 24 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 25 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 26 | 27 | list(APPEND FLUTTER_LIBRARY_HEADERS 28 | "flutter_export.h" 29 | "flutter_windows.h" 30 | "flutter_messenger.h" 31 | "flutter_plugin_registrar.h" 32 | "flutter_texture_registrar.h" 33 | ) 34 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 35 | add_library(flutter INTERFACE) 36 | target_include_directories(flutter INTERFACE 37 | "${EPHEMERAL_DIR}" 38 | ) 39 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 40 | add_dependencies(flutter flutter_assemble) 41 | 42 | # === Wrapper === 43 | list(APPEND CPP_WRAPPER_SOURCES_CORE 44 | "core_implementations.cc" 45 | "standard_codec.cc" 46 | ) 47 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 48 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 49 | "plugin_registrar.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 52 | list(APPEND CPP_WRAPPER_SOURCES_APP 53 | "flutter_engine.cc" 54 | "flutter_view_controller.cc" 55 | ) 56 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 57 | 58 | # Wrapper sources needed for a plugin. 59 | add_library(flutter_wrapper_plugin STATIC 60 | ${CPP_WRAPPER_SOURCES_CORE} 61 | ${CPP_WRAPPER_SOURCES_PLUGIN} 62 | ) 63 | apply_standard_settings(flutter_wrapper_plugin) 64 | set_target_properties(flutter_wrapper_plugin PROPERTIES 65 | POSITION_INDEPENDENT_CODE ON) 66 | set_target_properties(flutter_wrapper_plugin PROPERTIES 67 | CXX_VISIBILITY_PRESET hidden) 68 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 69 | target_include_directories(flutter_wrapper_plugin PUBLIC 70 | "${WRAPPER_ROOT}/include" 71 | ) 72 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 73 | 74 | # Wrapper sources needed for the runner. 75 | add_library(flutter_wrapper_app STATIC 76 | ${CPP_WRAPPER_SOURCES_CORE} 77 | ${CPP_WRAPPER_SOURCES_APP} 78 | ) 79 | apply_standard_settings(flutter_wrapper_app) 80 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 81 | target_include_directories(flutter_wrapper_app PUBLIC 82 | "${WRAPPER_ROOT}/include" 83 | ) 84 | add_dependencies(flutter_wrapper_app flutter_assemble) 85 | 86 | # === Flutter tool backend === 87 | # _phony_ is a non-existent file to force this command to run every time, 88 | # since currently there's no way to get a full input/output list from the 89 | # flutter tool. 90 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 91 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 92 | add_custom_command( 93 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 94 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 95 | ${CPP_WRAPPER_SOURCES_APP} 96 | ${PHONY_OUTPUT} 97 | COMMAND ${CMAKE_COMMAND} -E env 98 | ${FLUTTER_TOOL_ENVIRONMENT} 99 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 100 | ${FLUTTER_TARGET_PLATFORM} $ 101 | VERBATIM 102 | ) 103 | add_custom_target(flutter_assemble DEPENDS 104 | "${FLUTTER_LIBRARY}" 105 | ${FLUTTER_LIBRARY_HEADERS} 106 | ${CPP_WRAPPER_SOURCES_CORE} 107 | ${CPP_WRAPPER_SOURCES_PLUGIN} 108 | ${CPP_WRAPPER_SOURCES_APP} 109 | ) 110 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(docbuddy 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 "docbuddy") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(VERSION 3.14...3.25) 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 | 56 | # Generated plugin build rules, which manage building the plugins and adding 57 | # them to the application. 58 | include(flutter/generated_plugins.cmake) 59 | 60 | 61 | # === Installation === 62 | # Support files are copied into place next to the executable, so that it can 63 | # run in place. This is done instead of making a separate bundle (as on Linux) 64 | # so that building and running from within Visual Studio will work. 65 | set(BUILD_BUNDLE_DIR "$") 66 | # Make the "install" step default, as it's required to run. 67 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 68 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 69 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 70 | endif() 71 | 72 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 73 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 74 | 75 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 76 | COMPONENT Runtime) 77 | 78 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 79 | COMPONENT Runtime) 80 | 81 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 82 | COMPONENT Runtime) 83 | 84 | if(PLUGIN_BUNDLED_LIBRARIES) 85 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 86 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 87 | COMPONENT Runtime) 88 | endif() 89 | 90 | # Copy the native assets provided by the build.dart from all packages. 91 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") 92 | install(DIRECTORY "${NATIVE_ASSETS_DIR}" 93 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 94 | COMPONENT Runtime) 95 | 96 | # Fully re-copy the assets directory on each build to avoid having stale files 97 | # from a previous install. 98 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 99 | install(CODE " 100 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 101 | " COMPONENT Runtime) 102 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 103 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 104 | 105 | # Install the AOT library on non-Debug builds only. 106 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 107 | CONFIGURATIONS Profile;Release 108 | COMPONENT Runtime) 109 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:firebase_core/firebase_core.dart'; 4 | import 'package:firebase_auth/firebase_auth.dart'; 5 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | import 'package:lottie/lottie.dart'; 8 | 9 | import 'firebase_options.dart'; 10 | import 'screens/login_screen.dart'; 11 | import 'screens/home_screen.dart'; 12 | import 'screens/reminder_screen.dart'; // ⬅️ New Screen 13 | 14 | final ValueNotifier themeNotifier = ValueNotifier(ThemeMode.system); 15 | 16 | Future main() async { 17 | WidgetsFlutterBinding.ensureInitialized(); 18 | 19 | try { 20 | await dotenv.load(fileName: '.env'); 21 | debugPrint('✅ .env file loaded successfully'); 22 | } catch (e) { 23 | debugPrint('❌ Error loading .env file: $e'); 24 | } 25 | 26 | try { 27 | await Firebase.initializeApp( 28 | options: DefaultFirebaseOptions.currentPlatform, 29 | ); 30 | debugPrint('✅ Firebase initialized'); 31 | } catch (e) { 32 | debugPrint('❌ Firebase initialization failed: $e'); 33 | } 34 | 35 | await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); 36 | 37 | final prefs = await SharedPreferences.getInstance(); 38 | final savedTheme = prefs.getString('themeMode'); 39 | 40 | if (savedTheme != null) { 41 | themeNotifier.value = ThemeMode.values.firstWhere( 42 | (mode) => mode.toString() == savedTheme, 43 | orElse: () => ThemeMode.system, 44 | ); 45 | } else { 46 | final brightness = WidgetsBinding.instance.platformDispatcher.platformBrightness; 47 | themeNotifier.value = brightness == Brightness.dark ? ThemeMode.dark : ThemeMode.light; 48 | } 49 | 50 | runApp(const DocBuddyApp()); 51 | } 52 | 53 | class DocBuddyApp extends StatelessWidget { 54 | const DocBuddyApp({super.key}); 55 | 56 | @override 57 | Widget build(BuildContext context) { 58 | return ValueListenableBuilder( 59 | valueListenable: themeNotifier, 60 | builder: (_, ThemeMode mode, __) { 61 | return MaterialApp( 62 | debugShowCheckedModeBanner: false, 63 | title: 'DocBuddy', 64 | theme: ThemeData( 65 | primarySwatch: Colors.teal, 66 | brightness: Brightness.light, 67 | ), 68 | darkTheme: ThemeData( 69 | brightness: Brightness.dark, 70 | primarySwatch: Colors.teal, 71 | scaffoldBackgroundColor: const Color(0xFF121212), 72 | ), 73 | themeMode: mode, 74 | initialRoute: '/', 75 | routes: { 76 | '/': (_) => const SplashScreen(), 77 | '/reminders': (_) => const ReminderScreen(), // ⬅️ New route 78 | }, 79 | ); 80 | }, 81 | ); 82 | } 83 | } 84 | 85 | class SplashScreen extends StatefulWidget { 86 | const SplashScreen({super.key}); 87 | 88 | @override 89 | State createState() => _SplashScreenState(); 90 | } 91 | 92 | class _SplashScreenState extends State { 93 | @override 94 | void initState() { 95 | super.initState(); 96 | 97 | Future.delayed(const Duration(seconds: 3), () { 98 | Navigator.pushReplacement( 99 | context, 100 | MaterialPageRoute(builder: (_) => const AuthGate()), 101 | ); 102 | }); 103 | } 104 | 105 | @override 106 | Widget build(BuildContext context) { 107 | final isDark = Theme.of(context).brightness == Brightness.dark; 108 | 109 | return Scaffold( 110 | backgroundColor: isDark ? Colors.black : Colors.white, 111 | body: Center( 112 | child: Lottie.asset( 113 | 'assets/animation/health_loading.json', 114 | width: 200, 115 | height: 200, 116 | fit: BoxFit.contain, 117 | ), 118 | ), 119 | ); 120 | } 121 | } 122 | 123 | class AuthGate extends StatelessWidget { 124 | const AuthGate({super.key}); 125 | 126 | @override 127 | Widget build(BuildContext context) { 128 | return StreamBuilder( 129 | stream: FirebaseAuth.instance.authStateChanges(), 130 | builder: (context, snapshot) { 131 | if (snapshot.connectionState == ConnectionState.waiting) { 132 | return const Scaffold( 133 | body: Center(child: CircularProgressIndicator()), 134 | ); 135 | } else if (snapshot.hasData) { 136 | return const HomeScreen(); 137 | } else { 138 | return const LoginScreen(); 139 | } 140 | }, 141 | ); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /lib/services/firestore_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | 4 | class FirestoreService { 5 | final FirebaseFirestore _db = FirebaseFirestore.instance; 6 | final FirebaseAuth _auth = FirebaseAuth.instance; 7 | 8 | // ✅ Create a new chat session 9 | Future createNewChatSession({String? title}) async { 10 | final user = _auth.currentUser; 11 | if (user == null) return null; 12 | 13 | try { 14 | final doc = await _db 15 | .collection('users') 16 | .doc(user.uid) 17 | .collection('chats') 18 | .add({ 19 | 'title': title ?? 'New Chat', 20 | 'createdAt': FieldValue.serverTimestamp(), 21 | }); 22 | return doc.id; 23 | } catch (e) { 24 | print("❌ Failed to create chat: $e"); 25 | return null; 26 | } 27 | } 28 | 29 | // ✅ List all chat sessions 30 | Future>> getAllChatSessions() async { 31 | final user = _auth.currentUser; 32 | if (user == null) return []; 33 | 34 | try { 35 | final snapshot = await _db 36 | .collection('users') 37 | .doc(user.uid) 38 | .collection('chats') 39 | .orderBy('createdAt', descending: true) 40 | .get(); 41 | 42 | return snapshot.docs.map((doc) { 43 | return { 44 | 'chatId': doc.id, 45 | 'title': doc['title'] ?? 'Chat', 46 | 'createdAt': doc['createdAt'], 47 | }; 48 | }).toList(); 49 | } catch (e) { 50 | print("❌ Failed to fetch chats: $e"); 51 | return []; 52 | } 53 | } 54 | 55 | // ✅ Add a message to a specific chat 56 | Future addMessageToChat( 57 | String chatId, String sender, String message) async { 58 | final user = _auth.currentUser; 59 | if (user == null) return; 60 | 61 | try { 62 | await _db 63 | .collection('users') 64 | .doc(user.uid) 65 | .collection('chats') 66 | .doc(chatId) 67 | .collection('messages') 68 | .add({ 69 | 'sender': sender, 70 | 'message': message, 71 | 'timestamp': FieldValue.serverTimestamp(), 72 | }); 73 | } catch (e) { 74 | print("❌ Failed to add message: $e"); 75 | } 76 | } 77 | 78 | // ✅ Get messages from a specific chat 79 | Future>> getMessages(String chatId) async { 80 | final user = _auth.currentUser; 81 | if (user == null) return []; 82 | 83 | try { 84 | final snapshot = await _db 85 | .collection('users') 86 | .doc(user.uid) 87 | .collection('chats') 88 | .doc(chatId) 89 | .collection('messages') 90 | .orderBy('timestamp') 91 | .get(); 92 | 93 | return snapshot.docs.map((doc) { 94 | return { 95 | 'id': doc.id, 96 | 'sender': doc['sender'], 97 | 'text': doc['message'], 98 | 'timestamp': doc['timestamp'], 99 | }; 100 | }).toList(); 101 | } catch (e) { 102 | print("❌ Failed to fetch messages: $e"); 103 | return []; 104 | } 105 | } 106 | 107 | // ✅ Delete a message from a specific chat 108 | Future deleteMessage(String chatId, String messageId) async { 109 | final user = _auth.currentUser; 110 | if (user == null) return; 111 | 112 | try { 113 | await _db 114 | .collection('users') 115 | .doc(user.uid) 116 | .collection('chats') 117 | .doc(chatId) 118 | .collection('messages') 119 | .doc(messageId) 120 | .delete(); 121 | } catch (e) { 122 | print("❌ Failed to delete message: $e"); 123 | } 124 | } 125 | 126 | // ✅ Rename a chat session 127 | Future renameChatSession(String chatId, String newTitle) async { 128 | final user = _auth.currentUser; 129 | if (user == null) return; 130 | 131 | try { 132 | await _db 133 | .collection('users') 134 | .doc(user.uid) 135 | .collection('chats') 136 | .doc(chatId) 137 | .update({'title': newTitle}); 138 | } catch (e) { 139 | print("❌ Failed to rename chat: $e"); 140 | } 141 | } 142 | 143 | // ✅ Delete a chat session and all its messages 144 | Future deleteChatSession(String chatId) async { 145 | final user = _auth.currentUser; 146 | if (user == null) return; 147 | 148 | try { 149 | final chatRef = _db 150 | .collection('users') 151 | .doc(user.uid) 152 | .collection('chats') 153 | .doc(chatId); 154 | 155 | final messagesSnapshot = await chatRef.collection('messages').get(); 156 | 157 | for (var doc in messagesSnapshot.docs) { 158 | await doc.reference.delete(); 159 | } 160 | 161 | await chatRef.delete(); 162 | } catch (e) { 163 | print("❌ Failed to delete chat session: $e"); 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.13) 3 | project(runner 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 "docbuddy") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.example.docbuddy") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | # Application build; see runner/CMakeLists.txt. 58 | add_subdirectory("runner") 59 | 60 | # Run the Flutter tool portions of the build. This must not be removed. 61 | add_dependencies(${BINARY_NAME} flutter_assemble) 62 | 63 | # Only the install-generated bundle's copy of the executable will launch 64 | # correctly, since the resources must in the right relative locations. To avoid 65 | # people trying to run the unbundled copy, put it in a subdirectory instead of 66 | # the default top-level location. 67 | set_target_properties(${BINARY_NAME} 68 | PROPERTIES 69 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 70 | ) 71 | 72 | 73 | # Generated plugin build rules, which manage building the plugins and adding 74 | # them to the application. 75 | include(flutter/generated_plugins.cmake) 76 | 77 | 78 | # === Installation === 79 | # By default, "installing" just makes a relocatable bundle in the build 80 | # directory. 81 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 82 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 83 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 84 | endif() 85 | 86 | # Start with a clean build bundle directory every time. 87 | install(CODE " 88 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 89 | " COMPONENT Runtime) 90 | 91 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 92 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 93 | 94 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 95 | COMPONENT Runtime) 96 | 97 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 98 | COMPONENT Runtime) 99 | 100 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 101 | COMPONENT Runtime) 102 | 103 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 104 | install(FILES "${bundled_library}" 105 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 106 | COMPONENT Runtime) 107 | endforeach(bundled_library) 108 | 109 | # Copy the native assets provided by the build.dart from all packages. 110 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") 111 | install(DIRECTORY "${NATIVE_ASSETS_DIR}" 112 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 113 | COMPONENT Runtime) 114 | 115 | # Fully re-copy the assets directory on each build to avoid having stale files 116 | # from a previous install. 117 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 118 | install(CODE " 119 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 120 | " COMPONENT Runtime) 121 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 122 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 123 | 124 | # Install the AOT library on non-Debug builds only. 125 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 126 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 127 | COMPONENT Runtime) 128 | endif() 129 | -------------------------------------------------------------------------------- /linux/runner/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "docbuddy"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "docbuddy"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GApplication::startup. 85 | static void my_application_startup(GApplication* application) { 86 | //MyApplication* self = MY_APPLICATION(object); 87 | 88 | // Perform any actions required at application startup. 89 | 90 | G_APPLICATION_CLASS(my_application_parent_class)->startup(application); 91 | } 92 | 93 | // Implements GApplication::shutdown. 94 | static void my_application_shutdown(GApplication* application) { 95 | //MyApplication* self = MY_APPLICATION(object); 96 | 97 | // Perform any actions required at application shutdown. 98 | 99 | G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); 100 | } 101 | 102 | // Implements GObject::dispose. 103 | static void my_application_dispose(GObject* object) { 104 | MyApplication* self = MY_APPLICATION(object); 105 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 106 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 107 | } 108 | 109 | static void my_application_class_init(MyApplicationClass* klass) { 110 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 111 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 112 | G_APPLICATION_CLASS(klass)->startup = my_application_startup; 113 | G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; 114 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 115 | } 116 | 117 | static void my_application_init(MyApplication* self) {} 118 | 119 | MyApplication* my_application_new() { 120 | // Set the program name to the application ID, which helps various systems 121 | // like GTK and desktop environments map this running application to its 122 | // corresponding .desktop file. This ensures better integration by allowing 123 | // the application to be recognized beyond its binary name. 124 | g_set_prgname(APPLICATION_ID); 125 | 126 | return MY_APPLICATION(g_object_new(my_application_get_type(), 127 | "application-id", APPLICATION_ID, 128 | "flags", G_APPLICATION_NON_UNIQUE, 129 | nullptr)); 130 | } 131 | -------------------------------------------------------------------------------- /lib/screens/reset_password_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import '../services/firebase_auth_service.dart'; 4 | //import 'login_screen.dart'; 5 | 6 | class ResetPasswordScreen extends StatefulWidget { 7 | const ResetPasswordScreen({super.key}); 8 | 9 | @override 10 | State createState() => _ResetPasswordScreenState(); 11 | } 12 | 13 | class _ResetPasswordScreenState extends State { 14 | final emailController = TextEditingController(); 15 | String? message; 16 | bool loading = false; 17 | 18 | void handleReset() async { 19 | setState(() { 20 | message = null; 21 | loading = true; 22 | }); 23 | 24 | final email = emailController.text.trim(); 25 | 26 | if (email.isEmpty) { 27 | setState(() { 28 | message = "Email is required"; 29 | loading = false; 30 | }); 31 | return; 32 | } 33 | 34 | await FirebaseAuthService.resetPassword(email); 35 | setState(() { 36 | message = "Password reset link sent. Check your email."; 37 | loading = false; 38 | }); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | final bool isDark = Theme.of(context).brightness == Brightness.dark; 44 | final size = MediaQuery.of(context).size; 45 | 46 | final textFieldStyle = TextStyle(color: isDark ? Colors.white : Colors.black); 47 | final labelStyle = TextStyle(color: isDark ? Colors.white70 : Colors.black87); 48 | final iconColor = isDark ? Colors.white70 : Colors.black54; 49 | 50 | return Scaffold( 51 | body: Container( 52 | width: double.infinity, 53 | height: double.infinity, 54 | decoration: BoxDecoration( 55 | gradient: LinearGradient( 56 | colors: isDark 57 | ? [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)] 58 | : [Color(0xFFd0eaf5), Color(0xFFa5cfe8), Color(0xFF7fb1d6)], 59 | begin: Alignment.topCenter, 60 | end: Alignment.bottomCenter, 61 | ), 62 | ), 63 | child: Center( 64 | child: SingleChildScrollView( 65 | padding: const EdgeInsets.symmetric(horizontal: 20), 66 | child: ClipRRect( 67 | borderRadius: BorderRadius.circular(30), 68 | child: BackdropFilter( 69 | filter: ImageFilter.blur(sigmaX: 25, sigmaY: 25), 70 | child: Container( 71 | width: size.width * 0.9, 72 | padding: const EdgeInsets.all(24), 73 | decoration: BoxDecoration( 74 | color: isDark 75 | ? Colors.white.withOpacity(0.05) 76 | : Colors.white.withOpacity(0.3), 77 | borderRadius: BorderRadius.circular(30), 78 | border: Border.all(color: Colors.white.withOpacity(0.2)), 79 | ), 80 | child: Column( 81 | mainAxisSize: MainAxisSize.min, 82 | children: [ 83 | const Text( 84 | "Reset Password", 85 | style: TextStyle( 86 | fontSize: 28, 87 | fontWeight: FontWeight.bold, 88 | color: Colors.teal, 89 | ), 90 | ), 91 | const SizedBox(height: 24), 92 | if (message != null) 93 | Text( 94 | message!, 95 | style: TextStyle( 96 | fontSize: 14, 97 | fontWeight: FontWeight.w500, 98 | color: message!.contains("required") ? Colors.red : Colors.green, 99 | ), 100 | ), 101 | if (message != null) const SizedBox(height: 10), 102 | TextField( 103 | controller: emailController, 104 | style: textFieldStyle, 105 | keyboardType: TextInputType.emailAddress, 106 | decoration: InputDecoration( 107 | filled: true, 108 | fillColor: Colors.white.withOpacity(0.8), 109 | labelText: "Your Email", 110 | labelStyle: labelStyle, 111 | prefixIcon: Icon(Icons.email, color: iconColor), 112 | border: OutlineInputBorder( 113 | borderRadius: BorderRadius.circular(12), 114 | ), 115 | ), 116 | ), 117 | const SizedBox(height: 24), 118 | ElevatedButton( 119 | onPressed: loading ? null : handleReset, 120 | style: ElevatedButton.styleFrom( 121 | backgroundColor: Colors.teal, 122 | foregroundColor: Colors.white, 123 | padding: const EdgeInsets.symmetric(vertical: 16), 124 | minimumSize: const Size(double.infinity, 50), 125 | shape: RoundedRectangleBorder( 126 | borderRadius: BorderRadius.circular(30), 127 | ), 128 | elevation: 8, 129 | shadowColor: Colors.black54, 130 | ), 131 | child: loading 132 | ? const CircularProgressIndicator(color: Colors.white) 133 | : const Text( 134 | "Send Reset Email", 135 | style: TextStyle(fontSize: 16), 136 | ), 137 | ), 138 | const SizedBox(height: 20), 139 | TextButton( 140 | onPressed: () => Navigator.pop(context), 141 | child: const Text( 142 | "← Back to Login", 143 | style: TextStyle(color: Colors.white), 144 | ), 145 | ), 146 | ], 147 | ), 148 | ), 149 | ), 150 | ), 151 | ), 152 | ), 153 | ), 154 | ); 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /lib/screens/update_username_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:cloud_firestore/cloud_firestore.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'dart:ui'; 5 | 6 | class UpdateUsernameScreen extends StatefulWidget { 7 | const UpdateUsernameScreen({super.key}); 8 | 9 | @override 10 | State createState() => _UpdateUsernameScreenState(); 11 | } 12 | 13 | class _UpdateUsernameScreenState extends State { 14 | final TextEditingController usernameController = TextEditingController(); 15 | String? message; 16 | bool loading = false; 17 | 18 | Future _fetchCurrentUsername() async { 19 | final user = FirebaseAuth.instance.currentUser; 20 | if (user != null) { 21 | final doc = await FirebaseFirestore.instance.collection('users').doc(user.uid).get(); 22 | if (doc.exists) { 23 | final currentUsername = doc.data()?['username'] ?? ''; 24 | usernameController.text = currentUsername; 25 | } 26 | } 27 | } 28 | 29 | Future _updateUsername() async { 30 | final newUsername = usernameController.text.trim(); 31 | final user = FirebaseAuth.instance.currentUser; 32 | 33 | if (newUsername.isEmpty) { 34 | setState(() => message = "Username cannot be empty."); 35 | return; 36 | } 37 | 38 | if (user == null) { 39 | setState(() => message = "User not found."); 40 | return; 41 | } 42 | 43 | setState(() { 44 | loading = true; 45 | message = null; 46 | }); 47 | 48 | try { 49 | await FirebaseFirestore.instance 50 | .collection('users') 51 | .doc(user.uid) 52 | .set({'username': newUsername}, SetOptions(merge: true)); 53 | 54 | setState(() => message = "✅ Username updated successfully."); 55 | Future.delayed(const Duration(seconds: 2), () { 56 | Navigator.pop(context); 57 | }); 58 | } catch (e) { 59 | setState(() => message = "❌ Failed to update: $e"); 60 | } finally { 61 | setState(() => loading = false); 62 | } 63 | } 64 | 65 | @override 66 | void initState() { 67 | super.initState(); 68 | _fetchCurrentUsername(); 69 | } 70 | 71 | @override 72 | Widget build(BuildContext context) { 73 | return Scaffold( 74 | extendBodyBehindAppBar: true, 75 | appBar: AppBar( 76 | title: const Text( 77 | "Update Username", 78 | style: TextStyle( 79 | color: Colors.white, 80 | fontSize: 18, // Reduced text size 81 | fontWeight: FontWeight.w500, 82 | ), 83 | ), 84 | backgroundColor: Colors.transparent, 85 | elevation: 0, 86 | iconTheme: const IconThemeData(color: Colors.white), // White back icon 87 | toolbarHeight: 45, // Reduced height 88 | ), 89 | body: Stack( 90 | children: [ 91 | // Gradient Background 92 | Container( 93 | decoration: const BoxDecoration( 94 | gradient: LinearGradient( 95 | colors: [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)], 96 | begin: Alignment.topLeft, 97 | end: Alignment.bottomRight, 98 | ), 99 | ), 100 | ), 101 | 102 | // Glass effect card 103 | Center( 104 | child: ClipRRect( 105 | borderRadius: BorderRadius.circular(25), 106 | child: BackdropFilter( 107 | filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15), 108 | child: Container( 109 | width: MediaQuery.of(context).size.width * 0.9, 110 | padding: const EdgeInsets.all(24), 111 | decoration: BoxDecoration( 112 | color: Colors.white.withOpacity(0.15), 113 | borderRadius: BorderRadius.circular(25), 114 | border: Border.all(color: Colors.white.withOpacity(0.2)), 115 | ), 116 | child: Column( 117 | mainAxisSize: MainAxisSize.min, 118 | children: [ 119 | const Icon(Icons.person_pin_circle, size: 60, color: Colors.white), 120 | const SizedBox(height: 16), 121 | TextField( 122 | controller: usernameController, 123 | style: const TextStyle(color: Colors.white), 124 | decoration: InputDecoration( 125 | prefixIcon: const Icon(Icons.person, color: Colors.white70), 126 | labelText: "New Username", 127 | labelStyle: const TextStyle(color: Colors.white70), 128 | filled: true, 129 | fillColor: Colors.white.withOpacity(0.1), 130 | enabledBorder: OutlineInputBorder( 131 | borderRadius: BorderRadius.circular(12), 132 | borderSide: const BorderSide(color: Colors.white24), 133 | ), 134 | focusedBorder: OutlineInputBorder( 135 | borderRadius: BorderRadius.circular(12), 136 | borderSide: const BorderSide(color: Colors.tealAccent), 137 | ), 138 | ), 139 | ), 140 | const SizedBox(height: 20), 141 | 142 | // Status Message 143 | if (message != null) 144 | Padding( 145 | padding: const EdgeInsets.only(bottom: 12), 146 | child: Text( 147 | message!, 148 | textAlign: TextAlign.center, 149 | style: TextStyle( 150 | color: message!.contains("✅") ? Colors.greenAccent : Colors.redAccent, 151 | fontWeight: FontWeight.w600, 152 | ), 153 | ), 154 | ), 155 | 156 | // Update Button 157 | ElevatedButton( 158 | style: ElevatedButton.styleFrom( 159 | backgroundColor: Colors.tealAccent[700], 160 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), 161 | padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 14), 162 | ), 163 | onPressed: loading ? null : _updateUsername, 164 | child: loading 165 | ? const CircularProgressIndicator(color: Colors.white) 166 | : const Text("Update Username", style: TextStyle(color: Colors.white)), 167 | ), 168 | ], 169 | ), 170 | ), 171 | ), 172 | ), 173 | ), 174 | ], 175 | ), 176 | ); 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /lib/screens/update_password_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:firebase_auth/firebase_auth.dart'; 3 | 4 | class UpdatePasswordScreen extends StatefulWidget { 5 | const UpdatePasswordScreen({super.key}); 6 | 7 | @override 8 | State createState() => _UpdatePasswordScreenState(); 9 | } 10 | 11 | class _UpdatePasswordScreenState extends State { 12 | final currentPasswordController = TextEditingController(); 13 | final newPasswordController = TextEditingController(); 14 | final confirmPasswordController = TextEditingController(); 15 | 16 | String? message; 17 | bool loading = false; 18 | 19 | Future handleUpdatePassword() async { 20 | final user = FirebaseAuth.instance.currentUser; 21 | final email = user?.email; 22 | final currentPassword = currentPasswordController.text.trim(); 23 | final newPassword = newPasswordController.text.trim(); 24 | final confirmPassword = confirmPasswordController.text.trim(); 25 | 26 | setState(() { 27 | message = null; 28 | loading = true; 29 | }); 30 | 31 | if (currentPassword.isEmpty || newPassword.isEmpty || confirmPassword.isEmpty) { 32 | setState(() { 33 | message = "Please fill in all fields."; 34 | loading = false; 35 | }); 36 | return; 37 | } 38 | 39 | if (newPassword != confirmPassword) { 40 | setState(() { 41 | message = "New passwords do not match."; 42 | loading = false; 43 | }); 44 | return; 45 | } 46 | 47 | try { 48 | final credential = EmailAuthProvider.credential(email: email!, password: currentPassword); 49 | await user!.reauthenticateWithCredential(credential); 50 | await user.updatePassword(newPassword); 51 | 52 | setState(() { 53 | message = "✅ Password updated successfully!"; 54 | }); 55 | 56 | Future.delayed(const Duration(seconds: 2), () { 57 | Navigator.pop(context); 58 | }); 59 | } on FirebaseAuthException catch (e) { 60 | setState(() { 61 | message = "❌ ${e.message ?? "Failed to update password."}"; 62 | }); 63 | } catch (e) { 64 | setState(() { 65 | message = "❌ Unexpected error: $e"; 66 | }); 67 | } finally { 68 | setState(() => loading = false); 69 | } 70 | } 71 | 72 | @override 73 | Widget build(BuildContext c) { 74 | return Scaffold( 75 | extendBodyBehindAppBar: true, 76 | appBar: AppBar( 77 | title: const Text( 78 | "Update Password", 79 | style: TextStyle(color: Colors.white), 80 | ), 81 | backgroundColor: Colors.transparent, 82 | elevation: 0, 83 | iconTheme: const IconThemeData(color: Colors.white), // Back button white 84 | ), 85 | body: Container( 86 | decoration: const BoxDecoration( 87 | gradient: LinearGradient( 88 | colors: [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)], 89 | begin: Alignment.topLeft, 90 | end: Alignment.bottomRight, 91 | ), 92 | ), 93 | padding: const EdgeInsets.symmetric(horizontal: 24), 94 | child: Center( 95 | child: SingleChildScrollView( 96 | child: ClipRRect( 97 | borderRadius: BorderRadius.circular(20), 98 | child: Container( 99 | padding: const EdgeInsets.all(24), 100 | decoration: BoxDecoration( 101 | color: Colors.white.withOpacity(0.1), 102 | borderRadius: BorderRadius.circular(20), 103 | border: Border.all(color: Colors.white24), 104 | boxShadow: [ 105 | BoxShadow( 106 | color: Colors.black.withOpacity(0.2), 107 | blurRadius: 8, 108 | offset: const Offset(0, 4), 109 | ), 110 | ], 111 | ), 112 | child: Column( 113 | children: [ 114 | const Icon(Icons.lock_outline, size: 64, color: Colors.white), 115 | const SizedBox(height: 16), 116 | const Text( 117 | "Change Your Password", 118 | style: TextStyle(color: Colors.white, fontSize: 22, fontWeight: FontWeight.bold), 119 | ), 120 | const SizedBox(height: 24), 121 | if (message != null) 122 | Text( 123 | message!, 124 | style: TextStyle( 125 | color: message!.contains("✅") ? Colors.greenAccent : Colors.redAccent, 126 | fontSize: 16, 127 | fontWeight: FontWeight.w500, 128 | ), 129 | ), 130 | const SizedBox(height: 12), 131 | _customTextField(currentPasswordController, "Current Password"), 132 | const SizedBox(height: 12), 133 | _customTextField(newPasswordController, "New Password"), 134 | const SizedBox(height: 12), 135 | _customTextField(confirmPasswordController, "Confirm New Password"), 136 | const SizedBox(height: 24), 137 | ElevatedButton( 138 | style: ElevatedButton.styleFrom( 139 | backgroundColor: Colors.tealAccent[700], 140 | padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 14), 141 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), 142 | ), 143 | onPressed: loading ? null : handleUpdatePassword, 144 | child: loading 145 | ? const CircularProgressIndicator(color: Colors.white) 146 | : const Text( 147 | "Update Password", 148 | style: TextStyle(fontSize: 16, color: Colors.white), 149 | ), 150 | ), 151 | ], 152 | ), 153 | ), 154 | ), 155 | ), 156 | ), 157 | ), 158 | ); 159 | } 160 | 161 | Widget _customTextField(TextEditingController controller, String hint) { 162 | return TextField( 163 | controller: controller, 164 | obscureText: true, 165 | style: const TextStyle(color: Colors.white), 166 | decoration: InputDecoration( 167 | labelText: hint, 168 | labelStyle: const TextStyle(color: Colors.white70), 169 | filled: true, 170 | fillColor: Colors.white10, 171 | focusedBorder: OutlineInputBorder( 172 | borderRadius: BorderRadius.circular(15), 173 | borderSide: const BorderSide(color: Colors.tealAccent, width: 1.5), 174 | ), 175 | enabledBorder: OutlineInputBorder( 176 | borderRadius: BorderRadius.circular(15), 177 | borderSide: const BorderSide(color: Colors.white30), 178 | ), 179 | ), 180 | ); 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /lib/screens/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import '../services/firebase_auth_service.dart'; 4 | import 'register_screen.dart'; 5 | import 'reset_password_screen.dart'; 6 | 7 | class LoginScreen extends StatefulWidget { 8 | const LoginScreen({super.key}); 9 | 10 | @override 11 | State createState() => _LoginScreenState(); 12 | } 13 | 14 | class _LoginScreenState extends State { 15 | final emailController = TextEditingController(); 16 | final passwordController = TextEditingController(); 17 | String? error; 18 | bool loading = false; 19 | 20 | void handleLogin() async { 21 | setState(() { 22 | loading = true; 23 | error = null; 24 | }); 25 | 26 | final err = await FirebaseAuthService.login( 27 | emailController.text.trim(), 28 | passwordController.text, 29 | ); 30 | 31 | setState(() => loading = false); 32 | 33 | if (err != null) { 34 | setState(() => error = err); 35 | } 36 | } 37 | 38 | @override 39 | Widget build(BuildContext context) { 40 | final bool isDark = Theme.of(context).brightness == Brightness.dark; 41 | final size = MediaQuery.of(context).size; 42 | 43 | final textFieldStyle = TextStyle( 44 | color: isDark ? Colors.white : Colors.black, 45 | ); 46 | 47 | final labelStyle = TextStyle( 48 | color: isDark ? Colors.white70 : Colors.black87, 49 | ); 50 | 51 | final iconColor = isDark ? Colors.white70 : Colors.black54; 52 | 53 | return Scaffold( 54 | body: Container( 55 | width: double.infinity, 56 | height: double.infinity, 57 | decoration: BoxDecoration( 58 | gradient: LinearGradient( 59 | colors: isDark 60 | ? [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)] 61 | : [Color(0xFFd0eaf5), Color(0xFFa5cfe8), Color(0xFF7fb1d6)], 62 | begin: Alignment.topCenter, 63 | end: Alignment.bottomCenter, 64 | ), 65 | ), 66 | child: Center( 67 | child: SingleChildScrollView( 68 | padding: const EdgeInsets.symmetric(horizontal: 20), 69 | child: ClipRRect( 70 | borderRadius: BorderRadius.circular(30), 71 | child: BackdropFilter( 72 | filter: ImageFilter.blur(sigmaX: 25, sigmaY: 25), 73 | child: Container( 74 | width: size.width * 0.9, 75 | padding: const EdgeInsets.all(24), 76 | decoration: BoxDecoration( 77 | color: isDark 78 | ? Colors.white.withOpacity(0.05) 79 | : Colors.white.withOpacity(0.3), 80 | borderRadius: BorderRadius.circular(30), 81 | border: Border.all(color: Colors.white.withOpacity(0.2)), 82 | ), 83 | child: Column( 84 | mainAxisSize: MainAxisSize.min, 85 | children: [ 86 | const Text( 87 | 'DocBuddy', 88 | style: TextStyle( 89 | fontSize: 32, 90 | fontWeight: FontWeight.bold, 91 | color: Colors.teal, 92 | ), 93 | ), 94 | const SizedBox(height: 24), 95 | if (error != null) 96 | Text( 97 | error!, 98 | style: const TextStyle(color: Colors.red, fontSize: 14), 99 | ), 100 | if (error != null) const SizedBox(height: 10), 101 | TextField( 102 | controller: emailController, 103 | keyboardType: TextInputType.emailAddress, 104 | style: textFieldStyle, 105 | decoration: InputDecoration( 106 | filled: true, 107 | fillColor: Colors.white.withOpacity(0.8), 108 | labelText: 'Email', 109 | labelStyle: labelStyle, 110 | prefixIcon: Icon(Icons.email, color: iconColor), 111 | border: OutlineInputBorder( 112 | borderRadius: BorderRadius.circular(12), 113 | ), 114 | ), 115 | ), 116 | const SizedBox(height: 16), 117 | TextField( 118 | controller: passwordController, 119 | obscureText: true, 120 | style: textFieldStyle, 121 | decoration: InputDecoration( 122 | filled: true, 123 | fillColor: Colors.white.withOpacity(0.8), 124 | labelText: 'Password', 125 | labelStyle: labelStyle, 126 | prefixIcon: Icon(Icons.lock, color: iconColor), 127 | border: OutlineInputBorder( 128 | borderRadius: BorderRadius.circular(12), 129 | ), 130 | ), 131 | ), 132 | const SizedBox(height: 24), 133 | ElevatedButton( 134 | onPressed: loading ? null : handleLogin, 135 | style: ElevatedButton.styleFrom( 136 | backgroundColor: Colors.teal, 137 | foregroundColor: Colors.white, 138 | padding: const EdgeInsets.symmetric(vertical: 16), 139 | minimumSize: const Size(double.infinity, 50), 140 | shape: RoundedRectangleBorder( 141 | borderRadius: BorderRadius.circular(30), 142 | ), 143 | elevation: 8, 144 | shadowColor: Colors.black54, 145 | ), 146 | child: loading 147 | ? const CircularProgressIndicator(color: Colors.white) 148 | : const Text('Login', style: TextStyle(fontSize: 18)), 149 | ), 150 | const SizedBox(height: 20), 151 | TextButton( 152 | onPressed: () => Navigator.push( 153 | context, 154 | MaterialPageRoute(builder: (_) => const RegisterScreen()), 155 | ), 156 | child: const Text( 157 | "Don't have an account? Register", 158 | style: TextStyle(color: Colors.white), 159 | ), 160 | ), 161 | TextButton( 162 | onPressed: () => Navigator.push( 163 | context, 164 | MaterialPageRoute(builder: (_) => const ResetPasswordScreen()), 165 | ), 166 | child: const Text( 167 | "Forgot Password?", 168 | style: TextStyle(color: Colors.white70), 169 | ), 170 | ), 171 | ], 172 | ), 173 | ), 174 | ), 175 | ), 176 | ), 177 | ), 178 | ), 179 | ); 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /lib/screens/profile_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import '../services/firebase_auth_service.dart'; 4 | import 'login_screen.dart'; 5 | import 'update_username_screen.dart'; 6 | import 'update_password_screen.dart'; 7 | 8 | class ProfileScreen extends StatelessWidget { 9 | const ProfileScreen({super.key}); 10 | 11 | void _logout(BuildContext context) async { 12 | await FirebaseAuthService.logout(); 13 | Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => const LoginScreen())); 14 | } 15 | 16 | void _deleteAccount(BuildContext context) { 17 | showDialog( 18 | context: context, 19 | builder: (_) => AlertDialog( 20 | title: const Text("Delete Account"), 21 | content: const Text("Are you sure you want to delete your account?"), 22 | actions: [ 23 | TextButton(child: const Text("Cancel"), onPressed: () => Navigator.pop(context)), 24 | TextButton( 25 | child: const Text("Delete", style: TextStyle(color: Colors.red)), 26 | onPressed: () async { 27 | Navigator.pop(context); 28 | final err = await FirebaseAuthService.deleteAccount(); 29 | if (err == null) { 30 | Navigator.pushAndRemoveUntil( 31 | context, 32 | MaterialPageRoute(builder: (_) => const LoginScreen()), 33 | (_) => false, 34 | ); 35 | } else { 36 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(err))); 37 | } 38 | }, 39 | ), 40 | ], 41 | ), 42 | ); 43 | } 44 | 45 | @override 46 | Widget build(BuildContext context) { 47 | final user = FirebaseAuthService.currentUser; 48 | final bool isDark = Theme.of(context).brightness == Brightness.dark; 49 | final size = MediaQuery.of(context).size; 50 | 51 | return Scaffold( 52 | extendBodyBehindAppBar: true, 53 | appBar: AppBar( 54 | title: const Text( 55 | "My Profile", 56 | style: TextStyle(color: Colors.white), 57 | ), 58 | backgroundColor: Colors.transparent, 59 | elevation: 0, 60 | iconTheme: const IconThemeData(color: Colors.white), 61 | ), 62 | body: Container( 63 | width: double.infinity, 64 | height: double.infinity, 65 | decoration: BoxDecoration( 66 | gradient: LinearGradient( 67 | colors: isDark 68 | ? [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)] 69 | : [Color(0xFFd0eaf5), Color(0xFFa5cfe8), Color(0xFF7fb1d6)], 70 | begin: Alignment.topCenter, 71 | end: Alignment.bottomCenter, 72 | ), 73 | ), 74 | child: SafeArea( 75 | child: Center( 76 | child: ClipRRect( 77 | borderRadius: BorderRadius.circular(30), 78 | child: BackdropFilter( 79 | filter: ImageFilter.blur(sigmaX: 25, sigmaY: 25), 80 | child: Container( 81 | width: size.width * 0.9, 82 | padding: const EdgeInsets.all(24), 83 | decoration: BoxDecoration( 84 | color: isDark 85 | ? Colors.white.withOpacity(0.05) 86 | : Colors.white.withOpacity(0.3), 87 | borderRadius: BorderRadius.circular(30), 88 | border: Border.all(color: Colors.white.withOpacity(0.2)), 89 | ), 90 | child: user == null 91 | ? const Text("No user logged in.", style: TextStyle(color: Colors.white)) 92 | : Column( 93 | mainAxisSize: MainAxisSize.min, 94 | children: [ 95 | const CircleAvatar( 96 | radius: 45, 97 | backgroundColor: Colors.teal, 98 | child: Icon(Icons.person, size: 50, color: Colors.white), 99 | ), 100 | const SizedBox(height: 20), 101 | Text("Email:", style: TextStyle(color: Colors.white70)), 102 | Text( 103 | user.email ?? "", 104 | style: const TextStyle( 105 | fontSize: 18, 106 | fontWeight: FontWeight.w600, 107 | color: Colors.white, 108 | ), 109 | ), 110 | const SizedBox(height: 30), 111 | 112 | // Buttons 113 | _buildProfileButton( 114 | context, 115 | icon: Icons.edit, 116 | label: "Update Username", 117 | onPressed: () => Navigator.push( 118 | context, 119 | MaterialPageRoute(builder: (_) => const UpdateUsernameScreen()), 120 | ), 121 | ), 122 | const SizedBox(height: 12), 123 | _buildProfileButton( 124 | context, 125 | icon: Icons.lock, 126 | label: "Update Password", 127 | onPressed: () => Navigator.push( 128 | context, 129 | MaterialPageRoute(builder: (_) => const UpdatePasswordScreen()), 130 | ), 131 | ), 132 | const SizedBox(height: 12), 133 | _buildProfileButton( 134 | context, 135 | icon: Icons.delete_forever, 136 | label: "Delete Account", 137 | color: Colors.redAccent, 138 | onPressed: () => _deleteAccount(context), 139 | ), 140 | const SizedBox(height: 30), 141 | 142 | TextButton.icon( 143 | onPressed: () => _logout(context), 144 | icon: const Icon(Icons.logout, color: Colors.white70), 145 | label: const Text( 146 | "Logout", 147 | style: TextStyle(color: Colors.white70, fontSize: 16), 148 | ), 149 | ), 150 | ], 151 | ), 152 | ), 153 | ), 154 | ), 155 | ), 156 | ), 157 | ), 158 | ); 159 | } 160 | 161 | Widget _buildProfileButton( 162 | BuildContext context, { 163 | required IconData icon, 164 | required String label, 165 | required VoidCallback onPressed, 166 | Color? color, 167 | }) { 168 | return ElevatedButton.icon( 169 | icon: Icon(icon, size: 20), 170 | label: Text(label, style: const TextStyle(fontSize: 16)), 171 | style: ElevatedButton.styleFrom( 172 | backgroundColor: color ?? Colors.tealAccent[700], 173 | foregroundColor: Colors.white, 174 | minimumSize: const Size(double.infinity, 48), 175 | elevation: 6, 176 | shadowColor: Colors.black38, 177 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), 178 | ), 179 | onPressed: onPressed, 180 | ); 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /lib/screens/register_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import '../services/firebase_auth_service.dart'; 4 | import 'home_screen.dart'; 5 | import 'login_screen.dart'; 6 | 7 | class RegisterScreen extends StatefulWidget { 8 | const RegisterScreen({super.key}); 9 | 10 | @override 11 | State createState() => _RegisterScreenState(); 12 | } 13 | 14 | class _RegisterScreenState extends State { 15 | final emailController = TextEditingController(); 16 | final passwordController = TextEditingController(); 17 | final confirmController = TextEditingController(); 18 | 19 | String? error, success; 20 | bool loading = false; 21 | 22 | void handleRegister() async { 23 | setState(() { 24 | error = success = null; 25 | loading = true; 26 | }); 27 | 28 | final email = emailController.text.trim(); 29 | final pass = passwordController.text; 30 | final confirm = confirmController.text; 31 | 32 | if (email.isEmpty || pass.isEmpty || confirm.isEmpty) { 33 | setState(() { 34 | error = "All fields are required."; 35 | loading = false; 36 | }); 37 | return; 38 | } 39 | 40 | if (pass != confirm) { 41 | setState(() { 42 | error = "Passwords do not match."; 43 | loading = false; 44 | }); 45 | return; 46 | } 47 | 48 | final err = await FirebaseAuthService.register(email, pass); 49 | setState(() => loading = false); 50 | 51 | if (err == null) { 52 | setState(() => success = "Registration successful! Redirecting…"); 53 | Future.delayed(const Duration(seconds: 2), () { 54 | Navigator.pushReplacement( 55 | context, 56 | MaterialPageRoute(builder: (_) => const HomeScreen()), 57 | ); 58 | }); 59 | } else { 60 | setState(() => error = err); 61 | } 62 | } 63 | 64 | @override 65 | Widget build(BuildContext context) { 66 | final isDark = Theme.of(context).brightness == Brightness.dark; 67 | final size = MediaQuery.of(context).size; 68 | 69 | return Scaffold( 70 | body: Container( 71 | width: double.infinity, 72 | height: double.infinity, 73 | decoration: BoxDecoration( 74 | gradient: LinearGradient( 75 | colors: isDark 76 | ? [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)] 77 | : [Color(0xFFd0eaf5), Color(0xFFa5cfe8), Color(0xFF7fb1d6)], 78 | begin: Alignment.topCenter, 79 | end: Alignment.bottomCenter, 80 | ), 81 | ), 82 | child: Center( 83 | child: SingleChildScrollView( 84 | padding: const EdgeInsets.symmetric(horizontal: 20), 85 | child: ClipRRect( 86 | borderRadius: BorderRadius.circular(30), 87 | child: BackdropFilter( 88 | filter: ImageFilter.blur(sigmaX: 25, sigmaY: 25), 89 | child: Container( 90 | width: size.width * 0.9, 91 | padding: const EdgeInsets.all(24), 92 | decoration: BoxDecoration( 93 | color: isDark 94 | ? Colors.white.withOpacity(0.05) 95 | : Colors.white.withOpacity(0.3), 96 | borderRadius: BorderRadius.circular(30), 97 | border: Border.all(color: Colors.white.withOpacity(0.2)), 98 | ), 99 | child: Column( 100 | mainAxisSize: MainAxisSize.min, 101 | children: [ 102 | const Text( 103 | 'Register - DocBuddy', 104 | style: TextStyle( 105 | fontSize: 28, 106 | fontWeight: FontWeight.bold, 107 | color: Colors.teal, 108 | ), 109 | ), 110 | const SizedBox(height: 20), 111 | if (error != null) 112 | Text(error!, style: const TextStyle(color: Colors.red)), 113 | if (success != null) 114 | Text(success!, style: const TextStyle(color: Colors.green)), 115 | const SizedBox(height: 10), 116 | TextField( 117 | controller: emailController, 118 | keyboardType: TextInputType.emailAddress, 119 | decoration: InputDecoration( 120 | filled: true, 121 | fillColor: Colors.white.withOpacity(0.8), 122 | labelText: "Email", 123 | prefixIcon: const Icon(Icons.email), 124 | border: OutlineInputBorder( 125 | borderRadius: BorderRadius.circular(12), 126 | ), 127 | ), 128 | ), 129 | const SizedBox(height: 16), 130 | TextField( 131 | controller: passwordController, 132 | obscureText: true, 133 | decoration: InputDecoration( 134 | filled: true, 135 | fillColor: Colors.white.withOpacity(0.8), 136 | labelText: "Password", 137 | prefixIcon: const Icon(Icons.lock), 138 | border: OutlineInputBorder( 139 | borderRadius: BorderRadius.circular(12), 140 | ), 141 | ), 142 | ), 143 | const SizedBox(height: 16), 144 | TextField( 145 | controller: confirmController, 146 | obscureText: true, 147 | decoration: InputDecoration( 148 | filled: true, 149 | fillColor: Colors.white.withOpacity(0.8), 150 | labelText: "Confirm Password", 151 | prefixIcon: const Icon(Icons.lock_outline), 152 | border: OutlineInputBorder( 153 | borderRadius: BorderRadius.circular(12), 154 | ), 155 | ), 156 | ), 157 | const SizedBox(height: 24), 158 | ElevatedButton( 159 | onPressed: loading ? null : handleRegister, 160 | style: ElevatedButton.styleFrom( 161 | backgroundColor: Colors.teal, 162 | foregroundColor: Colors.white, 163 | padding: const EdgeInsets.symmetric(vertical: 16), 164 | minimumSize: const Size(double.infinity, 50), 165 | shape: RoundedRectangleBorder( 166 | borderRadius: BorderRadius.circular(30), 167 | ), 168 | elevation: 8, 169 | shadowColor: Colors.black54, 170 | ), 171 | child: loading 172 | ? const CircularProgressIndicator(color: Colors.white) 173 | : const Text("Register", style: TextStyle(fontSize: 18)), 174 | ), 175 | const SizedBox(height: 20), 176 | TextButton( 177 | onPressed: () => Navigator.pushReplacement( 178 | context, 179 | MaterialPageRoute(builder: (_) => const LoginScreen()), 180 | ), 181 | child: const Text( 182 | "Already have an account? Login", 183 | style: TextStyle(color: Colors.white), 184 | ), 185 | ), 186 | ], 187 | ), 188 | ), 189 | ), 190 | ), 191 | ), 192 | ), 193 | ), 194 | ); 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "resource.h" 7 | 8 | namespace { 9 | 10 | /// Window attribute that enables dark mode window decorations. 11 | /// 12 | /// Redefined in case the developer's machine has a Windows SDK older than 13 | /// version 10.0.22000.0. 14 | /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute 15 | #ifndef DWMWA_USE_IMMERSIVE_DARK_MODE 16 | #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 17 | #endif 18 | 19 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 20 | 21 | /// Registry key for app theme preference. 22 | /// 23 | /// A value of 0 indicates apps should use dark mode. A non-zero or missing 24 | /// value indicates apps should use light mode. 25 | constexpr const wchar_t kGetPreferredBrightnessRegKey[] = 26 | L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; 27 | constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; 28 | 29 | // The number of Win32Window objects that currently exist. 30 | static int g_active_window_count = 0; 31 | 32 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 33 | 34 | // Scale helper to convert logical scaler values to physical using passed in 35 | // scale factor 36 | int Scale(int source, double scale_factor) { 37 | return static_cast(source * scale_factor); 38 | } 39 | 40 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 41 | // This API is only needed for PerMonitor V1 awareness mode. 42 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 43 | HMODULE user32_module = LoadLibraryA("User32.dll"); 44 | if (!user32_module) { 45 | return; 46 | } 47 | auto enable_non_client_dpi_scaling = 48 | reinterpret_cast( 49 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 50 | if (enable_non_client_dpi_scaling != nullptr) { 51 | enable_non_client_dpi_scaling(hwnd); 52 | } 53 | FreeLibrary(user32_module); 54 | } 55 | 56 | } // namespace 57 | 58 | // Manages the Win32Window's window class registration. 59 | class WindowClassRegistrar { 60 | public: 61 | ~WindowClassRegistrar() = default; 62 | 63 | // Returns the singleton registrar instance. 64 | static WindowClassRegistrar* GetInstance() { 65 | if (!instance_) { 66 | instance_ = new WindowClassRegistrar(); 67 | } 68 | return instance_; 69 | } 70 | 71 | // Returns the name of the window class, registering the class if it hasn't 72 | // previously been registered. 73 | const wchar_t* GetWindowClass(); 74 | 75 | // Unregisters the window class. Should only be called if there are no 76 | // instances of the window. 77 | void UnregisterWindowClass(); 78 | 79 | private: 80 | WindowClassRegistrar() = default; 81 | 82 | static WindowClassRegistrar* instance_; 83 | 84 | bool class_registered_ = false; 85 | }; 86 | 87 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 88 | 89 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 90 | if (!class_registered_) { 91 | WNDCLASS window_class{}; 92 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 93 | window_class.lpszClassName = kWindowClassName; 94 | window_class.style = CS_HREDRAW | CS_VREDRAW; 95 | window_class.cbClsExtra = 0; 96 | window_class.cbWndExtra = 0; 97 | window_class.hInstance = GetModuleHandle(nullptr); 98 | window_class.hIcon = 99 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 100 | window_class.hbrBackground = 0; 101 | window_class.lpszMenuName = nullptr; 102 | window_class.lpfnWndProc = Win32Window::WndProc; 103 | RegisterClass(&window_class); 104 | class_registered_ = true; 105 | } 106 | return kWindowClassName; 107 | } 108 | 109 | void WindowClassRegistrar::UnregisterWindowClass() { 110 | UnregisterClass(kWindowClassName, nullptr); 111 | class_registered_ = false; 112 | } 113 | 114 | Win32Window::Win32Window() { 115 | ++g_active_window_count; 116 | } 117 | 118 | Win32Window::~Win32Window() { 119 | --g_active_window_count; 120 | Destroy(); 121 | } 122 | 123 | bool Win32Window::Create(const std::wstring& title, 124 | const Point& origin, 125 | const Size& size) { 126 | Destroy(); 127 | 128 | const wchar_t* window_class = 129 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 130 | 131 | const POINT target_point = {static_cast(origin.x), 132 | static_cast(origin.y)}; 133 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 134 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 135 | double scale_factor = dpi / 96.0; 136 | 137 | HWND window = CreateWindow( 138 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW, 139 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 140 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 141 | nullptr, nullptr, GetModuleHandle(nullptr), this); 142 | 143 | if (!window) { 144 | return false; 145 | } 146 | 147 | UpdateTheme(window); 148 | 149 | return OnCreate(); 150 | } 151 | 152 | bool Win32Window::Show() { 153 | return ShowWindow(window_handle_, SW_SHOWNORMAL); 154 | } 155 | 156 | // static 157 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 158 | UINT const message, 159 | WPARAM const wparam, 160 | LPARAM const lparam) noexcept { 161 | if (message == WM_NCCREATE) { 162 | auto window_struct = reinterpret_cast(lparam); 163 | SetWindowLongPtr(window, GWLP_USERDATA, 164 | reinterpret_cast(window_struct->lpCreateParams)); 165 | 166 | auto that = static_cast(window_struct->lpCreateParams); 167 | EnableFullDpiSupportIfAvailable(window); 168 | that->window_handle_ = window; 169 | } else if (Win32Window* that = GetThisFromHandle(window)) { 170 | return that->MessageHandler(window, message, wparam, lparam); 171 | } 172 | 173 | return DefWindowProc(window, message, wparam, lparam); 174 | } 175 | 176 | LRESULT 177 | Win32Window::MessageHandler(HWND hwnd, 178 | UINT const message, 179 | WPARAM const wparam, 180 | LPARAM const lparam) noexcept { 181 | switch (message) { 182 | case WM_DESTROY: 183 | window_handle_ = nullptr; 184 | Destroy(); 185 | if (quit_on_close_) { 186 | PostQuitMessage(0); 187 | } 188 | return 0; 189 | 190 | case WM_DPICHANGED: { 191 | auto newRectSize = reinterpret_cast(lparam); 192 | LONG newWidth = newRectSize->right - newRectSize->left; 193 | LONG newHeight = newRectSize->bottom - newRectSize->top; 194 | 195 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 196 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 197 | 198 | return 0; 199 | } 200 | case WM_SIZE: { 201 | RECT rect = GetClientArea(); 202 | if (child_content_ != nullptr) { 203 | // Size and position the child window. 204 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 205 | rect.bottom - rect.top, TRUE); 206 | } 207 | return 0; 208 | } 209 | 210 | case WM_ACTIVATE: 211 | if (child_content_ != nullptr) { 212 | SetFocus(child_content_); 213 | } 214 | return 0; 215 | 216 | case WM_DWMCOLORIZATIONCOLORCHANGED: 217 | UpdateTheme(hwnd); 218 | return 0; 219 | } 220 | 221 | return DefWindowProc(window_handle_, message, wparam, lparam); 222 | } 223 | 224 | void Win32Window::Destroy() { 225 | OnDestroy(); 226 | 227 | if (window_handle_) { 228 | DestroyWindow(window_handle_); 229 | window_handle_ = nullptr; 230 | } 231 | if (g_active_window_count == 0) { 232 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 233 | } 234 | } 235 | 236 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 237 | return reinterpret_cast( 238 | GetWindowLongPtr(window, GWLP_USERDATA)); 239 | } 240 | 241 | void Win32Window::SetChildContent(HWND content) { 242 | child_content_ = content; 243 | SetParent(content, window_handle_); 244 | RECT frame = GetClientArea(); 245 | 246 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 247 | frame.bottom - frame.top, true); 248 | 249 | SetFocus(child_content_); 250 | } 251 | 252 | RECT Win32Window::GetClientArea() { 253 | RECT frame; 254 | GetClientRect(window_handle_, &frame); 255 | return frame; 256 | } 257 | 258 | HWND Win32Window::GetHandle() { 259 | return window_handle_; 260 | } 261 | 262 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 263 | quit_on_close_ = quit_on_close; 264 | } 265 | 266 | bool Win32Window::OnCreate() { 267 | // No-op; provided for subclasses. 268 | return true; 269 | } 270 | 271 | void Win32Window::OnDestroy() { 272 | // No-op; provided for subclasses. 273 | } 274 | 275 | void Win32Window::UpdateTheme(HWND const window) { 276 | DWORD light_mode; 277 | DWORD light_mode_size = sizeof(light_mode); 278 | LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, 279 | kGetPreferredBrightnessRegValue, 280 | RRF_RT_REG_DWORD, nullptr, &light_mode, 281 | &light_mode_size); 282 | 283 | if (result == ERROR_SUCCESS) { 284 | BOOL enable_dark_mode = light_mode == 0; 285 | DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, 286 | &enable_dark_mode, sizeof(enable_dark_mode)); 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /lib/screens/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | 6 | import 'chatbot_screen.dart'; 7 | import 'virtual_assistant_screen.dart'; 8 | import 'profile_screen.dart'; 9 | import 'reminder_screen.dart'; // NEW 10 | import 'nearby_screen.dart'; // NEW 11 | import '../main.dart'; // themeNotifier 12 | 13 | class HomeScreen extends StatelessWidget { 14 | const HomeScreen({super.key}); 15 | 16 | void _logout(BuildContext context) async { 17 | await FirebaseAuth.instance.signOut(); 18 | ScaffoldMessenger.of(context).showSnackBar( 19 | const SnackBar(content: Text('Logged out successfully')), 20 | ); 21 | Navigator.pop(context); 22 | } 23 | 24 | Future _toggleTheme() async { 25 | final prefs = await SharedPreferences.getInstance(); 26 | themeNotifier.value = themeNotifier.value == ThemeMode.light 27 | ? ThemeMode.dark 28 | : ThemeMode.light; 29 | await prefs.setString('themeMode', themeNotifier.value.toString()); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | final user = FirebaseAuth.instance.currentUser; 35 | final size = MediaQuery.of(context).size; 36 | final bool isDark = Theme.of(context).brightness == Brightness.dark; 37 | 38 | return Scaffold( 39 | extendBodyBehindAppBar: true, 40 | drawer: Drawer( 41 | child: ListView( 42 | padding: EdgeInsets.zero, 43 | children: [ 44 | UserAccountsDrawerHeader( 45 | decoration: BoxDecoration( 46 | gradient: LinearGradient( 47 | colors: isDark 48 | ? [Color(0xFF0f2027), Color(0xFF203a43)] 49 | : [Colors.teal, Colors.tealAccent], 50 | ), 51 | ), 52 | accountName: const Text('Welcome'), 53 | accountEmail: Text(user?.email ?? 'User'), 54 | currentAccountPicture: const CircleAvatar( 55 | backgroundColor: Colors.white, 56 | child: Icon(Icons.person, color: Colors.teal), 57 | ), 58 | ), 59 | ListTile( 60 | leading: const Icon(Icons.chat_bubble), 61 | title: const Text('DocChat Bot'), 62 | onTap: () { 63 | Navigator.pop(context); 64 | Navigator.push(context, MaterialPageRoute(builder: (_) => const ChatbotScreen())); 65 | }, 66 | ), 67 | ListTile( 68 | leading: const Icon(Icons.mic), 69 | title: const Text('Virtual Assistant'), 70 | onTap: () { 71 | Navigator.pop(context); 72 | Navigator.push(context, MaterialPageRoute(builder: (_) => const VirtualAssistantScreen())); 73 | }, 74 | ), 75 | ListTile( 76 | leading: const Icon(Icons.notifications_active), 77 | title: const Text('Health Reminders'), 78 | onTap: () { 79 | Navigator.pop(context); 80 | Navigator.push(context, MaterialPageRoute(builder: (_) => const ReminderScreen())); 81 | }, 82 | ), 83 | ListTile( 84 | leading: const Icon(Icons.local_hospital), 85 | title: const Text('Nearby Hospitals & Stores'), 86 | onTap: () { 87 | Navigator.pop(context); 88 | Navigator.push(context, MaterialPageRoute(builder: (_) => const NearbyScreen())); 89 | }, 90 | ), 91 | ListTile( 92 | leading: const Icon(Icons.person), 93 | title: const Text('Profile'), 94 | onTap: () { 95 | Navigator.pop(context); 96 | Navigator.push(context, MaterialPageRoute(builder: (_) => const ProfileScreen())); 97 | }, 98 | ), 99 | const Divider(), 100 | ListTile( 101 | leading: const Icon(Icons.logout), 102 | title: const Text('Logout'), 103 | onTap: () => _logout(context), 104 | ), 105 | ], 106 | ), 107 | ), 108 | appBar: AppBar( 109 | title: const Text('DocBuddy Home'), 110 | elevation: 0, 111 | backgroundColor: Colors.transparent, 112 | actions: [ 113 | IconButton( 114 | icon: Icon( 115 | themeNotifier.value == ThemeMode.dark ? Icons.light_mode : Icons.dark_mode, 116 | color: Colors.white, 117 | ), 118 | onPressed: _toggleTheme, 119 | ), 120 | ], 121 | ), 122 | body: Container( 123 | width: double.infinity, 124 | height: double.infinity, 125 | decoration: BoxDecoration( 126 | gradient: LinearGradient( 127 | colors: isDark 128 | ? [Color(0xFF0f2027), Color(0xFF203a43), Color(0xFF2c5364)] 129 | : [Color(0xFFd0eaf5), Color(0xFFa5cfe8), Color(0xFF7fb1d6)], 130 | begin: Alignment.topCenter, 131 | end: Alignment.bottomCenter, 132 | ), 133 | ), 134 | child: SafeArea( 135 | child: Column( 136 | children: [ 137 | Padding( 138 | padding: const EdgeInsets.all(16), 139 | child: ClipRRect( 140 | borderRadius: BorderRadius.circular(20), 141 | child: BackdropFilter( 142 | filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15), 143 | child: Container( 144 | width: double.infinity, 145 | height: size.height * 0.23, 146 | decoration: BoxDecoration( 147 | color: isDark ? Colors.white.withOpacity(0.05) : Colors.white.withOpacity(0.3), 148 | borderRadius: BorderRadius.circular(20), 149 | border: Border.all(color: Colors.white.withOpacity(0.2)), 150 | ), 151 | child: Padding( 152 | padding: const EdgeInsets.all(20), 153 | child: Row( 154 | children: [ 155 | const CircleAvatar( 156 | radius: 36, 157 | backgroundColor: Colors.teal, 158 | child: Icon(Icons.local_hospital, size: 36, color: Colors.white), 159 | ), 160 | const SizedBox(width: 20), 161 | Expanded( 162 | child: Column( 163 | crossAxisAlignment: CrossAxisAlignment.start, 164 | mainAxisAlignment: MainAxisAlignment.center, 165 | children: const [ 166 | Text( 167 | "Hello 👋", 168 | style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white), 169 | ), 170 | SizedBox(height: 4), 171 | Text( 172 | "Need medical help? Ask DocBuddy anything!", 173 | style: TextStyle(fontSize: 16, color: Colors.white70), 174 | ), 175 | ], 176 | ), 177 | ) 178 | ], 179 | ), 180 | ), 181 | ), 182 | ), 183 | ), 184 | ), 185 | const SizedBox(height: 10), 186 | Expanded( 187 | child: ListView( 188 | padding: const EdgeInsets.symmetric(horizontal: 20), 189 | children: [ 190 | _buildFeatureCard( 191 | context, 192 | title: 'DocChat Bot', 193 | icon: Icons.chat_bubble_outline, 194 | color: Colors.blueAccent, 195 | onTap: () => Navigator.push( 196 | context, 197 | MaterialPageRoute(builder: (_) => const ChatbotScreen()), 198 | ), 199 | ), 200 | const SizedBox(height: 20), 201 | _buildFeatureCard( 202 | context, 203 | title: 'Virtual Assistant', 204 | icon: Icons.mic_none_rounded, 205 | color: Colors.deepPurple, 206 | onTap: () => Navigator.push( 207 | context, 208 | MaterialPageRoute(builder: (_) => const VirtualAssistantScreen()), 209 | ), 210 | ), 211 | const SizedBox(height: 20), 212 | _buildFeatureCard( 213 | context, 214 | title: 'Health Reminders', 215 | icon: Icons.notifications_active, 216 | color: Colors.green, 217 | onTap: () => Navigator.push( 218 | context, 219 | MaterialPageRoute(builder: (_) => const ReminderScreen()), 220 | ), 221 | ), 222 | const SizedBox(height: 20), 223 | _buildFeatureCard( 224 | context, 225 | title: 'Nearby Hospitals & Stores', 226 | icon: Icons.local_hospital_outlined, 227 | color: Colors.orange, 228 | onTap: () => Navigator.push( 229 | context, 230 | MaterialPageRoute(builder: (_) => const NearbyScreen()), 231 | ), 232 | ), 233 | ], 234 | ), 235 | ), 236 | ], 237 | ), 238 | ), 239 | ), 240 | ); 241 | } 242 | 243 | Widget _buildFeatureCard( 244 | BuildContext context, { 245 | required String title, 246 | required IconData icon, 247 | required Color color, 248 | required VoidCallback onTap, 249 | }) { 250 | return GestureDetector( 251 | onTap: onTap, 252 | child: Container( 253 | padding: const EdgeInsets.all(24), 254 | decoration: BoxDecoration( 255 | color: color.withOpacity(0.9), 256 | borderRadius: BorderRadius.circular(20), 257 | boxShadow: [ 258 | BoxShadow( 259 | color: color.withOpacity(0.4), 260 | blurRadius: 10, 261 | offset: const Offset(0, 6), 262 | ), 263 | ], 264 | ), 265 | child: Row( 266 | children: [ 267 | Icon(icon, size: 36, color: Colors.white), 268 | const SizedBox(width: 20), 269 | Text( 270 | title, 271 | style: const TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w600), 272 | ), 273 | ], 274 | ), 275 | ), 276 | ); 277 | } 278 | } 279 | --------------------------------------------------------------------------------