├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── _
│ │ │ ├── 114.png
│ │ │ ├── 120.png
│ │ │ ├── 180.png
│ │ │ ├── 29.png
│ │ │ ├── 40.png
│ │ │ ├── 57.png
│ │ │ ├── 58.png
│ │ │ ├── 60.png
│ │ │ ├── 80.png
│ │ │ ├── 87.png
│ │ │ └── 1024.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── Info.plist
│ └── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
└── .gitignore
├── assets
├── dr_1.png
├── dr_2.png
├── dr_3.png
├── dwn1.jpg
├── img.png
├── img1.png
├── img2.png
├── stmp.png
├── doctor.png
├── img_1.png
├── img_2.png
├── img_3.png
├── symptoms.png
├── medicine1.jpeg
├── newsapp_main.png
└── newsapp_details.png
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
├── manifest.json
└── index.html
├── android
├── gradle.properties
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values-night
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── NewsApp
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
└── build.gradle
├── lib
├── styles
│ ├── color_filters.dart
│ ├── utisl.dart
│ └── moods.dart
├── News
│ ├── source_model.dart
│ ├── article_model.dart
│ ├── call.dart
│ ├── services
│ │ └── api_service.dart
│ ├── components
│ │ └── customListTile.dart
│ ├── articles_details_page.dart
│ └── home.dart
├── login
│ ├── models
│ │ └── user_model.dart
│ ├── sign.dart
│ └── screens
│ │ ├── landing_screen.dart
│ │ ├── login_screen.dart
│ │ ├── signup_screen.dart
│ │ └── profile_screen.dart
├── pages
│ ├── splash.dart
│ └── about.dart
├── Appointment
│ ├── Receipt8.dart
│ ├── receipt7.dart
│ ├── receipt6.dart
│ ├── receipt4.dart
│ ├── receipt5.dart
│ ├── receipt2.dart
│ ├── receipt3.dart
│ ├── receipt1.dart
│ ├── receipt.dart
│ └── doctor_details_page1.dart
└── main.dart
├── .metadata
├── .gitignore
├── test
└── widget_test.dart
├── pubspec.yaml
└── README.md
/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 |
--------------------------------------------------------------------------------
/assets/dr_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/dr_1.png
--------------------------------------------------------------------------------
/assets/dr_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/dr_2.png
--------------------------------------------------------------------------------
/assets/dr_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/dr_3.png
--------------------------------------------------------------------------------
/assets/dwn1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/dwn1.jpg
--------------------------------------------------------------------------------
/assets/img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/img.png
--------------------------------------------------------------------------------
/assets/img1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/img1.png
--------------------------------------------------------------------------------
/assets/img2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/img2.png
--------------------------------------------------------------------------------
/assets/stmp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/stmp.png
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/assets/doctor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/doctor.png
--------------------------------------------------------------------------------
/assets/img_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/img_1.png
--------------------------------------------------------------------------------
/assets/img_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/img_2.png
--------------------------------------------------------------------------------
/assets/img_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/img_3.png
--------------------------------------------------------------------------------
/assets/symptoms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/symptoms.png
--------------------------------------------------------------------------------
/assets/medicine1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/medicine1.jpeg
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/assets/newsapp_main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/newsapp_main.png
--------------------------------------------------------------------------------
/assets/newsapp_details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/assets/newsapp_details.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/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/ritishzalke/DiagnoPlus/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/ritishzalke/DiagnoPlus/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/ritishzalke/DiagnoPlus/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/ritishzalke/DiagnoPlus/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/114.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/120.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/180.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/29.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/40.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/57.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/58.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/60.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/80.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/87.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ritishzalke/DiagnoPlus/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/_/1024.png
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/NewsApp/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.ritish.NewsApp
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/styles/color_filters.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ColorFilters {
4 | static final greyscale = ColorFilter.matrix([
5 | /// greyscale filter
6 | 0.2126, 0.7152, 0.0722, 0, 0,
7 | 0.2126, 0.7152, 0.0722, 0, 0,
8 | 0.2126, 0.7152, 0.0722, 0, 0,
9 | 0, 0, 0, 1, 0
10 | ]);
11 | }
12 |
--------------------------------------------------------------------------------
/.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: 83dd176777cd04bd2aaca050f6bb6cb9edbf56a1
8 | channel: dev
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/News/source_model.dart:
--------------------------------------------------------------------------------
1 | //let's start by making the source model class so
2 | // it will be easier to parse the Json
3 |
4 | class Source {
5 | String id;
6 | String name;
7 |
8 | //Let's create the constructor
9 | Source({this.id, this.name});
10 |
11 | //Let's create the factory function to map the json
12 | factory Source.fromJson(Map json) {
13 | return Source(id: json['id'], name: json['name']);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/lib/login/models/user_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class UserModel {
4 | String uid;
5 | String fullName;
6 | String email;
7 | String profileImage;
8 | int dt;
9 |
10 | UserModel({
11 | @required this.uid,
12 | @required this.fullName,
13 | @required this.email,
14 | @required this.profileImage,
15 | @required this.dt,
16 | });
17 |
18 | static UserModel fromMap(Map map) {
19 | return UserModel(
20 | uid: map['uid'],
21 | fullName: map['fullName'],
22 | email: map['email'],
23 | profileImage: map['profileImage'],
24 | dt: map['dt'],
25 | );
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "NewsApp",
3 | "short_name": "NewsApp",
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 | }
24 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 |
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | classpath 'com.google.gms:google-services:4.3.0'
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | google()
19 | jcenter()
20 | }
21 | }
22 |
23 | rootProject.buildDir = '../build'
24 | subprojects {
25 | project.buildDir = "${rootProject.buildDir}/${project.name}"
26 | }
27 | subprojects {
28 | project.evaluationDependsOn(':app')
29 | }
30 |
31 | task clean(type: Delete) {
32 | delete rootProject.buildDir
33 | }
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
--------------------------------------------------------------------------------
/lib/styles/utisl.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | const mainBgColor = Color(0xFFf2f2f2);
4 | const darkColor = Color(0xFF2A0B35);
5 | const midColor = Color(0xFF522349);
6 | const lightColor = Color(0xFFA52C4D);
7 | const darkRedColor = Color(0xFFFA695C);
8 | const lightRedColor = Color(0xFFFD685A);
9 |
10 | const purpleGradient = LinearGradient(
11 | colors: [darkColor, midColor, lightColor],
12 | stops: [0.0, 0.5, 1.0],
13 | begin: Alignment.centerLeft,
14 | end: Alignment.centerRight,
15 | );
16 |
17 | const redGradient = LinearGradient(
18 | colors: [darkRedColor, lightRedColor],
19 | stops: [0.0, 1.0],
20 | begin: Alignment.centerLeft,
21 | end: Alignment.centerRight,
22 | );
23 |
24 | const USER_IMAGE='https://cdn4.iconfinder.com/data/icons/people-avatar-flat-1/64/girl_chubby_beautiful_people_woman_lady_avatar-512.png';
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/lib/login/sign.dart:
--------------------------------------------------------------------------------
1 | import 'package:NewsApp/login/screens/login_screen.dart';
2 |
3 | import 'package:NewsApp/main.dart';
4 | import 'package:firebase_auth/firebase_auth.dart';
5 | import 'package:firebase_core/firebase_core.dart';
6 | import 'package:flutter/material.dart';
7 |
8 |
9 | void main() async {
10 | WidgetsFlutterBinding.ensureInitialized();
11 | await Firebase.initializeApp();
12 |
13 | runApp( MyApp());
14 | }
15 |
16 | class MyApp extends StatelessWidget {
17 | // const MyApp({Key? key}) : super(key: key);
18 |
19 | // This widget is the root of your application.
20 | @override
21 | Widget build(BuildContext context) {
22 | return MaterialApp(
23 | title: 'Flutter Demo',
24 | theme: ThemeData(
25 | primarySwatch: Colors.blue,
26 | ),
27 | home: FirebaseAuth.instance.currentUser == null
28 | ? LoginScreen()
29 | : MyHomePage(),
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/login/screens/landing_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'login_screen.dart';
4 |
5 |
6 | class LandingScreen extends StatefulWidget {
7 | // const LandingScreen({Key? key}) : super(key: key);
8 |
9 | @override
10 | _LandingScreenState createState() => _LandingScreenState();
11 | }
12 |
13 | class _LandingScreenState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | appBar: AppBar(
18 | title: const Text(''),
19 | ),
20 | body: Center(
21 | child: Column(
22 | mainAxisSize: MainAxisSize.min,
23 | children: [
24 | const FlutterLogo(size: 200,),
25 | ElevatedButton(onPressed: (){
26 |
27 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
28 | return LoginScreen();
29 | }));
30 |
31 | }, child: Text('Enter'))
32 | ],
33 | ),
34 | ),
35 | );
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/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 that Flutter provides. 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:NewsApp/main.dart';
9 |
10 | import 'package:flutter/material.dart';
11 | import 'package:flutter_test/flutter_test.dart';
12 |
13 |
14 |
15 | void main() {
16 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
17 | // Build our app and trigger a frame.
18 | await tester.pumpWidget(MyApp());
19 |
20 | // Verify that our counter starts at 0.
21 | expect(find.text('0'), findsOneWidget);
22 | expect(find.text('1'), findsNothing);
23 |
24 | // Tap the '+' icon and trigger a frame.
25 | await tester.tap(find.byIcon(Icons.add));
26 | await tester.pump();
27 |
28 | // Verify that our counter has incremented.
29 | expect(find.text('0'), findsNothing);
30 | expect(find.text('1'), findsOneWidget);
31 | });
32 | }
33 |
--------------------------------------------------------------------------------
/lib/News/article_model.dart:
--------------------------------------------------------------------------------
1 | //Now let's create the article model
2 | // for that we just need to copy the property from the json structure
3 | // and make a dart object
4 |
5 | import 'source_model.dart';
6 |
7 | class Article {
8 | Source source;
9 | String author;
10 | String title;
11 | String description;
12 | String url;
13 | String urlToImage;
14 | String publishedAt;
15 | String content;
16 |
17 | //Now let's create the constructor
18 | Article(
19 | {this.source,
20 | this.author,
21 | this.title,
22 | this.description,
23 | this.url,
24 | this.urlToImage,
25 | this.publishedAt,
26 | this.content});
27 |
28 | //And now let's create the function that will map the json into a list
29 | factory Article.fromJson(Map json) {
30 | return Article(
31 | source: Source.fromJson(json['source']),
32 | author: json['author'] as String,
33 | title: json['title'] as String,
34 | description: json['description'] as String,
35 | url: json['url'] as String,
36 | urlToImage: json['urlToImage'] as String,
37 | publishedAt: json['publishedAt'] as String,
38 | content: json['content'] as String,
39 | );
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | NewsApp
18 |
19 |
20 |
21 |
24 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/lib/News/call.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:NewsApp/News/services/api_service.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | import 'components/customListTile.dart';
6 |
7 | import 'article_model.dart';
8 | class call extends StatefulWidget {
9 | //const call({Key? key}) : super(key: key);
10 |
11 | @override
12 | _callState createState() => _callState();
13 | }
14 |
15 | class _callState extends State {
16 | ApiService client = ApiService();
17 | @override
18 | Widget build(BuildContext context) {
19 |
20 | return Container(
21 |
22 |
23 | //Now let's call the APi services with futurebuilder wiget
24 | child: FutureBuilder(
25 | future: client.getArticle(),
26 | builder: (BuildContext context, AsyncSnapshot> snapshot) {
27 | //let's check if we got a response or not
28 | if (snapshot.hasData) {
29 | //Now let's make a list of articles
30 | List articles = snapshot.data;
31 | return ListView.builder(
32 | //Now let's create our custom List tile
33 | itemCount: articles.length,
34 | itemBuilder: (context, index) =>
35 | customListTile(articles[index], context),
36 | );
37 | }
38 | return Center(
39 | child: CircularProgressIndicator(),
40 | );
41 | },
42 | ),
43 | );
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/News/services/api_service.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:NewsApp/News/article_model.dart';
4 | import 'package:http/http.dart';
5 |
6 | //Now let's make the HTTP request services
7 | // this class will alows us to make a simple get http request
8 | // from the API and get the Articles and then return a list of Articles
9 |
10 | class ApiService {
11 | //let's add an Endpoint URL, you can check the website documentation
12 | // and learn about the different Endpoint
13 | //for this example I'm going to use a single endpoint
14 |
15 | //NOTE: make sure to use your OWN apikey, you can make a free acount and
16 | // choose a developer option it's FREE
17 | final endPointUrl =
18 | "http://newsapi.org/v2/top-headlines?country=us&category=health&apiKey={YOUR_API_KEY}";
19 |
20 | //Now let's create the http request function
21 | // but first let's import the http package
22 |
23 | Future> getArticle() async {
24 | Response res = await get(Uri.parse(endPointUrl));
25 |
26 | //first of all let's check that we got a 200 statu code: this mean that the request was a succes
27 | if (res.statusCode == 200) {
28 | Map json = jsonDecode(res.body);
29 |
30 | List body = json['articles'];
31 |
32 | //this line will allow us to get the different articles from the json file and putting them into a list
33 | List articles =
34 | body.map((dynamic item) => Article.fromJson(item)).toList();
35 |
36 | return articles;
37 | } else {
38 | throw ("Can't get the Articles");
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]}
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | DIAGNO+
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/pages/splash.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import 'package:animated_text_kit/animated_text_kit.dart';
5 | import 'package:firebase_auth/firebase_auth.dart';
6 | import 'package:flutter/material.dart';
7 |
8 |
9 | import '../login/screens/login_screen.dart';
10 | import '../main.dart';
11 | class Splash extends StatefulWidget {
12 | // const Splash({Key? key}) : super(key: key);
13 |
14 | @override
15 | _SplashState createState() => _SplashState();
16 | }
17 |
18 | class _SplashState extends State {
19 | @override
20 | void initState() {
21 | // TODO: implement initState
22 | super.initState();
23 | _navigateHome();
24 | }
25 | _navigateHome()async{
26 | await Future.delayed(Duration(milliseconds: 3000),(){
27 | Navigator.of(context).pushReplacement( MaterialPageRoute(builder: (context)=>
28 | FirebaseAuth.instance.currentUser == null
29 | ? LoginScreen()
30 | : MyHomePage(),
31 | )
32 | );
33 | });
34 | }
35 | // var s="Diagno";
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return Scaffold(
40 | body: Center(
41 | child: Column(
42 | mainAxisAlignment: MainAxisAlignment.center,
43 | children: [
44 | AnimatedTextKit(
45 | animatedTexts: [
46 | WavyAnimatedText(
47 |
48 | 'DIAGNO+',textStyle: const TextStyle(
49 | fontSize: 44.0,
50 | fontWeight: FontWeight.bold,
51 | color: Colors.blue,
52 | ),
53 |
54 |
55 | ),
56 | // RotateAnimatedText('+',textStyle: const TextStyle(
57 | // fontSize: 88.0,
58 | // fontWeight: FontWeight.bold,
59 | // color: Colors.red,
60 | // ),
61 | // ),
62 |
63 | ],
64 | onTap: (){},
65 | ),
66 | // Text("DIAGNO",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 44,color: Colors.blue),),
67 | // Text("+",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 50, color: Colors.red),)
68 | ]
69 | ),
70 | ),
71 | );
72 |
73 |
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/lib/styles/moods.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | // import 'package:line_awesome_icons/line_awesome_icons.dart';
3 |
4 | class MoodsSelector extends StatefulWidget {
5 | // MoodsSelector({Key key}) : super(key: key);
6 |
7 | @override
8 | _MoodsSelectorState createState() => _MoodsSelectorState();
9 | }
10 |
11 | class _MoodsSelectorState extends State {
12 | //List isSelected = List.generate(5, (_) => false);
13 | List isSelected = [ true,false,false,false,false];
14 |
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Center(
19 | child: ToggleButtons(
20 | selectedColor: Colors.purple,
21 | borderColor: Colors.transparent,
22 | renderBorder: false,
23 |
24 | fillColor: Colors.transparent,
25 | children: [
26 | Icon(
27 | Icons.sentiment_very_dissatisfied,
28 | size: 36,
29 | ),
30 | Padding(
31 | padding: const EdgeInsets.only(left: 12.0, right: 12.0),
32 | child: Icon(
33 | Icons.sentiment_dissatisfied,
34 | size: 36,
35 | ),
36 | ),
37 | Padding(
38 | padding: const EdgeInsets.only(left: 12.0, right: 12.0),
39 | child: Icon(
40 | Icons.sentiment_neutral,
41 | size: 36,
42 | ),
43 | ),
44 | Padding(
45 | padding: const EdgeInsets.only(left: 12.0, right: 12.0),
46 | child: Icon(
47 | Icons.sentiment_satisfied,
48 | size: 36,
49 | ),
50 | ),
51 | Icon(
52 | Icons.sentiment_very_satisfied,
53 | size: 36,
54 | ),
55 | ],
56 | isSelected: isSelected,
57 | onPressed: (int index) {
58 | setState(() {
59 | for (int buttonIndex = 0; buttonIndex < isSelected.length; buttonIndex++) {
60 | if (buttonIndex == index) {
61 | isSelected[buttonIndex] = true;
62 | } else {
63 | isSelected[buttonIndex] = false;
64 | }
65 | }
66 | });
67 | },
68 |
69 |
70 |
71 | ),
72 | );
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
13 |
17 |
21 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/lib/News/components/customListTile.dart:
--------------------------------------------------------------------------------
1 | import 'package:NewsApp/News/article_model.dart';
2 | import 'package:NewsApp/News/articles_details_page.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | Widget customListTile(Article article, BuildContext context) {
6 | return InkWell(
7 | onTap: () {
8 | Navigator.push(
9 | context,
10 | MaterialPageRoute(
11 | builder: (context) => ArticlePage(
12 | article: article,
13 | )));
14 | },
15 | child: Container(
16 | margin: EdgeInsets.all(12.0),
17 | padding: EdgeInsets.all(8.0),
18 | decoration: BoxDecoration(
19 | color: Colors.white,
20 | borderRadius: BorderRadius.circular(12.0),
21 | boxShadow: [
22 | BoxShadow(
23 | color: Colors.black12,
24 | blurRadius: 3.0,
25 | ),
26 | ]),
27 | child: Column(
28 | mainAxisAlignment: MainAxisAlignment.start,
29 | crossAxisAlignment: CrossAxisAlignment.start,
30 | children: [
31 | Container(
32 | height: 200.0,
33 | width: double.infinity,
34 | decoration: BoxDecoration(
35 | //let's add the height
36 |
37 | image: DecorationImage(
38 | image: (article.urlToImage == null) ? AssetImage('assets/dwn1.jpg',) :NetworkImage(article.urlToImage), fit: BoxFit.cover),
39 | borderRadius: BorderRadius.circular(12.0),
40 | ),
41 | ),
42 | SizedBox(
43 | height: 8.0,
44 | ),
45 | Container(
46 | padding: EdgeInsets.all(6.0),
47 | decoration: BoxDecoration(
48 | color: Colors.blue,
49 | borderRadius: BorderRadius.circular(30.0),
50 | ),
51 | child: Text(
52 | article.source.name,
53 | style: TextStyle(
54 | color: Colors.white,
55 | ),
56 | ),
57 | ),
58 | SizedBox(
59 | height: 8.0,
60 | ),
61 | Text(
62 | article.title,
63 | style: TextStyle(
64 | fontWeight: FontWeight.bold,
65 | fontSize: 16.0,
66 | ),
67 | )
68 | ],
69 | ),
70 | ),
71 | );
72 | }
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 |
26 | apply plugin: 'kotlin-android'
27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
28 | apply plugin: 'com.google.gms.google-services'
29 | def keystoreProperties = new Properties()
30 | def keystorePropertiesFile = rootProject.file('key.properties')
31 | if (keystorePropertiesFile.exists()) {
32 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
33 | }
34 | android {
35 | compileSdkVersion 29
36 |
37 | sourceSets {
38 | main.java.srcDirs += 'src/main/kotlin'
39 | }
40 |
41 | lintOptions {
42 | disable 'InvalidPackage'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "com.ritish.NewsApp"
48 | minSdkVersion 21
49 | targetSdkVersion 29
50 |
51 | versionCode flutterVersionCode.toInteger()
52 | versionName flutterVersionName
53 | }
54 | signingConfigs {
55 | release {
56 | keyAlias keystoreProperties['keyAlias']
57 | keyPassword keystoreProperties['keyPassword']
58 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
59 | storePassword keystoreProperties['storePassword']
60 | }
61 | }
62 | buildTypes {
63 | release {
64 | signingConfig signingConfigs.release
65 | }
66 | }
67 |
68 | buildTypes {
69 | release {
70 | // TODO: Add your own signing config for the release build.
71 | // Signing with the debug keys for now, so `flutter run --release` works.
72 | signingConfig signingConfigs.debug
73 | }
74 | }
75 | }
76 |
77 | flutter {
78 | source '../..'
79 | }
80 |
81 | dependencies {
82 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
83 |
84 | implementation platform('com.google.firebase:firebase-bom:29.0.1')
85 | }
86 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: NewsApp
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.10.0 <3.0.0"
22 |
23 | dependencies:
24 | printing: ^5.6.6
25 | pdf: ^3.6.5
26 | syncfusion_flutter_pdf: ^19.4.42-beta
27 | flutter_staggered_grid_view: ^0.4.1
28 | firebase_core: ^1.6.0
29 | flutter_local_notifications: ^9.1.5
30 | sqflite: ^2.0.1
31 | timezone: ^0.8.0
32 | firebase_auth: ^3.1.1
33 | firebase_database: ^8.0.0
34 | firebase_storage: ^10.0.3
35 | fluttertoast: ^8.0.8
36 | ndialog: ^4.1.0
37 | intl: ^0.17.0
38 | provider: ^6.0.1
39 | platform: ^3.0.2
40 | image_picker: ^0.8.4+4
41 | image_picker_platform_interface: ^2.4.1
42 | line_icons: ^2.0.1
43 | line_awesome_flutter: ^2.0.0
44 | animated_text_kit: ^4.2.1
45 | webview_flutter: ^2.3.1
46 | url_launcher: ^6.0.15
47 | flutter_linkify: ^3.1.3
48 | flutter:
49 | sdk: flutter
50 |
51 |
52 | # The following adds the Cupertino Icons font to your application.
53 | # Use with the CupertinoIcons class for iOS style icons.
54 | cupertino_icons: ^1.0.0
55 | http: ^0.13.4
56 |
57 | dev_dependencies:
58 | flutter_test:
59 | sdk: flutter
60 | flutter_launcher_name: "^0.0.1"
61 | flutter_launcher_name:
62 | name: "DIAGNO+"
63 |
64 |
65 | # For information on the generic Dart part of this file, see the
66 | # following page: https://dart.dev/tools/pub/pubspec
67 |
68 | # The following section is specific to Flutter.
69 | flutter:
70 |
71 | # The following line ensures that the Material Icons font is
72 | # included with your application, so that you can use the icons in
73 | # the material Icons class.
74 | uses-material-design: true
75 |
76 | # To add assets to your application, add an assets section, like this:
77 | assets:
78 | - assets/
79 |
80 | # An image asset can refer to one or more resolution-specific "variants", see
81 | # https://flutter.dev/assets-and-images/#resolution-aware.
82 |
83 | # For details regarding adding assets from package dependencies, see
84 | # https://flutter.dev/assets-and-images/#from-packages
85 |
86 | # To add custom fonts to your application, add a fonts section here,
87 | # in this "flutter" section. Each entry in this list should have a
88 | # "family" key with the font family name, and a "fonts" key with a
89 | # list giving the asset and other descriptors for the font. For
90 | # example:
91 | # fonts:
92 | # - family: Schyler
93 | # fonts:
94 | # - asset: fonts/Schyler-Regular.ttf
95 | # - asset: fonts/Schyler-Italic.ttf
96 | # style: italic
97 | # - family: Trajan Pro
98 | # fonts:
99 | # - asset: fonts/TrajanPro.ttf
100 | # - asset: fonts/TrajanPro_Bold.ttf
101 | # weight: 700
102 | #
103 | # For details regarding fonts from package dependencies,
104 | # see https://flutter.dev/custom-fonts/#from-packages
105 |
--------------------------------------------------------------------------------
/lib/login/screens/login_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:NewsApp/login/screens/signup_screen.dart';
2 |
3 | import 'package:NewsApp/main.dart';
4 | import 'package:firebase_auth/firebase_auth.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter/widgets.dart';
7 | import 'package:fluttertoast/fluttertoast.dart';
8 | import 'package:ndialog/ndialog.dart';
9 |
10 |
11 | class LoginScreen extends StatefulWidget {
12 | const LoginScreen({Key key}) : super(key: key);
13 |
14 | @override
15 | _LoginScreenState createState() => _LoginScreenState();
16 | }
17 |
18 | class _LoginScreenState extends State {
19 | var emailController = TextEditingController();
20 | var passwordController = TextEditingController();
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | final double height =
25 | MediaQuery.of(context).size.height - MediaQuery.of(context).padding.top;
26 | return Scaffold(
27 | resizeToAvoidBottomInset: false,
28 | // appBar: AppBar(
29 | // title: const Text('Login Please'),
30 | // ),
31 | body:
32 |
33 | Padding(
34 | padding: const EdgeInsets.all(8.0),
35 | child: Column(
36 | children: [
37 | SizedBox(height: height*0.15),
38 | Text("DIAGNO+",style: TextStyle(color: Colors.blue,fontSize: 45,fontWeight: FontWeight.bold) ,
39 |
40 | ),
41 |
42 | SizedBox(height: height*0.1),
43 | Container(
44 | // mainAxisAlignment: MainAxisAlignment.start,
45 | // crossAxisAlignment: CrossAxisAlignment.end,
46 |
47 | child:Text("LOGIN HERE",textAlign: TextAlign.left,style: TextStyle(color: Colors.black,fontSize: 25,fontWeight: FontWeight.bold,),
48 |
49 | ),
50 |
51 | ),
52 | SizedBox(height: height*0.03),
53 | TextField(
54 | controller: emailController,
55 | decoration: const InputDecoration(
56 |
57 | border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
58 | hintText: 'Email',
59 | ),
60 | ),
61 | SizedBox(height: height*0.03),
62 | TextField(
63 | controller: passwordController,
64 | obscureText: true,
65 |
66 | decoration: const InputDecoration(
67 |
68 | border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
69 | hintText: 'Password',
70 | ),
71 | ),
72 |
73 | SizedBox(height: height*0.03,),
74 |
75 | ElevatedButton(
76 | style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.only(left: 50,right: 50,top: 20,
77 | bottom: 20)),shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)))),
78 | onPressed: () async {
79 |
80 | var email = emailController.text.trim();
81 | var password = passwordController.text.trim();
82 | if( email.isEmpty || password.isEmpty ){
83 | // show error toast
84 | Fluttertoast.showToast(msg: 'Please fill all fields');
85 | return;
86 | }
87 |
88 | // request to firebase auth
89 |
90 | ProgressDialog progressDialog = ProgressDialog(
91 | context,
92 | title: const Text('Logging In'),
93 | message: const Text('Please wait'),
94 | );
95 |
96 | progressDialog.show();
97 |
98 | try{
99 |
100 | FirebaseAuth auth = FirebaseAuth.instance;
101 |
102 | UserCredential userCredential = await auth.signInWithEmailAndPassword(email: email, password: password);
103 |
104 | if( userCredential.user != null ){
105 |
106 |
107 | progressDialog.dismiss();
108 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
109 |
110 | return MyHomePage();
111 | }));
112 | }
113 |
114 |
115 |
116 | }
117 | on FirebaseAuthException catch ( e ) {
118 |
119 | progressDialog.dismiss();
120 |
121 | if( e.code == 'user-not-found'){
122 | Fluttertoast.showToast(msg: 'User not found');
123 |
124 | }else if( e.code == 'wrong-password'){
125 | Fluttertoast.showToast(msg: 'Wrong password');
126 |
127 | }
128 |
129 | }
130 | catch(e){
131 | Fluttertoast.showToast(msg: 'Something went wrong');
132 | progressDialog.dismiss();
133 | }
134 |
135 |
136 | }, child:const Text('Login')),
137 |
138 | const SizedBox(height: 10,),
139 |
140 | Row(
141 | mainAxisAlignment: MainAxisAlignment.center,
142 | children: [
143 | const Text('Not Registered Yet?'),
144 | TextButton(onPressed: (){
145 |
146 | Navigator.of(context).push(MaterialPageRoute(builder: (context){
147 | return SignUpScreen();
148 | }));
149 | }, child: Text('Register Now!')),
150 | ],
151 | )
152 | ],
153 | ),
154 | ),
155 | );
156 | }
157 | }
--------------------------------------------------------------------------------
/lib/News/articles_details_page.dart:
--------------------------------------------------------------------------------
1 | //Now let's create the article details page
2 |
3 | import 'package:NewsApp/News/article_model.dart';
4 | import 'package:flutter/gestures.dart';
5 |
6 | import 'package:flutter/material.dart';
7 | import 'package:url_launcher/url_launcher.dart';
8 |
9 | class ArticlePage extends StatelessWidget {
10 | final Article article;
11 |
12 | ArticlePage({this.article});
13 | // _launchUrl(String url) async{
14 | // if(await canLaunch(article.url))
15 | // {
16 | // await launch(article.url);
17 | // }
18 | // else{
19 | // throw "could not launch!";
20 | // }
21 | // }
22 | @override
23 | Widget build(BuildContext context) {
24 | return Scaffold(
25 | appBar: AppBar(
26 | title: Text("Medical News"),
27 | backgroundColor: Colors.blueAccent,
28 | ),
29 | body: Padding(
30 | padding: const EdgeInsets.all(8.0),
31 | child: Column(
32 | // shrinkWrap: true,
33 | // physics: ClampingScrollPhysics(),
34 | mainAxisAlignment: MainAxisAlignment.start,
35 | crossAxisAlignment: CrossAxisAlignment.start,
36 | children: [
37 | Container(
38 | height: 200.0,
39 | width: double.infinity,
40 | decoration: BoxDecoration(
41 | //let's add the height
42 |
43 | image: DecorationImage(
44 | image: (article.urlToImage == null) ? AssetImage('assets/dwn1.jpg') :NetworkImage(article.urlToImage), fit: BoxFit.cover),
45 | borderRadius: BorderRadius.circular(12.0),
46 | ),
47 | ),
48 | SizedBox(
49 | height: 8.0,
50 | ),
51 | Container(
52 | padding: EdgeInsets.all(6.0),
53 | decoration: BoxDecoration(
54 | color: Colors.blue,
55 | borderRadius: BorderRadius.circular(30.0),
56 | ),
57 | child: Text(
58 | article.source.name,
59 | style: TextStyle(
60 | color: Colors.white,
61 | ),
62 | ),
63 | ),
64 | SizedBox(
65 | height: 16.0,
66 | ),
67 | Text(
68 | (article.description == null) ?"Sorry the news description is not available currently!":article.description,
69 | style: TextStyle(
70 | fontWeight: FontWeight.bold,
71 | fontSize: 20.0,
72 | ),
73 | overflow: TextOverflow.visible,
74 | ),
75 | Divider(thickness: 2,color: Colors.black,),
76 |
77 | Flexible(
78 | flex: 8,
79 | child: Text(
80 | (article.content == null) ?"The news content is not available currently!":article.content,
81 | style: TextStyle(
82 |
83 | fontSize: 20.0,
84 | ),
85 |
86 | overflow: TextOverflow.ellipsis,
87 | ),
88 | ),
89 | SizedBox(
90 | height: 16.0,
91 | ),
92 | Container(
93 | child: RichText(
94 | text: TextSpan(
95 |
96 | children: [
97 | TextSpan(
98 | text: "click ",
99 | style: TextStyle(color: Colors.black,fontSize: 18)
100 | ),
101 | TextSpan(
102 | text: "here",
103 | style: TextStyle(color: Colors.blue,decoration: TextDecoration.underline,fontSize: 18),
104 | recognizer: new TapGestureRecognizer()
105 | ..onTap=(){ launch(article.url);
106 | }
107 | ),
108 | TextSpan(
109 | text: " to read the full article! ",
110 | style: TextStyle(color: Colors.black,fontSize: 18)
111 | ),
112 | ]
113 | ))
114 |
115 | )
116 | // Linkify(
117 | // onOpen: (article) {
118 | // print("Open the link for the whole article: ${article.url}");
119 | // },
120 | // text: "Linkify click - ${article.url}",
121 | // style: TextStyle(color: Colors.blue),
122 | // linkStyle: TextStyle(color: Colors.green),
123 | // ),
124 |
125 | // Text(
126 | //
127 | // "Here is the link for the whole article: ",
128 | // //semanticsLabel: article.url,
129 | // style: TextStyle(
130 | // // fontWeight: FontWeight.bold,
131 | // fontSize: 16.0,
132 | // overflow: TextOverflow.clip,
133 | // ),
134 | // ),
135 | // Container(
136 | // child: RichText(
137 | // text: TextSpan(
138 | // children: [
139 | // TextSpan(
140 | // //style: defaultText,
141 | // text: "To learn more "
142 | // ),
143 | // TextSpan(
144 | // //style: linkText,
145 | // text: "Click here",
146 | // recognizer: TapGestureRecognizer()..onTap = () async{
147 | // // var url = "https://www.youtube.com/channel/UCwxiHP2Ryd-aR0SWKjYguxw?view_as=subscriber";
148 | // if (await canLaunch(article.url)) {
149 | // await launch(article.url);
150 | // } else {
151 | // throw 'Could not launch $article.url';
152 | // }
153 | // }
154 | // ),
155 | // ]
156 | // )),
157 | // )
158 | ],
159 |
160 | ),
161 | ),
162 | );
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/lib/Appointment/Receipt8.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:printing/printing.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import '../../login/models/user_model.dart';
10 | class Receipt8 extends StatefulWidget {
11 | // const Receipt({Key? key}) : super(key: key);
12 |
13 | @override
14 | _Receipt8State createState() => _Receipt8State();
15 | }
16 |
17 | class _Receipt8State extends State {
18 | User user;
19 | UserModel userModel;
20 | DatabaseReference userRef;
21 | final GlobalKey> _printKey = GlobalKey();
22 | void _printScreen() {
23 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
24 | final doc = pw.Document();
25 |
26 | final image = await WidgetWraper.fromKey(key: _printKey);
27 |
28 | doc.addPage(pw.Page(
29 | pageFormat: format,
30 | build: (pw.Context context) {
31 | return pw.Center(
32 | child: pw.Expanded(
33 | child: pw.Image(image),
34 | ),
35 | );
36 | }));
37 |
38 | return doc.save();
39 | });
40 | }
41 | _getUserDetails() async {
42 | DataSnapshot snapshot = (await userRef.once());
43 |
44 | userModel = UserModel.fromMap(Map.from(snapshot.value));
45 |
46 | setState(() {});
47 | }
48 | @override
49 | void initState() {
50 | super.initState();
51 |
52 | user = FirebaseAuth.instance.currentUser;
53 | if (user != null) {
54 | userRef =
55 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
56 | }
57 |
58 | _getUserDetails();
59 | }
60 | @override
61 | Widget build(BuildContext context) {
62 | return Scaffold(
63 |
64 | appBar: AppBar(
65 | title: const Text('Receipt'),
66 | backgroundColor: Colors.blueAccent,
67 | ),
68 | body: Center(
69 | child: Column(
70 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
71 | children: [
72 | RepaintBoundary(
73 | key: _printKey,
74 | child: userModel == null
75 | ? const Center(child: CircularProgressIndicator())
76 | :Column(
77 | children: [
78 |
79 | SizedBox(
80 | height: 30,
81 | ),
82 | Center(
83 | child: Container(
84 | child: Text(
85 | "APPOINTMENT CONFIRMED",
86 | style: TextStyle(
87 | color: Colors.red,
88 | fontWeight: FontWeight.bold,
89 | fontSize: 25
90 | ),
91 | ),
92 | ),
93 | ),
94 | SizedBox(height: 30,),
95 | Divider(
96 | thickness: 20,
97 | ),
98 | SizedBox(height: 30,),
99 | Row(
100 | children: [
101 | Container(
102 | margin: EdgeInsets.only(left: 10,bottom: 15),
103 | child: Text("Doctor's Name: Doctor 1", style: TextStyle(fontSize: 15),),
104 | ),
105 | ]
106 | ),
107 | Row(
108 | children: [
109 | Container(
110 | margin: EdgeInsets.only(left: 10,bottom: 15),
111 | child: Text("Patient's name: ",style: TextStyle(fontSize: 15),),
112 | ),
113 | FittedBox(
114 | fit: BoxFit.fitWidth,
115 | child: Container(
116 | margin: EdgeInsets.only(left: 10,bottom: 15),
117 | child: Text(
118 | userModel.fullName,
119 | ),
120 | ),
121 | ),
122 |
123 | ],
124 | ),
125 | Row(
126 | children: [
127 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
128 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 15),),
129 | ),
130 | FittedBox(
131 | fit: BoxFit.fitWidth,
132 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
133 | child: Text(
134 | userModel.email,
135 | ),
136 | ),
137 | ),
138 | ],
139 | ),
140 | Row(
141 | children: [
142 | Container(
143 | margin: EdgeInsets.only(left: 10,bottom: 15),
144 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 15),),
145 | ),
146 | Container(
147 | margin: EdgeInsets.only(left: 10,bottom: 15),
148 | child: Text(
149 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 15),
150 | ),
151 | ),
152 | ],
153 | ),
154 | Row(
155 | children: [
156 | Container(
157 | margin: EdgeInsets.only(left: 10,bottom: 15),
158 | child: Text("Time: 10:00",style: TextStyle(fontSize: 15),),
159 | ),
160 | ],
161 | ),
162 | Divider(
163 | thickness: 20,
164 | ),
165 | // Container(
166 | // decoration: BoxDecoration(
167 | // image: DecorationImage(
168 | // image: AssetImage("assets/stamp.png")
169 | // )
170 | // ),
171 | // )
172 | SizedBox(height: 30,),
173 | Column(
174 | mainAxisAlignment: MainAxisAlignment.end,
175 | crossAxisAlignment: CrossAxisAlignment.end,
176 |
177 | children: [Image.asset(
178 |
179 | "assets/stmp.png"
180 | ),
181 | ]
182 | ),
183 | SizedBox(height: 30,),
184 | Divider(
185 | thickness: 20,
186 | ),
187 | ],
188 |
189 |
190 | ),
191 | ),
192 | ],
193 | ),
194 | ),
195 | floatingActionButton: FloatingActionButton(
196 | child: const Icon(Icons.print),
197 | onPressed: _printScreen,
198 | ),
199 | );
200 | }
201 | }
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
DIAGNO+
4 |
5 | Diagnosis app with Flutter that uses Firebase
6 |
7 |
8 |
9 |
10 | ## Team members
11 |
12 | [Ritish Zalke](https://github.com/ritishzalke) -
13 | ritishzalke@gmail.com
14 |
15 | [Soham Chaudhari](https://github.com/Soham0779) -
16 | soham13302@gmail.com
17 |
18 | [Nirbhay Nikam](https://github.com/NiRbhay22) -
19 | niknirbhay@gmail.com
20 |
21 | [Chaitanya Deshpande](https://github.com/ChaitanyaSRA) -
22 | chaitanyad192002@gmail.com
23 |
24 |
25 |
26 |
27 | ## Mentors
28 |
29 | [Darsh Bavishi](https://github.com/DarshBavishi)
30 |
31 | [Dhruvin Gandhi](https://github.com/dhruvin5)
32 |
33 | [Bhavya Mehta](https://github.com/bhavya092)
34 |
35 | [Chinmay Janwalkar](https://github.com/chinmayj24)
36 |
37 |
38 | ## How to Use
39 |
40 | **Step 1:**
41 |
42 | Download or clone this repo by using the link below:
43 |
44 | ```
45 | https://github.com/ritishzalke/DiagnoPlus.git
46 | ```
47 |
48 | **Step 2:**
49 |
50 | Go to project root and execute the following command in console to get the required dependencies:
51 |
52 | ```
53 | flutter pub get
54 | ```
55 |
56 |
57 | ## Description
58 |
59 | - A **flutter app** made by group in Inheritance Program conducted in
60 | college.
61 | - A user login is provided
62 | - User can fix an appointment with a doctor by clicking on the given time slot
63 | -the receipt will be generated when the appointment is booked.
64 | - Users can also see daily news with the help of the news option.
65 | - Users can fix medicine reminders and the app will give notifications for the same according to the timings given by the user.
66 | It uses **Firebase Authentication** to Sign Up and Login and **Firebase Database** to store user's data.
67 |
68 |
69 | ## Languages and Technologies
70 | 1.Dart
71 |
72 | 2.Flutter
73 |
74 | 3.Firebase
75 |
76 |
77 | ## Tools Used
78 |
79 | 1.Android Studio
80 |
81 | 2.VSCode
82 |
83 |
84 | ## Feautures
85 |
86 | - [x] Log in
87 | - [x] Sign up
88 | - [x] Booking Appointment
89 | - [x] Medical News
90 | - [x] Profile and log out
91 | - [x] Generating Booking Receipt
92 |
93 |
94 | ## Usage:
95 | -User can fix an appointment with the doctor on this app
96 |
97 | -User can find daily news related to health in this app
98 |
99 | ## Application
100 | Why feel pain and side effects of missing your medicines, when DIANO+ app can alert you every time to have your medicine, in addition to that here we keep your updated with all medical reforms and alerts with our news feature.
101 |
102 |
103 | ## Future Scope
104 | 1. Add search bar.
105 | 2. Add Symptom's checker.
106 | 3. Chat with doctors.
107 | 4. Medicine reminder.
108 |
109 |
110 | ## Folder Structure
111 |
112 | Here is the core folder structure which flutter provides.
113 |
114 | ```
115 | DiagnoPlus/
116 | |- android
117 | |- build
118 | |- ios
119 | |- lib
120 | |- test
121 | ```
122 |
123 |
124 | Here is the folder structure we have been using in this project
125 |
126 | ```
127 | lib/
128 | |- Appointment/
129 | |- login/
130 | |- News/
131 | |- pages/
132 | |- styles/
133 | |- generated_plugin_registrant.dart
134 | |- main.dart
135 |
136 | ```
137 |
138 |
139 | Now, lets dive into the lib folder which has the main code for the application.
140 |
141 | ```
142 | 1- Appointment - Contains all the doctor details and booking receipts.
143 | 2- login - Contains UserModel and login, SignUp and Profile pages.
144 | 3- News - Contains API service which connects to the NewsApi along with arictle model, source model, article details and CustomListTile page for each news article.
145 | 4- pages - Consists of the splash screen and about page talking briefly about the app and the developers.
146 | 5- styles - Contains the color filters and the mood selector.
147 | 6- main.dart - This is the starting point of the application. All the application level configurations are defined in this file.
148 | 7- generated_plugin_registrant.dart — This is automatically generated by the FlutterApplication in order to register plugins defined in the Flutter App's pubspec.yaml file.
149 |
150 | ```
151 |
152 |
153 | ## Screenshots
154 |
155 | ## Login Screen and SignUp Screen
156 |
157 |
158 |
159 |
160 | ## Home Page and side bar
161 |
162 |
163 | ## Profile
164 |
165 |
166 | ## Appoitment Page
167 |
168 |
169 | ## News
170 |
171 |
172 | ## About Page
173 |
174 |
175 | ## Log out Popup
176 |
177 |
178 | ## Demo Recording and apk file
179 |
180 | https://drive.google.com/drive/folders/1t9E1gUFWgu8jsA4Boe9rY2UH50XW5Dla?usp=sharing
181 |
182 | ## Github Repository
183 |
184 | https://github.com/ritishzalke/DiagnoPlus
185 |
186 |
187 | ## Conclusion
188 |
189 | We will be happy to answer any questions that you may have regarding the app, and if you have any suggestions for improving the app kindly mail us or contact us on LinkedIn.
190 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt7.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:printing/printing.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import '../../login/models/user_model.dart';
10 | class Receipt7 extends StatefulWidget {
11 | // const Receipt({Key? key}) : super(key: key);
12 |
13 | @override
14 | _Receipt7State createState() => _Receipt7State();
15 | }
16 |
17 | class _Receipt7State extends State {
18 | User user;
19 | UserModel userModel;
20 | DatabaseReference userRef;
21 | final GlobalKey> _printKey = GlobalKey();
22 |
23 | void _printScreen() {
24 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
25 | final doc = pw.Document();
26 |
27 | final image = await WidgetWraper.fromKey(key: _printKey);
28 |
29 | doc.addPage(pw.Page(
30 | pageFormat: format,
31 | build: (pw.Context context) {
32 | return pw.Center(
33 | child: pw.Expanded(
34 | child: pw.Image(image),
35 | ),
36 | );
37 | }));
38 |
39 | return doc.save();
40 | });
41 | }
42 | _getUserDetails() async {
43 | DataSnapshot snapshot = (await userRef.once());
44 |
45 | userModel = UserModel.fromMap(Map.from(snapshot.value));
46 |
47 | setState(() {});
48 | }
49 | @override
50 | void initState() {
51 | super.initState();
52 |
53 | user = FirebaseAuth.instance.currentUser;
54 | if (user != null) {
55 | userRef =
56 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
57 | }
58 |
59 | _getUserDetails();
60 | }
61 | @override
62 | Widget build(BuildContext context) {
63 | return Scaffold(
64 |
65 | appBar: AppBar(
66 | title: const Text('Receipt'),
67 | backgroundColor: Colors.blueAccent,
68 | ),
69 | body: Center(
70 | child: Column(
71 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
72 | children: [
73 | RepaintBoundary(
74 | key: _printKey,
75 | child: userModel == null
76 | ? const Center(child: CircularProgressIndicator())
77 | :Column(
78 | children: [
79 |
80 | SizedBox(
81 | height: 30,
82 | ),
83 | Center(
84 | child: Container(
85 | child: Text(
86 | "APPOINTMENT CONFIRMED",
87 | style: TextStyle(
88 | color: Colors.red,
89 | fontWeight: FontWeight.bold,
90 | fontSize: 25
91 | ),
92 | ),
93 | ),
94 | ),
95 | SizedBox(height: 30,),
96 | Divider(
97 | thickness: 20,
98 | ),
99 | SizedBox(height: 30,),
100 | Row(
101 | children: [
102 | Container(
103 | margin: EdgeInsets.only(left: 10,bottom: 15),
104 | child: Text("Doctor's Name: Doctor 1", style: TextStyle(fontSize: 15),),
105 | ),
106 | ]
107 | ),
108 | Row(
109 | children: [
110 | Container(
111 | margin: EdgeInsets.only(left: 10,bottom: 15),
112 | child: Text("Patient's name: ",style: TextStyle(fontSize: 15),),
113 | ),
114 | FittedBox(
115 | fit: BoxFit.fitWidth,
116 | child: Container(
117 | margin: EdgeInsets.only(left: 10,bottom: 15),
118 | child: Text(
119 | userModel.fullName,
120 | ),
121 | ),
122 | ),
123 |
124 | ],
125 | ),
126 | Row(
127 | children: [
128 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
129 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 15),),
130 | ),
131 | FittedBox(
132 | fit: BoxFit.fitWidth,
133 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
134 | child: Text(
135 | userModel.email,
136 | ),
137 | ),
138 | ),
139 | ],
140 | ),
141 | Row(
142 | children: [
143 | Container(
144 | margin: EdgeInsets.only(left: 10,bottom: 15),
145 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 15),),
146 | ),
147 | Container(
148 | margin: EdgeInsets.only(left: 10,bottom: 15),
149 | child: Text(
150 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 15),
151 | ),
152 | ),
153 | ],
154 | ),
155 | Row(
156 | children: [
157 | Container(
158 | margin: EdgeInsets.only(left: 10,bottom: 15),
159 | child: Text("Time: 9:00",style: TextStyle(fontSize: 15),),
160 | ),
161 | ],
162 | ),
163 | Divider(
164 | thickness: 20,
165 | ),
166 | // Container(
167 | // decoration: BoxDecoration(
168 | // image: DecorationImage(
169 | // image: AssetImage("assets/stamp.png")
170 | // )
171 | // ),
172 | // )
173 | SizedBox(height: 30,),
174 | Column(
175 | mainAxisAlignment: MainAxisAlignment.end,
176 | crossAxisAlignment: CrossAxisAlignment.end,
177 |
178 | children: [Image.asset(
179 |
180 | "assets/stmp.png"
181 | ),
182 | ]
183 | ),
184 | SizedBox(height: 30,),
185 | Divider(
186 | thickness: 20,
187 | ),
188 | ],
189 |
190 |
191 | ),
192 | ),
193 | ],
194 | ),
195 | ),
196 | floatingActionButton: FloatingActionButton(
197 | child: const Icon(Icons.print),
198 | onPressed: _printScreen,
199 | ),
200 | );
201 | }
202 | }
203 |
204 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt6.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:printing/printing.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import '../../login/models/user_model.dart';
10 | class Receipt6 extends StatefulWidget {
11 | // const Receipt({Key? key}) : super(key: key);
12 |
13 | @override
14 | _Receipt6State createState() => _Receipt6State();
15 | }
16 |
17 | class _Receipt6State extends State {
18 | User user;
19 | UserModel userModel;
20 | DatabaseReference userRef;
21 | final GlobalKey> _printKey = GlobalKey();
22 |
23 | void _printScreen() {
24 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
25 | final doc = pw.Document();
26 |
27 | final image = await WidgetWraper.fromKey(key: _printKey);
28 |
29 | doc.addPage(pw.Page(
30 | pageFormat: format,
31 | build: (pw.Context context) {
32 | return pw.Center(
33 | child: pw.Expanded(
34 | child: pw.Image(image),
35 | ),
36 | );
37 | }));
38 |
39 | return doc.save();
40 | });
41 | }
42 | _getUserDetails() async {
43 | DataSnapshot snapshot = (await userRef.once());
44 |
45 | userModel = UserModel.fromMap(Map.from(snapshot.value));
46 |
47 | setState(() {});
48 | }
49 | @override
50 | void initState() {
51 | super.initState();
52 |
53 | user = FirebaseAuth.instance.currentUser;
54 | if (user != null) {
55 | userRef =
56 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
57 | }
58 |
59 | _getUserDetails();
60 | }
61 | @override
62 | Widget build(BuildContext context) {
63 | return Scaffold(
64 |
65 | appBar: AppBar(
66 | title: const Text('Receipt'),
67 | backgroundColor: Colors.blueAccent,
68 | ),
69 | body: Center(
70 | child: Column(
71 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
72 | children: [
73 | RepaintBoundary(
74 | key: _printKey,
75 | child:userModel == null
76 | ? const Center(child: CircularProgressIndicator())
77 | :Column(
78 | children: [
79 |
80 | SizedBox(
81 | height: 30,
82 | ),
83 | Center(
84 | child: Container(
85 | child: Text(
86 | "APPOINTMENT CONFIRMED",
87 | style: TextStyle(
88 | color: Colors.red,
89 | fontWeight: FontWeight.bold,
90 | fontSize: 25
91 | ),
92 | ),
93 | ),
94 | ),
95 | SizedBox(height: 30,),
96 | Divider(
97 | thickness: 20,
98 | ),
99 | SizedBox(height: 30,),
100 | Row(
101 | children: [
102 | Container(
103 | margin: EdgeInsets.only(left: 10,bottom: 15),
104 | child: Text("Doctor's Name: Doctor 1", style: TextStyle(fontSize: 15),),
105 | ),
106 | ]
107 | ),
108 | Row(
109 | children: [
110 | Container(
111 | margin: EdgeInsets.only(left: 10,bottom: 15),
112 | child: Text("Patient's name: ",style: TextStyle(fontSize: 15),),
113 | ),
114 | FittedBox(
115 | fit: BoxFit.fitWidth,
116 | child: Container(
117 | margin: EdgeInsets.only(left: 10,bottom: 15),
118 | child: Text(
119 | userModel.fullName,
120 | ),
121 | ),
122 | ),
123 |
124 | ],
125 | ),
126 | Row(
127 | children: [
128 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
129 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 15),),
130 | ),
131 | FittedBox(
132 | fit: BoxFit.fitWidth,
133 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
134 | child: Text(
135 | userModel.email,
136 | ),
137 | ),
138 | ),
139 | ],
140 | ),
141 | Row(
142 | children: [
143 | Container(
144 | margin: EdgeInsets.only(left: 10,bottom: 15),
145 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 15),),
146 | ),
147 | Container(
148 | margin: EdgeInsets.only(left: 10,bottom: 15),
149 | child: Text(
150 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 15),
151 | ),
152 | ),
153 | ],
154 | ),
155 | Row(
156 | children: [
157 | Container(
158 | margin: EdgeInsets.only(left: 10,bottom: 15),
159 | child: Text("Time: 6:30",style: TextStyle(fontSize: 15),),
160 | ),
161 | ],
162 | ),
163 | Divider(
164 | thickness: 20,
165 | ),
166 | // Container(
167 | // decoration: BoxDecoration(
168 | // image: DecorationImage(
169 | // image: AssetImage("assets/stamp.png")
170 | // )
171 | // ),
172 | // )
173 | SizedBox(height: 30,),
174 | Column(
175 | mainAxisAlignment: MainAxisAlignment.end,
176 | crossAxisAlignment: CrossAxisAlignment.end,
177 |
178 | children: [Image.asset(
179 |
180 | "assets/stmp.png"
181 | ),
182 | ]
183 | ),
184 | SizedBox(height: 30,),
185 | Divider(
186 | thickness: 20,
187 | ),
188 | ],
189 |
190 |
191 | ),
192 | ),
193 | ],
194 | ),
195 | ),
196 | floatingActionButton: FloatingActionButton(
197 | child: const Icon(Icons.print),
198 | onPressed: _printScreen,
199 | ),
200 | );
201 | }
202 | }
203 |
204 |
--------------------------------------------------------------------------------
/lib/News/home.dart:
--------------------------------------------------------------------------------
1 | import 'package:NewsApp/News/services/api_service.dart';
2 | import 'package:NewsApp/pages/about.dart';
3 |
4 |
5 | import 'package:firebase_auth/firebase_auth.dart';
6 | import 'package:flutter/material.dart';
7 | import '../Appointment/Appointment.dart';
8 |
9 | import '../login/screens/login_screen.dart';
10 | import '../login/screens/profile_screen.dart';
11 | import '../main.dart';
12 | import 'article_model.dart';
13 | import 'components/customListTile.dart';
14 |
15 | // void main() {
16 | // runApp(MyApp());
17 | // }
18 |
19 | // class home extends StatelessWidget {
20 | // // This widget is the root of your application.
21 | // @override
22 | // Widget build(BuildContext context) {
23 | // return MaterialApp(
24 | // debugShowCheckedModeBanner: false,
25 | //
26 | // home: HomePage(),
27 | // );
28 | // }
29 | // }
30 |
31 | class HomePage extends StatefulWidget {
32 | @override
33 | _HomePageState createState() => _HomePageState();
34 | }
35 |
36 | class _HomePageState extends State {
37 | ApiService client = ApiService();
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return Scaffold(
42 | appBar: AppBar(
43 | title: Text("Medical News",
44 | style: TextStyle(color: Colors.white),
45 | ),
46 | // leading: const Icon(
47 | // Icons.menu,
48 | // color: Colors.white,
49 | // ),
50 | backgroundColor: Colors.blueAccent,
51 | ),
52 |
53 | //Now let's call the APi services with futurebuilder wiget
54 | body: FutureBuilder(
55 | future: client.getArticle(),
56 | builder: (BuildContext context, AsyncSnapshot> snapshot) {
57 | //let's check if we got a response or not
58 | if (snapshot.hasData) {
59 | //Now let's make a list of articles
60 | List articles = snapshot.data;
61 | return ListView.builder(
62 | //Now let's create our custom List tile
63 | itemCount: articles.length,
64 | itemBuilder: (context, index) =>
65 | customListTile(articles[index], context),
66 | );
67 | }
68 | return Center(
69 | child: CircularProgressIndicator(),
70 | );
71 | },
72 | ),
73 | drawer: Drawer(
74 | child: ListView(
75 | children: [
76 | // new UserAccountsDrawerHeader(
77 | // accountName: Text('Ritish'),
78 | // accountEmail: Text('ricjjcd@gmail.com'),
79 | // currentAccountPicture: const CircleAvatar(
80 | // backgroundImage: NetworkImage('https://images.squarespace-cdn.com/content/v1/5824673c2e69cfc8ac1e3cd3/1580377764933-1L0AVRF4MU86B18J3S4A/Picture+of+woodlands+taken+on+iphone+using+natural+light'),
81 | // ) ,
82 | // ),
83 |
84 | ListTile(
85 | title: Text("Home"),
86 | onTap: (){
87 | // Navigator.of(context).pop();
88 | Navigator.push(context, MaterialPageRoute(
89 | builder: (BuildContext context)=> MyHomePage(),
90 | ),
91 |
92 | );
93 | },
94 | ),
95 | new Divider(),
96 | ListTile(
97 | title: Text("My Profile"),
98 | onTap: (){
99 | Navigator.of(context).pop();
100 | Navigator.push(context, MaterialPageRoute(
101 | builder: (BuildContext context)=> ProfileScreen()
102 | ),
103 |
104 | );
105 | },
106 | ),
107 | new Divider(),
108 | ListTile(
109 | title: Text("Appointments"),
110 | onTap: (){
111 | Navigator.of(context).pop();
112 | Navigator.push(context, MaterialPageRoute(
113 | builder: (BuildContext context)=> Appointment(),
114 | ),
115 |
116 | );
117 | },
118 | ),
119 | // new Divider(),
120 | // ListTile(
121 | // title: Text("Medicine reminder"),
122 | // onTap: (){
123 | // Navigator.of(context).pop();
124 | // Navigator.push(context, MaterialPageRoute(
125 | // builder: (BuildContext context)=> Reminder(),
126 | // ),
127 | //
128 | // );
129 | // },
130 | // ),
131 | new Divider(),
132 | ListTile(
133 | title: Text("News"),
134 | onTap: (){
135 | Navigator.of(context).pop();
136 | Navigator.push(context, MaterialPageRoute(
137 | builder: (BuildContext context)=> HomePage()
138 | ),
139 |
140 | );
141 | },
142 | ),
143 |
144 |
145 | new Divider(),
146 | ListTile(
147 | title: Text("About Page"),
148 | onTap: (){
149 | Navigator.of(context).pop();
150 | Navigator.push(context, new MaterialPageRoute(
151 | builder: (BuildContext context)=> new AboutPage()
152 | ),
153 |
154 | );
155 | },
156 | ),
157 | new Divider(),
158 | ListTile(
159 | title: Text("Log Out"),
160 | onTap: (){
161 | // Navigator.of(context).pop();
162 | showDialog(context: context, builder: (ctx){
163 | return AlertDialog(
164 | title: Text('Confirmation !!!'),
165 | content: Text('Are you sure to Log Out ? '),
166 | actions: [
167 |
168 | TextButton(onPressed: (){
169 |
170 | Navigator.of(ctx).pop();
171 |
172 | }, child: Text('No'),),
173 |
174 |
175 | TextButton(onPressed: (){
176 | Navigator.of(ctx).pop();
177 |
178 | FirebaseAuth.instance.signOut();
179 |
180 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
181 | return LoginScreen();
182 | }));
183 |
184 | }, child: Text('Yes'),),
185 |
186 | ],
187 | );
188 | }
189 | );
190 | },
191 | ),
192 | ],
193 | ),
194 |
195 |
196 | ),
197 | );
198 | }
199 | }
200 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt4.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:printing/printing.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import '../../login/models/user_model.dart';
10 | class Receipt4 extends StatefulWidget {
11 | // const Receipt({Key? key}) : super(key: key);
12 |
13 | @override
14 | _Receipt4State createState() => _Receipt4State();
15 | }
16 |
17 | class _Receipt4State extends State {
18 | User user;
19 | UserModel userModel;
20 | DatabaseReference userRef;
21 | final GlobalKey> _printKey = GlobalKey();
22 |
23 | void _printScreen() {
24 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
25 | final doc = pw.Document();
26 |
27 | final image = await WidgetWraper.fromKey(key: _printKey);
28 |
29 | doc.addPage(pw.Page(
30 | pageFormat: format,
31 | build: (pw.Context context) {
32 | return pw.Center(
33 | child: pw.Expanded(
34 | child: pw.Image(image),
35 | ),
36 | );
37 | }));
38 |
39 | return doc.save();
40 | });
41 | }
42 | _getUserDetails() async {
43 | DataSnapshot snapshot = (await userRef.once());
44 |
45 | userModel = UserModel.fromMap(Map.from(snapshot.value));
46 |
47 | setState(() {});
48 | }
49 | @override
50 | void initState() {
51 | super.initState();
52 |
53 | user = FirebaseAuth.instance.currentUser;
54 | if (user != null) {
55 | userRef =
56 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
57 | }
58 |
59 | _getUserDetails();
60 | }
61 | @override
62 | Widget build(BuildContext context) {
63 | return Scaffold(
64 |
65 | appBar: AppBar(
66 | title: const Text('Receipt'),
67 | backgroundColor: Colors.blueAccent,
68 | ),
69 | body: Center(
70 | child: Column(
71 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
72 | children: [
73 | RepaintBoundary(
74 | key: _printKey,
75 | child: userModel == null
76 | ? const Center(child: CircularProgressIndicator())
77 | :Column(
78 | mainAxisAlignment: MainAxisAlignment.start,
79 | crossAxisAlignment: CrossAxisAlignment.start,
80 | children: [
81 |
82 | SizedBox(
83 | height: 30,
84 | ),
85 | Center(
86 | child: Container(
87 | child: Text(
88 | "APPOINTMENT CONFIRMED",
89 | style: TextStyle(
90 | color: Colors.red,
91 | fontWeight: FontWeight.bold,
92 | fontSize: 25
93 | ),
94 | ),
95 | ),
96 | ),
97 | SizedBox(height: 30,),
98 | Divider(
99 | thickness: 20,
100 | ),
101 | SizedBox(height: 30,),
102 | Row(
103 | children: [
104 | Container(
105 | margin: EdgeInsets.only(left: 10,bottom: 15),
106 | child: Text("Doctor's Name: Doctor 3", style: TextStyle(fontSize: 20),),
107 | ),
108 | ]
109 | ),
110 | FittedBox(
111 | fit: BoxFit.fitWidth,
112 | child: Row(
113 | children: [
114 | Container(
115 | margin: EdgeInsets.only(left: 10,bottom: 15),
116 | child: Text("Patient's name: ",style: TextStyle(fontSize: 20),),
117 | ),
118 | FittedBox(fit: BoxFit.fitWidth,
119 | child: Container(
120 | margin: EdgeInsets.only(left: 10,bottom: 15),
121 | child: Text(
122 | userModel.fullName,style: TextStyle(fontSize: 20),
123 | ),
124 | ),
125 | ),
126 |
127 | ],
128 | ),
129 | ),
130 | FittedBox(
131 | fit: BoxFit.fitWidth,
132 | child: Row(
133 | children: [
134 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
135 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 20),),
136 | ),
137 | FittedBox(
138 | fit: BoxFit.fitWidth,
139 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
140 | child: Text(
141 | userModel.email,style: TextStyle(fontSize: 20),
142 | ),
143 | ),
144 | ),
145 | ],
146 | ),
147 | ),
148 | Row(
149 | children: [
150 | Container(
151 | margin: EdgeInsets.only(left: 10,bottom: 15),
152 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 20),),
153 | ),
154 | Container(
155 | margin: EdgeInsets.only(left: 10,bottom: 15),
156 | child: Text(
157 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 20),
158 | ),
159 | ),
160 | ],
161 | ),
162 | Row(
163 | children: [
164 | Container(
165 | margin: EdgeInsets.only(left: 10,bottom: 15),
166 | child: Text("Time: 10:30",style: TextStyle(fontSize: 20),),
167 | ),
168 | ],
169 | ),
170 | Divider(
171 | thickness: 20,
172 | ),
173 | // Container(
174 | // decoration: BoxDecoration(
175 | // image: DecorationImage(
176 | // image: AssetImage("assets/stamp.png")
177 | // )
178 | // ),
179 | // )
180 | SizedBox(height: 30,),
181 |
182 | ],
183 |
184 |
185 | ),
186 | ),
187 | Column(
188 | mainAxisAlignment: MainAxisAlignment.end,
189 | crossAxisAlignment: CrossAxisAlignment.end,
190 |
191 | children: [Image.asset(
192 |
193 | "assets/stmp.png"
194 | ),
195 | ]
196 | ),
197 | SizedBox(height: 30,),
198 | Divider(
199 | thickness: 20,
200 | ),
201 | ],
202 | ),
203 | ),
204 | floatingActionButton: FloatingActionButton(
205 | child: const Icon(Icons.print),
206 | onPressed: _printScreen,
207 | ),
208 | );
209 | }
210 | }
211 |
212 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt5.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:printing/printing.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import '../../login/models/user_model.dart';
10 | class Receipt5 extends StatefulWidget {
11 | // const Receipt({Key? key}) : super(key: key);
12 |
13 | @override
14 | _Receipt5State createState() => _Receipt5State();
15 | }
16 |
17 | class _Receipt5State extends State {
18 | User user;
19 | UserModel userModel;
20 | DatabaseReference userRef;
21 | final GlobalKey> _printKey = GlobalKey();
22 |
23 | void _printScreen() {
24 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
25 | final doc = pw.Document();
26 |
27 | final image = await WidgetWraper.fromKey(key: _printKey);
28 |
29 | doc.addPage(pw.Page(
30 | pageFormat: format,
31 | build: (pw.Context context) {
32 | return pw.Center(
33 | child: pw.Expanded(
34 | child: pw.Image(image),
35 | ),
36 | );
37 | }));
38 |
39 | return doc.save();
40 | });
41 | }
42 | _getUserDetails() async {
43 | DataSnapshot snapshot = (await userRef.once());
44 |
45 | userModel = UserModel.fromMap(Map.from(snapshot.value));
46 |
47 | setState(() {});
48 | }
49 | @override
50 | void initState() {
51 | super.initState();
52 |
53 | user = FirebaseAuth.instance.currentUser;
54 | if (user != null) {
55 | userRef =
56 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
57 | }
58 |
59 | _getUserDetails();
60 | }
61 | @override
62 | Widget build(BuildContext context) {
63 | return Scaffold(
64 |
65 | appBar: AppBar(
66 | title: const Text('Receipt'),
67 | backgroundColor: Colors.blueAccent,
68 | ),
69 | body: Center(
70 | child: Column(
71 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
72 | children: [
73 | RepaintBoundary(
74 | key: _printKey,
75 | child:userModel == null
76 | ? const Center(child: CircularProgressIndicator())
77 | :Column(
78 | mainAxisAlignment: MainAxisAlignment.start,
79 | crossAxisAlignment: CrossAxisAlignment.start,
80 | children: [
81 |
82 | SizedBox(
83 | height: 30,
84 | ),
85 | Center(
86 | child: Container(
87 | child: Text(
88 | "APPOINTMENT CONFIRMED",
89 | style: TextStyle(
90 | color: Colors.red,
91 | fontWeight: FontWeight.bold,
92 | fontSize: 25
93 | ),
94 | ),
95 | ),
96 | ),
97 | SizedBox(height: 30,),
98 | Divider(
99 | thickness: 20,
100 | ),
101 | SizedBox(height: 30,),
102 | Row(
103 | children: [
104 | Container(
105 | margin: EdgeInsets.only(left: 10,bottom: 15),
106 | child: Text("Doctor's Name: Doctor 3", style: TextStyle(fontSize: 20),),
107 | ),
108 | ]
109 | ),
110 | FittedBox(
111 | fit: BoxFit.fitWidth,
112 | child: Row(
113 | children: [
114 | Container(
115 | margin: EdgeInsets.only(left: 10,bottom: 15),
116 | child: Text("Patient's name: ",style: TextStyle(fontSize: 20),),
117 | ),
118 | FittedBox(
119 | fit: BoxFit.fitWidth,
120 | child: Container(
121 | margin: EdgeInsets.only(left: 10,bottom: 15),
122 | child: Text(
123 | userModel.fullName,style: TextStyle(fontSize: 20),
124 | ),
125 | ),
126 | ),
127 |
128 | ],
129 | ),
130 | ),
131 | FittedBox(
132 | fit: BoxFit.fitWidth,
133 | child: Row(
134 | children: [
135 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
136 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 20),),
137 | ),
138 | FittedBox(
139 | fit: BoxFit.fitWidth,
140 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
141 | child: Text(
142 | userModel.email,style: TextStyle(fontSize: 20),
143 | ),
144 | ),
145 | ),
146 | ],
147 | ),
148 | ),
149 | Row(
150 | children: [
151 | Container(
152 | margin: EdgeInsets.only(left: 10,bottom: 15),
153 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 20),),
154 | ),
155 | Container(
156 | margin: EdgeInsets.only(left: 10,bottom: 15),
157 | child: Text(
158 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 20),
159 | ),
160 | ),
161 | ],
162 | ),
163 | Row(
164 | children: [
165 | Container(
166 | margin: EdgeInsets.only(left: 10,bottom: 15),
167 | child: Text("Time: 9:00",style: TextStyle(fontSize: 20),),
168 | ),
169 | ],
170 | ),
171 | Divider(
172 | thickness: 20,
173 | ),
174 | // Container(
175 | // decoration: BoxDecoration(
176 | // image: DecorationImage(
177 | // image: AssetImage("assets/stamp.png")
178 | // )
179 | // ),
180 | // )
181 | SizedBox(height: 30,),
182 |
183 | ],
184 |
185 |
186 | ),
187 | ),
188 | Column(
189 | mainAxisAlignment: MainAxisAlignment.end,
190 | crossAxisAlignment: CrossAxisAlignment.end,
191 |
192 | children: [Image.asset(
193 |
194 | "assets/stmp.png"
195 | ),
196 | ]
197 | ),
198 | SizedBox(height: 30,),
199 | Divider(
200 | thickness: 20,
201 | ),
202 | ],
203 | ),
204 | ),
205 | floatingActionButton: FloatingActionButton(
206 | child: const Icon(Icons.print),
207 | onPressed: _printScreen,
208 | ),
209 | );
210 | }
211 | }
212 |
213 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt2.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:printing/printing.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 |
10 | import '../../login/models/user_model.dart';
11 | class Receipt2 extends StatefulWidget {
12 | // const Receipt({Key? key}) : super(key: key);
13 |
14 | @override
15 | _Receipt2State createState() => _Receipt2State();
16 | }
17 |
18 | class _Receipt2State extends State {
19 | User user;
20 | UserModel userModel;
21 | DatabaseReference userRef;
22 | final GlobalKey> _printKey = GlobalKey();
23 |
24 | void _printScreen() {
25 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
26 | final doc = pw.Document();
27 |
28 | final image = await WidgetWraper.fromKey(key: _printKey);
29 |
30 | doc.addPage(pw.Page(
31 | pageFormat: format,
32 | build: (pw.Context context) {
33 | return pw.Center(
34 | child: pw.Expanded(
35 | child: pw.Image(image),
36 | ),
37 | );
38 | }));
39 |
40 | return doc.save();
41 | });
42 | }
43 | _getUserDetails() async {
44 | DataSnapshot snapshot = (await userRef.once());
45 |
46 | userModel = UserModel.fromMap(Map.from(snapshot.value));
47 |
48 | setState(() {});
49 | }
50 | @override
51 | void initState() {
52 | super.initState();
53 |
54 | user = FirebaseAuth.instance.currentUser;
55 | if (user != null) {
56 | userRef =
57 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
58 | }
59 |
60 | _getUserDetails();
61 | }
62 | @override
63 | Widget build(BuildContext context) {
64 | return Scaffold(
65 |
66 | appBar: AppBar(
67 | title: const Text('Receipt'),
68 | backgroundColor: Colors.blueAccent,
69 | ),
70 | body: Center(
71 | child: Column(
72 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
73 | children: [
74 | RepaintBoundary(
75 | key: _printKey,
76 | child: userModel == null
77 | ? const Center(child: CircularProgressIndicator())
78 | :Column(
79 | mainAxisAlignment: MainAxisAlignment.start,
80 | crossAxisAlignment: CrossAxisAlignment.start,
81 | children: [
82 |
83 | SizedBox(
84 | height: 30,
85 | ),
86 | Center(
87 | child: Container(
88 | child: Text(
89 | "APPOINTMENT CONFIRMED",
90 | style: TextStyle(
91 | color: Colors.red,
92 | fontWeight: FontWeight.bold,
93 | fontSize: 25
94 | ),
95 | ),
96 | ),
97 | ),
98 | SizedBox(height: 30,),
99 | Divider(
100 | thickness: 20,
101 | ),
102 | SizedBox(height: 30,),
103 | Row(
104 | children: [
105 | Container(
106 | margin: EdgeInsets.only(left: 10,bottom: 15),
107 | child: Text("Doctor's Name: Doctor 2", style: TextStyle(fontSize: 20),),
108 | ),
109 | ]
110 | ),
111 | FittedBox(
112 | fit: BoxFit.fitWidth,
113 | child: Row(
114 | children: [
115 | Container(
116 | margin: EdgeInsets.only(left: 10,bottom: 15),
117 | child: Text("Patient's name: ",style: TextStyle(fontSize: 20),),
118 | ),
119 | FittedBox(
120 | fit: BoxFit.fitWidth,
121 | child: Container(
122 | margin: EdgeInsets.only(left: 10,bottom: 15),
123 | child: Text(
124 | userModel.fullName,style: TextStyle(fontSize: 20),
125 | ),
126 | ),
127 | ),
128 |
129 | ],
130 | ),
131 | ),
132 | FittedBox(
133 | fit: BoxFit.fitWidth,
134 | child: Row(
135 |
136 | children: [
137 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
138 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 20),),
139 | ),
140 | FittedBox(
141 | fit: BoxFit.fitWidth,
142 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
143 | child: Text(
144 | userModel.email,style: TextStyle(fontSize: 20),
145 | ),
146 | ),
147 | ),
148 | ],
149 | ),
150 | ),
151 | Row(
152 | children: [
153 | Container(
154 | margin: EdgeInsets.only(left: 10,bottom: 15),
155 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 20),),
156 | ),
157 | Container(
158 | margin: EdgeInsets.only(left: 10,bottom: 15),
159 | child: Text(
160 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 20),
161 | ),
162 | ),
163 | ],
164 | ),
165 | Row(
166 | children: [
167 | Container(
168 | margin: EdgeInsets.only(left: 10,bottom: 15),
169 | child: Text("Time: 9:30 ",style: TextStyle(fontSize: 20),),
170 | ),
171 | ],
172 | ),
173 | Divider(
174 | thickness: 20,
175 | ),
176 | // Container(
177 | // decoration: BoxDecoration(
178 | // image: DecorationImage(
179 | // image: AssetImage("assets/stamp.png")
180 | // )
181 | // ),
182 | // )
183 | SizedBox(height: 30,),
184 |
185 | ],
186 |
187 |
188 | ),
189 | ),
190 | Column(
191 | mainAxisAlignment: MainAxisAlignment.end,
192 | crossAxisAlignment: CrossAxisAlignment.end,
193 |
194 | children: [Image.asset(
195 |
196 | "assets/stmp.png"
197 | ),
198 | ]
199 | ),
200 | SizedBox(height: 30,),
201 | Divider(
202 | thickness: 20,
203 | ),
204 | ],
205 | ),
206 | ),
207 | floatingActionButton: FloatingActionButton(
208 | child: const Icon(Icons.print),
209 | onPressed: _printScreen,
210 | ),
211 | );
212 | }
213 | }
214 |
215 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt3.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:pdf/pdf.dart';
7 | import 'package:pdf/widgets.dart' as pw;
8 | import 'package:printing/printing.dart';
9 | import '../../login/models/user_model.dart';
10 | class Receipt3 extends StatefulWidget {
11 | // const Receipt({Key? key}) : super(key: key);
12 |
13 | @override
14 | _Receipt3State createState() => _Receipt3State();
15 | }
16 |
17 | class _Receipt3State extends State {
18 | User user;
19 | UserModel userModel;
20 | DatabaseReference userRef;
21 | final GlobalKey> _printKey = GlobalKey();
22 |
23 | void _printScreen() {
24 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
25 | final doc = pw.Document();
26 |
27 | final image = await WidgetWraper.fromKey(key: _printKey);
28 |
29 | doc.addPage(pw.Page(
30 | pageFormat: format,
31 | build: (pw.Context context) {
32 | return pw.Center(
33 | child: pw.Expanded(
34 | child: pw.Image(image),
35 | ),
36 | );
37 | }));
38 |
39 | return doc.save();
40 | });
41 | }
42 | _getUserDetails() async {
43 | DataSnapshot snapshot = (await userRef.once());
44 |
45 | userModel = UserModel.fromMap(Map.from(snapshot.value));
46 |
47 | setState(() {});
48 | }
49 | @override
50 | void initState() {
51 | super.initState();
52 |
53 | user = FirebaseAuth.instance.currentUser;
54 | if (user != null) {
55 | userRef =
56 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
57 | }
58 |
59 | _getUserDetails();
60 | }
61 | @override
62 | Widget build(BuildContext context) {
63 | return Scaffold(
64 |
65 | appBar: AppBar(
66 | title: const Text('Receipt'),
67 | backgroundColor: Colors.blueAccent,
68 | ),
69 | body: Center(
70 | child: Column(
71 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
72 | children: [
73 | RepaintBoundary(
74 | key: _printKey,
75 | child: userModel == null
76 | ? const Center(child: CircularProgressIndicator())
77 | :Column(
78 | mainAxisAlignment: MainAxisAlignment.start,
79 | crossAxisAlignment: CrossAxisAlignment.start,
80 | children: [
81 |
82 | SizedBox(
83 | height: 30,
84 | ),
85 | Center(
86 | child: Container(
87 | child: Text(
88 | "APPOINTMENT CONFIRMED",
89 | style: TextStyle(
90 | color: Colors.red,
91 | fontWeight: FontWeight.bold,
92 | fontSize: 25
93 | ),
94 | ),
95 | ),
96 | ),
97 | SizedBox(height: 30,),
98 | Divider(
99 | thickness: 20,
100 | ),
101 | SizedBox(height: 30,),
102 | Row(
103 | children: [
104 | Container(
105 | margin: EdgeInsets.only(left: 10,bottom: 15),
106 | child: Text("Doctor's Name: Doctor 2", style: TextStyle(fontSize: 20),),
107 | ),
108 | ]
109 | ),
110 | FittedBox(
111 | fit: BoxFit.fitWidth,
112 | child: Row(
113 | children: [
114 | Container(
115 | margin: EdgeInsets.only(left: 10,bottom: 15),
116 | child: Text("Patient's name: ",style: TextStyle(fontSize: 20),),
117 | ),
118 | FittedBox(fit: BoxFit.fitWidth,
119 | child: Container(
120 | margin: EdgeInsets.only(left: 10,bottom: 15),
121 | child: Text(
122 | userModel.fullName,style: TextStyle(fontSize: 20),
123 | ),
124 | ),
125 | ),
126 |
127 | ],
128 | ),
129 | ),
130 | FittedBox(
131 | fit: BoxFit.fitWidth,
132 | child: Row(
133 | children: [
134 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
135 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 20),),
136 | ),
137 | FittedBox(fit: BoxFit.fitWidth,
138 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
139 | child: Text(
140 | userModel.email,style: TextStyle(fontSize: 20),
141 | ),
142 | ),
143 | ),
144 | ],
145 | ),
146 | ),
147 | Row(
148 | children: [
149 | Container(
150 | margin: EdgeInsets.only(left: 10,bottom: 15),
151 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 20),),
152 | ),
153 | Container(
154 | margin: EdgeInsets.only(left: 10,bottom: 15),
155 | child: Text(
156 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 20),
157 | ),
158 | ),
159 | ],
160 | ),
161 | Row(
162 | children: [
163 | Container(
164 | margin: EdgeInsets.only(left: 10,bottom: 15),
165 | child: Text("Time: 8:00",style: TextStyle(fontSize: 20),),
166 | ),
167 | ],
168 | ),
169 | Divider(
170 | thickness: 20,
171 | ),
172 | // Container(
173 | // decoration: BoxDecoration(
174 | // image: DecorationImage(
175 | // image: AssetImage("assets/stamp.png")
176 | // )
177 | // ),
178 | // )
179 | SizedBox(height: 30,),
180 |
181 | ],
182 |
183 |
184 | ),
185 | ),
186 | Column(
187 | mainAxisAlignment: MainAxisAlignment.end,
188 | crossAxisAlignment: CrossAxisAlignment.end,
189 |
190 | children: [Image.asset(
191 |
192 | "assets/stmp.png"
193 | ),
194 | ]
195 | ),
196 | SizedBox(height: 30,),
197 | Divider(
198 | thickness: 20,
199 | ),
200 | ],
201 | ),
202 | ),
203 | floatingActionButton: FloatingActionButton(
204 | child: const Icon(Icons.print),
205 | onPressed: _printScreen,
206 | ),
207 | );
208 | }
209 | }
210 |
211 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt1.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/cupertino.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:intl/intl.dart';
7 | import 'package:pdf/pdf.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import 'package:printing/printing.dart';
10 | import '../../login/models/user_model.dart';
11 | class Receipt1 extends StatefulWidget {
12 | // const Receipt({Key? key}) : super(key: key);
13 |
14 | @override
15 | _Receipt1State createState() => _Receipt1State();
16 | }
17 |
18 | class _Receipt1State extends State {
19 | User user;
20 | UserModel userModel;
21 | DatabaseReference userRef;
22 |
23 |
24 | final GlobalKey> _printKey = GlobalKey();
25 |
26 | void _printScreen() {
27 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
28 | final doc = pw.Document();
29 |
30 | final image = await WidgetWraper.fromKey(key: _printKey);
31 |
32 | doc.addPage(pw.Page(
33 | pageFormat: format,
34 | build: (pw.Context context) {
35 | return pw.Center(
36 | child: pw.Expanded(
37 | child: pw.Image(image),
38 | ),
39 | );
40 | }));
41 |
42 | return doc.save();
43 | });
44 | }
45 | _getUserDetails() async {
46 | DataSnapshot snapshot = (await userRef.once());
47 |
48 | userModel = UserModel.fromMap(Map.from(snapshot.value));
49 |
50 | setState(() {});
51 | }
52 | @override
53 | void initState() {
54 | super.initState();
55 |
56 | user = FirebaseAuth.instance.currentUser;
57 | if (user != null) {
58 | userRef =
59 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
60 | }
61 |
62 | _getUserDetails();
63 | }
64 | @override
65 | Widget build(BuildContext context) {
66 | return Scaffold(
67 |
68 | appBar: AppBar(
69 | title: const Text('Receipt'),
70 | backgroundColor: Colors.blueAccent,
71 | ),
72 | body: Center(
73 | child: Column(
74 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
75 | children: [
76 | RepaintBoundary(
77 | key: _printKey,
78 | child: userModel == null
79 | ? const Center(child: CircularProgressIndicator())
80 | :Column(
81 | mainAxisAlignment: MainAxisAlignment.start,
82 | crossAxisAlignment: CrossAxisAlignment.start,
83 | children: [
84 |
85 | SizedBox(
86 | height: 30,
87 | ),
88 | Center(
89 | child: Container(
90 | child: Text(
91 | "APPOINTMENT CONFIRMED",
92 | style: TextStyle(
93 | color: Colors.red,
94 | fontWeight: FontWeight.bold,
95 | fontSize: 25
96 | ),
97 | ),
98 | ),
99 | ),
100 | SizedBox(height: 30,),
101 | Divider(
102 | thickness: 20,
103 | ),
104 | SizedBox(height: 30,),
105 | Row(
106 | children: [
107 | Container(
108 | margin: EdgeInsets.only(left: 10,bottom: 15),
109 | child: Text("Doctor's Name: Doctor 1", style: TextStyle(fontSize: 20),),
110 | ),
111 | ]
112 | ),
113 | FittedBox(
114 | fit: BoxFit.fitWidth,
115 |
116 | child: Row(
117 | // mainAxisAlignment: MainAxisAlignment.start,
118 | // crossAxisAlignment: CrossAxisAlignment.start,
119 | children: [
120 | Container(
121 | margin: EdgeInsets.only(left: 10,bottom: 15),
122 | child: Text("Patient's name: ",style: TextStyle(fontSize: 20),),
123 | ),
124 | FittedBox(fit: BoxFit.fitWidth,
125 | child: Container(
126 | margin: EdgeInsets.only(left: 10,bottom: 15),
127 | child: Text(
128 | userModel.fullName,style: TextStyle(fontSize: 20),
129 | ),
130 | ),
131 | ),
132 |
133 | ],
134 | ),
135 | ),
136 | FittedBox(
137 | fit: BoxFit.fitWidth,
138 | child: Row(
139 | children: [
140 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
141 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 20),),
142 | ),
143 | FittedBox(fit: BoxFit.fitWidth,
144 | child: Container( margin: EdgeInsets.only(left: 10,bottom: 15),
145 | child: Text(
146 | userModel.email,style: TextStyle(fontSize: 20),
147 | ),
148 | ),
149 | ),
150 | ],
151 | ),
152 | ),
153 | Row(
154 | children: [
155 | Container(
156 | margin: EdgeInsets.only(left: 10,bottom: 15),
157 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 20),),
158 | ),
159 | Container(
160 | margin: EdgeInsets.only(left: 10,bottom: 15),
161 | child: Text(
162 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 20),
163 | ),
164 | ),
165 | ],
166 | ),
167 | Row(
168 | children: [
169 | Container(
170 | margin: EdgeInsets.only(left: 10,bottom: 15),
171 | child: Text("Time: 7:30 ",style: TextStyle(fontSize: 20),),
172 | ),
173 | ],
174 | ),
175 | Divider(
176 | thickness: 20,
177 | ),
178 | // Container(
179 | // decoration: BoxDecoration(
180 | // image: DecorationImage(
181 | // image: AssetImage("assets/stamp.png")
182 | // )
183 | // ),
184 | // )
185 | SizedBox(height: 30,),
186 |
187 | ],
188 |
189 |
190 | ),
191 | ),
192 | Column(
193 | mainAxisAlignment: MainAxisAlignment.end,
194 | crossAxisAlignment: CrossAxisAlignment.end,
195 |
196 | children: [Image.asset(
197 |
198 | "assets/stmp.png"
199 | ),
200 | ]
201 | ),
202 | SizedBox(height: 10,),
203 | Divider(
204 | thickness: 20,
205 | ),
206 | ],
207 | ),
208 | ),
209 | floatingActionButton: FloatingActionButton(
210 | child: const Icon(Icons.print),
211 | onPressed: _printScreen,
212 | ),
213 | );
214 | }
215 | }
216 |
217 |
--------------------------------------------------------------------------------
/lib/Appointment/receipt.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:firebase_auth/firebase_auth.dart';
4 | import 'package:firebase_database/firebase_database.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:intl/intl.dart';
7 | import 'package:pdf/pdf.dart';
8 | import 'package:pdf/widgets.dart' as pw;
9 | import 'package:printing/printing.dart';
10 |
11 |
12 | import '../../login/models/user_model.dart';
13 |
14 | class Receipt extends StatefulWidget {
15 | // const Receipt({Key? key}) : super(key: key);
16 |
17 | @override
18 | _ReceiptState createState() => _ReceiptState();
19 | }
20 |
21 | class _ReceiptState extends State {
22 | User user;
23 |
24 | UserModel userModel;
25 | DatabaseReference userRef;
26 |
27 | final GlobalKey> _printKey = GlobalKey();
28 |
29 | void _printScreen() {
30 | Printing.layoutPdf(onLayout: (PdfPageFormat format) async {
31 | final doc = pw.Document();
32 |
33 | final image = await WidgetWraper.fromKey(key: _printKey);
34 |
35 | doc.addPage(pw.Page(
36 | pageFormat: format,
37 | build: (pw.Context context) {
38 | return pw.Center(
39 | child: pw.Expanded(
40 | child: pw.Image(image),
41 | ),
42 | );
43 | }));
44 |
45 | return doc.save();
46 | });
47 | }
48 |
49 | // Future dateprint() async
50 | // {
51 | // await datetime.selec
52 | // }
53 | // getDate() async{
54 | // await a.selectDate();
55 | // }
56 | _getUserDetails() async {
57 | DataSnapshot snapshot = (await userRef.once());
58 |
59 | userModel = UserModel.fromMap(Map.from(snapshot.value));
60 |
61 | setState(() {});
62 | }
63 | @override
64 | void initState() {
65 | super.initState();
66 |
67 | user = FirebaseAuth.instance.currentUser;
68 | if (user != null) {
69 | userRef =
70 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
71 | }
72 |
73 | _getUserDetails();
74 | }
75 | @override
76 | Widget build(BuildContext context) {
77 | return Scaffold(
78 |
79 | appBar: AppBar(
80 | title: const Text('Receipt'),
81 | backgroundColor: Colors.blueAccent,
82 | ),
83 | body: Center(
84 | child: Column(
85 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
86 | children: [
87 | RepaintBoundary(
88 | key: _printKey,
89 | child: userModel == null
90 | ? const Center(child: CircularProgressIndicator())
91 | :Column(
92 | mainAxisAlignment: MainAxisAlignment.start,
93 | crossAxisAlignment: CrossAxisAlignment.start,
94 | children: [
95 |
96 | SizedBox(
97 | height: 30,
98 | ),
99 | Center(
100 | child: Container(
101 | child: Text(
102 | "APPOINTMENT CONFIRMED",
103 | style: TextStyle(
104 | color: Colors.red,
105 | fontWeight: FontWeight.bold,
106 | fontSize: 25
107 | ),
108 | ),
109 | ),
110 | ),
111 | SizedBox(height: 30,),
112 | Divider(
113 | thickness: 20,
114 | ),
115 | SizedBox(height: 30,),
116 | Row(
117 | children: [
118 | Container(
119 | margin: EdgeInsets.only(left: 10,bottom: 15),
120 | child: Text("Doctor's Name: Doctor 1", style: TextStyle(fontSize: 20),),
121 | ),
122 | ]
123 | ),
124 | FittedBox(
125 | fit: BoxFit.fitWidth,
126 | child: Row(
127 | children: [
128 | Container(
129 | margin: EdgeInsets.only(left: 10,bottom: 15),
130 | child: Text("Patient's name: ",style: TextStyle(fontSize: 20),),
131 | ),
132 | FittedBox(
133 | fit: BoxFit.fitWidth,
134 | child: Container(
135 | margin: EdgeInsets.only(left: 10,bottom: 15),
136 | child: Text(
137 | userModel.fullName,style: TextStyle(fontSize: 20),
138 | ),
139 | ),
140 | ),
141 |
142 | ],
143 | ),
144 | ),
145 | FittedBox(
146 | fit: BoxFit.fitWidth,
147 | child: Row(
148 | children: [
149 | Container( margin: EdgeInsets.only(left: 10,bottom: 15),
150 | child: Text("Patient's Email ID: ",style: TextStyle(fontSize: 20),),
151 | ),
152 | FittedBox( fit: BoxFit.fitWidth,
153 | child: Container(
154 | margin: EdgeInsets.only(left: 10,bottom: 15),
155 | child: Text(
156 | userModel.email,style: TextStyle(fontSize: 20),
157 | ),
158 | ),
159 | ),
160 | ],
161 | ),
162 | ),
163 | // Text(datetime==null?"No date Chosen!":"Date chosen:${DateFormat.yMd().format(selectDate())}",style: TextStyle(fontSize: 20),),
164 |
165 | // Row(
166 | // children: [
167 | //
168 | // ],
169 | // ),
170 | // Row(
171 | // children: [
172 | // Text(a.selectda==null?"No date Chosen!":"Date chosen:${DateFormat.yMd().format(datetime)}",style: TextStyle(fontSize: 20),),
173 | // ],
174 | // ),
175 | Row(
176 | children: [
177 | Container(
178 | margin: EdgeInsets.only(left: 10,bottom: 15),
179 | child: Text("Date of appointment: ",style: TextStyle(fontSize: 20),),
180 | ),
181 | Container(
182 | margin: EdgeInsets.only(left: 10,bottom: 15),
183 | child: Text(
184 | DateFormat.yMMMd().format(DateTime.now()),style: TextStyle(fontSize: 20),
185 | ),
186 | ),
187 | ],
188 | ),
189 | Row(
190 | children: [
191 | Container(
192 | margin: EdgeInsets.only(left: 10,bottom: 15),
193 | child: Text("Time: 8:30 ",style: TextStyle(fontSize: 20),),
194 | ),
195 | ],
196 | ),
197 |
198 | Divider(
199 | thickness: 20,
200 | ),
201 | // Container(
202 | // decoration: BoxDecoration(
203 | // image: DecorationImage(
204 | // image: AssetImage("assets/stamp.png")
205 | // )
206 | // ),
207 | // )
208 | SizedBox(height: 30,),
209 |
210 | ],
211 |
212 |
213 | ),
214 | ),
215 | Column(
216 | mainAxisAlignment: MainAxisAlignment.end,
217 | crossAxisAlignment: CrossAxisAlignment.end,
218 |
219 | children: [Image.asset(
220 |
221 | "assets/stmp.png"
222 | ),
223 | ]
224 | ),
225 | SizedBox(height: 30,),
226 | Divider(
227 | thickness: 20,
228 | ),
229 | ],
230 |
231 | ),
232 | ),
233 | floatingActionButton: FloatingActionButton(
234 | child: const Icon(Icons.print),
235 | onPressed: _printScreen,
236 | ),
237 | );
238 | }
239 | }
240 |
241 |
--------------------------------------------------------------------------------
/lib/login/screens/signup_screen.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:firebase_auth/firebase_auth.dart';
3 | import 'package:firebase_database/firebase_database.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:fluttertoast/fluttertoast.dart';
6 | import 'package:ndialog/ndialog.dart';
7 |
8 | class SignUpScreen extends StatefulWidget {
9 | const SignUpScreen({Key key}) : super(key: key);
10 |
11 | @override
12 | _SignUpScreenState createState() => _SignUpScreenState();
13 | }
14 |
15 | class _SignUpScreenState extends State {
16 | var fullNameController = TextEditingController();
17 | var emailController = TextEditingController();
18 | var passwordController = TextEditingController();
19 | var confirmController = TextEditingController();
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | final double height =
24 | MediaQuery.of(context).size.height - MediaQuery.of(context).padding.top;
25 | return Scaffold(
26 | resizeToAvoidBottomInset: false,
27 | appBar: AppBar(
28 | // title: const Text('Sign Up Please'),
29 | elevation: 0.0,
30 | backgroundColor: Colors.transparent,
31 | iconTheme: IconThemeData( color: Colors. black,)
32 | ),
33 | body: Padding(
34 | padding: const EdgeInsets.all(8.0),
35 | child: Column(
36 | children: [
37 | SizedBox(height: height*0.05),
38 | Container(
39 | // mainAxisAlignment: MainAxisAlignment.start,
40 | // crossAxisAlignment: CrossAxisAlignment.end,
41 |
42 | child:Text("SIGN UP HERE",textAlign: TextAlign.left,style: TextStyle(color: Colors.black,fontSize: 25,fontWeight: FontWeight.bold,),
43 |
44 | ),
45 |
46 | ),
47 | SizedBox(height: height*0.03),
48 | TextField(
49 | controller: fullNameController,
50 |
51 | decoration: const InputDecoration(
52 | border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
53 | hintText: 'FullName',
54 | ),
55 | ),
56 | SizedBox(height: height*0.03),
57 | TextField(
58 | controller: emailController,
59 | decoration: const InputDecoration(
60 |
61 | border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
62 | hintText: 'Email',
63 | ),
64 | ),
65 | SizedBox(height: height*0.03),
66 | TextField(
67 | controller: passwordController,
68 | obscureText: true,
69 | decoration: const InputDecoration(
70 | border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
71 | hintText: 'Password',
72 | ),
73 | ),
74 | SizedBox(height: height*0.03),
75 | TextField(
76 | controller: confirmController,
77 | obscureText: true,
78 | decoration: const InputDecoration(
79 | border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
80 | hintText: 'Confirm Password',
81 | ),
82 | ),
83 | SizedBox(height: height*0.03),
84 | ElevatedButton(
85 | style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.only(left: 50,right: 50,top: 20,
86 | bottom: 20)),shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)))),
87 | onPressed: () async {
88 | var fullName = fullNameController.text.trim();
89 | var email = emailController.text.trim();
90 | var password = passwordController.text.trim();
91 | var confirmPass = confirmController.text.trim();
92 |
93 | if (fullName.isEmpty ||
94 | email.isEmpty ||
95 | password.isEmpty ||
96 | confirmPass.isEmpty) {
97 | // show error toast
98 |
99 | Fluttertoast.showToast(msg: 'Please fill all fields');
100 | return;
101 | }
102 |
103 | if (password.length < 6) {
104 | // show error toast
105 | Fluttertoast.showToast(
106 | msg:
107 | 'Weak Password, at least 6 characters are required');
108 |
109 | return;
110 | }
111 |
112 | if (password != confirmPass) {
113 | // show error toast
114 | Fluttertoast.showToast(msg: 'Passwords do not match');
115 |
116 | return;
117 | }
118 |
119 | // request to firebase auth
120 | //
121 | ProgressDialog progressDialog = ProgressDialog(
122 | context,
123 | title: const Text('Signing Up'),
124 | message: const Text('Please wait'),
125 | );
126 |
127 | progressDialog.show();
128 | try {
129 |
130 |
131 | FirebaseAuth auth = FirebaseAuth.instance;
132 |
133 | UserCredential userCredential =
134 | await auth.createUserWithEmailAndPassword(
135 | email: email, password: password);
136 |
137 | if (userCredential.user != null) {
138 |
139 | // store user information in Realtime database
140 |
141 | DatabaseReference userRef = FirebaseDatabase.instance.reference().child( 'users');
142 |
143 | String uid = userCredential.user.uid;
144 | int dt = DateTime.now().millisecondsSinceEpoch;
145 |
146 | await userRef.child(uid).set({
147 | 'fullName': fullName,
148 | 'email': email,
149 | 'uid': uid,
150 | 'dt': dt,
151 | 'profileImage': ''
152 |
153 | });
154 |
155 |
156 | Fluttertoast.showToast(msg: 'Success');
157 |
158 | Navigator.of(context).pop();
159 | } else {
160 | Fluttertoast.showToast(msg: 'Failed');
161 | }
162 |
163 | progressDialog.dismiss();
164 | // progressDialog.dismiss();
165 |
166 | } on FirebaseAuthException catch (e) {
167 | progressDialog.dismiss();
168 | if (e.code == 'email-already-in-use') {
169 | Fluttertoast.showToast(msg: 'Email is already in Use');
170 | } else if (e.code == 'weak-password') {
171 | Fluttertoast.showToast(msg: 'Password is weak');
172 | }
173 | } catch (e) {
174 | // progressDialog.dismiss();
175 | Fluttertoast.showToast(msg: 'Something went wrong');
176 | }
177 | },
178 | child: const Text('Sign Up')),
179 | const SizedBox(
180 | height: 10,
181 | ),
182 | ],
183 | ),
184 | ),
185 | );
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/lib/pages/about.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'dart:ui';
3 |
4 | import 'package:NewsApp/login/screens/login_screen.dart';
5 | import 'package:NewsApp/login/screens/profile_screen.dart';
6 | import 'package:firebase_auth/firebase_auth.dart';
7 | import 'package:flutter/material.dart';
8 |
9 | import '../Appointment/Appointment.dart';
10 | import '../News/home.dart';
11 | import '../main.dart';
12 |
13 | class AboutPage extends StatefulWidget {
14 |
15 | @override
16 | _AboutPageState createState() => _AboutPageState();
17 | }
18 |
19 | class _AboutPageState extends State {
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: AppBar(
24 | title: Text("About Page"),
25 |
26 | backgroundColor: Colors.blueAccent,
27 | ),
28 | body: SingleChildScrollView(
29 | scrollDirection: Axis.vertical,
30 | child: Column(
31 | children: [
32 | SizedBox(
33 | height: 10,
34 | ),
35 | Card(
36 | shadowColor: Colors.pinkAccent,
37 | elevation: 8,
38 | clipBehavior: Clip.antiAlias,
39 | shape: RoundedRectangleBorder(
40 | borderRadius: BorderRadius.circular(24),
41 | ),
42 | child: Container(
43 | decoration: BoxDecoration(
44 | // color: Color.fromRGBO(232, 190, 172, 1),
45 | gradient: LinearGradient(
46 | colors: [Color.fromRGBO(232, 170, 172, 0.3),Color.fromRGBO(242, 170, 172, 1),],
47 | begin: Alignment.topCenter,
48 | end: Alignment.bottomCenter,
49 | ),
50 | ),
51 |
52 | padding: EdgeInsets.all(16),
53 | child: Row(
54 | crossAxisAlignment:CrossAxisAlignment.end,
55 | children: [
56 |
57 | SizedBox(
58 | width: 350,
59 |
60 | child: Column(
61 |
62 | crossAxisAlignment: CrossAxisAlignment.start,
63 | children: [
64 | Text(
65 | 'About DIAGNO+',
66 | style: TextStyle(
67 | fontSize: 25,
68 | color: Colors.white,
69 | fontWeight: FontWeight.bold,
70 |
71 | ),
72 |
73 | ),
74 | const SizedBox(height: 15),
75 | Text(
76 | "A user login is provided. \nUser can fix an appointment with a doctor by clicking on the given time slot. \nThe receipt will be generated when the appointment is booked \nUsers can also see daily news with the help of the news option.",
77 | style: TextStyle(
78 | fontSize: 18,
79 | color: Colors.black,
80 | ),
81 | ),
82 | ],
83 | ),
84 | ),
85 |
86 | ],
87 | )
88 | )
89 | ),
90 | SizedBox(height: 15),
91 |
92 | Card(
93 | shadowColor: Colors.pinkAccent,
94 | elevation: 8,
95 | clipBehavior: Clip.antiAlias,
96 | shape: RoundedRectangleBorder(
97 | borderRadius: BorderRadius.circular(24),
98 | ),
99 | child: Container(
100 | decoration: BoxDecoration(
101 | gradient: LinearGradient(
102 | colors: [Colors.greenAccent,Colors.limeAccent,Colors.amberAccent],
103 | begin: Alignment.topCenter,
104 | end: Alignment.bottomCenter,
105 | ),
106 | ),
107 |
108 | padding: EdgeInsets.all(16),
109 | child: Row(
110 | crossAxisAlignment:CrossAxisAlignment.end,
111 | children: [
112 |
113 | SizedBox(
114 | width: 350,
115 |
116 | child: Column(
117 |
118 | crossAxisAlignment: CrossAxisAlignment.start,
119 | children: [
120 | Text(
121 | 'About Us',
122 | style: TextStyle(
123 | fontSize: 25,
124 | color: Colors.white,
125 | fontWeight: FontWeight.bold,
126 |
127 | ),
128 |
129 | ),
130 | const SizedBox(height: 15),
131 | Text(
132 | "Diagno+ app is a collaborative project made by second year students for VJTI Inheritance Program 2021.\nTeam Members are:\n1. Soham Chaudhari (CS)\n2. Ritish Zalke (CS)\n3. Nirbhay Nikam (CS)\n4. Chaitanya Deshpande (Mech)"
133 |
134 | , style: TextStyle(
135 | fontSize: 18,
136 | color: Colors.black,
137 | ),
138 | ),
139 | ],
140 | ),
141 | ),
142 |
143 | ],
144 | )
145 | )
146 | ),
147 | ]
148 | ),
149 | ),
150 | drawer: Drawer(
151 | child: ListView(
152 | children: [
153 | // new UserAccountsDrawerHeader(
154 | // accountName: Text('Ritish'),
155 | // accountEmail: Text('ricjjcd@gmail.com'),
156 | // currentAccountPicture: const CircleAvatar(
157 | // backgroundImage: NetworkImage('https://images.squarespace-cdn.com/content/v1/5824673c2e69cfc8ac1e3cd3/1580377764933-1L0AVRF4MU86B18J3S4A/Picture+of+woodlands+taken+on+iphone+using+natural+light'),
158 | // ) ,
159 | // ),
160 |
161 | ListTile(
162 | title: Text("Home"),
163 | onTap: (){
164 | // Navigator.of(context).pop();
165 | Navigator.push(context, MaterialPageRoute(
166 | builder: (BuildContext context)=> MyHomePage(),
167 | ),
168 |
169 | );
170 | },
171 | ),
172 | new Divider(),
173 | ListTile(
174 | title: Text("My Profile"),
175 | onTap: (){
176 | Navigator.of(context).pop();
177 | Navigator.push(context, MaterialPageRoute(
178 | builder: (BuildContext context)=> ProfileScreen()
179 | ),
180 |
181 | );
182 | },
183 | ),
184 | new Divider(),
185 | ListTile(
186 | title: Text("Appointments"),
187 | onTap: (){
188 | Navigator.of(context).pop();
189 | Navigator.push(context, MaterialPageRoute(
190 | builder: (BuildContext context)=> Appointment(),
191 | ),
192 |
193 | );
194 | },
195 | ),
196 | // new Divider(),
197 | // ListTile(
198 | // title: Text("Medicine reminder"),
199 | // onTap: (){
200 | // Navigator.of(context).pop();
201 | // Navigator.push(context, MaterialPageRoute(
202 | // builder: (BuildContext context)=> Reminder(),
203 | // ),
204 | //
205 | // );
206 | // },
207 | // ),
208 | new Divider(),
209 | ListTile(
210 | title: Text("News"),
211 | onTap: (){
212 | Navigator.of(context).pop();
213 | Navigator.push(context, MaterialPageRoute(
214 | builder: (BuildContext context)=> HomePage()
215 | ),
216 |
217 | );
218 | },
219 | ),
220 |
221 |
222 | new Divider(),
223 | ListTile(
224 | title: Text("About Page"),
225 | onTap: (){
226 | Navigator.of(context).pop();
227 | Navigator.push(context, new MaterialPageRoute(
228 | builder: (BuildContext context)=> new AboutPage()
229 | ),
230 |
231 | );
232 | },
233 | ),
234 | new Divider(),
235 | ListTile(
236 | title: Text("Log Out"),
237 | onTap: (){
238 | // Navigator.of(context).pop();
239 | showDialog(context: context, builder: (ctx){
240 | return AlertDialog(
241 | title: Text('Confirmation !!!'),
242 | content: Text('Are you sure to Log Out ? '),
243 | actions: [
244 |
245 | TextButton(onPressed: (){
246 |
247 | Navigator.of(ctx).pop();
248 |
249 | }, child: Text('No'),),
250 |
251 |
252 | TextButton(onPressed: (){
253 | Navigator.of(ctx).pop();
254 |
255 | FirebaseAuth.instance.signOut();
256 |
257 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
258 | return LoginScreen();
259 | }));
260 |
261 | }, child: Text('Yes'),),
262 |
263 | ],
264 | );
265 | }
266 | );
267 | },
268 | ),
269 | ],
270 | ),
271 |
272 |
273 | ),
274 | );
275 | }
276 | }
277 |
--------------------------------------------------------------------------------
/lib/login/screens/profile_screen.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:NewsApp/login/models/user_model.dart';
4 | import 'package:NewsApp/pages/about.dart';
5 |
6 | import 'package:firebase_auth/firebase_auth.dart';
7 | import 'package:firebase_database/firebase_database.dart';
8 | import 'package:firebase_storage/firebase_storage.dart';
9 | import 'package:flutter/cupertino.dart';
10 | import 'package:flutter/material.dart';
11 | import 'package:image_picker/image_picker.dart';
12 | import 'package:intl/intl.dart';
13 | import 'package:ndialog/ndialog.dart';
14 |
15 | import '../../Appointment/Appointment.dart';
16 | import '../../News/home.dart';
17 | import '../../main.dart';
18 | import 'login_screen.dart';
19 |
20 |
21 | class ProfileScreen extends StatefulWidget {
22 | // const ProfileScreen({Key? key}) : super(key: key);
23 |
24 | @override
25 | _ProfileScreenState createState() => _ProfileScreenState();
26 | }
27 |
28 | class _ProfileScreenState extends State {
29 | User user;
30 | UserModel userModel;
31 | DatabaseReference userRef;
32 |
33 | File imageFile;
34 | bool showLocalFile = false;
35 |
36 |
37 | _getUserDetails() async {
38 | DataSnapshot snapshot = (await userRef.once());
39 |
40 | userModel = UserModel.fromMap(Map.from(snapshot.value));
41 |
42 | setState(() {});
43 | }
44 |
45 | _pickImageFromGallery() async {
46 |
47 | XFile xFile = await ImagePicker().pickImage(source: ImageSource.gallery);
48 |
49 | if( xFile == null ) return;
50 |
51 | final tempImage = File(xFile.path);
52 |
53 | imageFile = tempImage;
54 | showLocalFile = true;
55 | setState(() {
56 |
57 | });
58 |
59 | // upload to firebase storage
60 |
61 |
62 | ProgressDialog progressDialog = ProgressDialog(
63 | context,
64 | title: const Text('Uploading !!!'),
65 | message: const Text('Please wait'),
66 | );
67 | progressDialog.show();
68 | try{
69 | var fileName = userModel.email + '.jpg';
70 |
71 | UploadTask uploadTask = FirebaseStorage.instance.ref().child('profileImage').child(fileName).putFile(imageFile);
72 |
73 | TaskSnapshot snapshot = await uploadTask;
74 |
75 | String profileImageUrl = await snapshot.ref.getDownloadURL();
76 |
77 | print(profileImageUrl);
78 |
79 | progressDialog.dismiss();
80 |
81 | } catch( e ){
82 | progressDialog.dismiss();
83 |
84 | print(e.toString());
85 | }
86 |
87 |
88 | }
89 |
90 | _pickImageFromCamera() async {
91 | XFile xFile = await ImagePicker().pickImage(source: ImageSource.camera);
92 |
93 | if( xFile == null ) return;
94 |
95 | final tempImage = File(xFile.path);
96 |
97 | imageFile = tempImage;
98 | showLocalFile = true;
99 | setState(() {
100 |
101 | });
102 | }
103 |
104 | @override
105 | void initState() {
106 | super.initState();
107 |
108 | user = FirebaseAuth.instance.currentUser;
109 | if (user != null) {
110 | userRef =
111 | FirebaseDatabase.instance.reference().child('users').child(user.uid);
112 | }
113 |
114 | _getUserDetails();
115 | }
116 |
117 | @override
118 | Widget build(BuildContext context) {
119 | return Scaffold(
120 | appBar: AppBar(
121 | title: const Text('Profile'),
122 | backgroundColor: Colors.blueAccent,
123 | ),
124 | body: userModel == null
125 | ? const Center(child: CircularProgressIndicator())
126 | : Padding(
127 | padding: EdgeInsets.all(10.0),
128 | child: Column(
129 | mainAxisAlignment: MainAxisAlignment.start,
130 | crossAxisAlignment: CrossAxisAlignment.start,
131 | children: [
132 | Padding(
133 | padding: EdgeInsets.only(top: 10, left: MediaQuery.of(context).size.width*0.25),
134 | child: Row(
135 | children: [
136 | CircleAvatar(
137 | radius: 80,
138 | backgroundImage: showLocalFile ?
139 |
140 | FileImage(imageFile) as ImageProvider
141 | :
142 |
143 | userModel.profileImage == ''
144 | ? const NetworkImage(
145 | 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQGrQoGh518HulzrSYOTee8UO517D_j6h4AYQ&usqp=CAU')
146 | : NetworkImage(userModel.profileImage)),
147 |
148 | IconButton(icon: const Icon(Icons.camera_alt), onPressed: (){
149 |
150 | showModalBottomSheet(context: context, builder: (context){
151 | return
152 | Padding(
153 | padding: const EdgeInsets.all(10),
154 | child: Column(
155 | mainAxisSize: MainAxisSize.min,
156 | children: [
157 | ListTile(
158 | leading: const Icon(Icons.image),
159 | title: const Text('From Gallery'),
160 | onTap: (){
161 | _pickImageFromGallery();
162 | Navigator.of(context).pop();
163 | },
164 | ),
165 | ListTile(
166 | leading: const Icon(Icons.camera_alt),
167 | title: const Text('From Camera'),
168 | onTap: (){
169 |
170 | _pickImageFromCamera();
171 | Navigator.of(context).pop();
172 |
173 | },
174 | ),
175 | ],
176 | ),
177 | );
178 | });
179 |
180 | },),
181 | ],
182 |
183 |
184 | ),
185 | ),
186 | SizedBox(
187 | height: 30,
188 | ),
189 | Padding(
190 | padding: const EdgeInsets.all(0.0),
191 |
192 | child: Padding(
193 | padding: const EdgeInsets.all(0.0),
194 | child: Column(
195 |
196 | mainAxisAlignment: MainAxisAlignment.start,
197 | crossAxisAlignment: CrossAxisAlignment.start,
198 | children: [
199 | Text(
200 | "Name",
201 | style: const TextStyle(fontSize: 18),
202 | ),
203 | SizedBox(
204 | height: 10,
205 | ),
206 | SingleChildScrollView(
207 | child: Container(
208 | width: double.infinity,
209 | padding: EdgeInsets.only(top: 10,bottom: 10,left: 6,),
210 | decoration: BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: Colors.blue,width: 5), borderRadius: BorderRadius.circular(10)),
211 |
212 | child: Row(
213 | children: [
214 | Text(
215 | userModel.fullName,
216 | style: const TextStyle(fontSize: 18),
217 | ),
218 | ],
219 | ),
220 | ),
221 | ),
222 | SizedBox(
223 | height: 20,
224 | ),
225 | Text(
226 | "Email",
227 | style: const TextStyle(fontSize: 18),
228 | ),
229 | SizedBox(
230 | height: 10,
231 | ),
232 | Container(
233 | width:double.infinity,
234 | padding: EdgeInsets.only(top: 10,bottom: 10,left: 6,),
235 | decoration: BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: Colors.blue,width: 5), borderRadius: BorderRadius.circular(10)),
236 |
237 | child: Text(
238 | userModel.email,
239 | style: const TextStyle(fontSize: 18),
240 | ),
241 | ),
242 | SizedBox(
243 | height: 20,
244 | ),
245 | Text(
246 | "Date of Joining",
247 | style: const TextStyle(fontSize: 18),
248 | ),
249 | SizedBox(
250 | height: 10,
251 | ),
252 | Container(
253 | width: double.infinity,
254 | // margin: EdgeInsets.only(right: 100),
255 | padding: EdgeInsets.only(top: 10,bottom: 10,left: 6,),
256 | decoration: BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: Colors.blue,width: 5), borderRadius: BorderRadius.circular(10)),
257 |
258 | child: Text(
259 | 'Joined ${getHumanReadableDate(userModel.dt)}',
260 | style: const TextStyle(fontSize: 18),
261 | ),
262 | ),
263 | ],
264 | ),
265 | ),
266 | ),
267 |
268 | ],
269 | ),
270 | ),
271 | drawer: Drawer(
272 | child: ListView(
273 | children: [
274 | // new UserAccountsDrawerHeader(
275 | // accountName: Text('Ritish'),
276 | // accountEmail: Text('ricjjcd@gmail.com'),
277 | // currentAccountPicture: const CircleAvatar(
278 | // backgroundImage: NetworkImage('https://images.squarespace-cdn.com/content/v1/5824673c2e69cfc8ac1e3cd3/1580377764933-1L0AVRF4MU86B18J3S4A/Picture+of+woodlands+taken+on+iphone+using+natural+light'),
279 | // ) ,
280 | // ),
281 |
282 | ListTile(
283 | title: Text("Home"),
284 | onTap: (){
285 | // Navigator.of(context).pop();
286 | Navigator.push(context, MaterialPageRoute(
287 | builder: (BuildContext context)=> MyHomePage(),
288 | ),
289 |
290 | );
291 | },
292 | ),
293 | new Divider(),
294 | ListTile(
295 | title: Text("My Profile"),
296 | onTap: (){
297 | Navigator.of(context).pop();
298 | Navigator.push(context, MaterialPageRoute(
299 | builder: (BuildContext context)=> ProfileScreen()
300 | ),
301 |
302 | );
303 | },
304 | ),
305 | new Divider(),
306 | ListTile(
307 | title: Text("Appointments"),
308 | onTap: (){
309 | Navigator.of(context).pop();
310 | Navigator.push(context, MaterialPageRoute(
311 | builder: (BuildContext context)=> Appointment(),
312 | ),
313 |
314 | );
315 | },
316 | ),
317 | // new Divider(),
318 | // ListTile(
319 | // title: Text("Medicine reminder"),
320 | // onTap: (){
321 | // Navigator.of(context).pop();
322 | // Navigator.push(context, MaterialPageRoute(
323 | // builder: (BuildContext context)=> Reminder(),
324 | // ),
325 | //
326 | // );
327 | // },
328 | // ),
329 | new Divider(),
330 | ListTile(
331 | title: Text("News"),
332 | onTap: (){
333 | Navigator.of(context).pop();
334 | Navigator.push(context, MaterialPageRoute(
335 | builder: (BuildContext context)=> HomePage()
336 | ),
337 |
338 | );
339 | },
340 | ),
341 |
342 |
343 | new Divider(),
344 | ListTile(
345 | title: Text("About Page"),
346 | onTap: (){
347 | Navigator.of(context).pop();
348 | Navigator.push(context, new MaterialPageRoute(
349 | builder: (BuildContext context)=> AboutPage()
350 | ),
351 |
352 | );
353 | },
354 | ),
355 | new Divider(),
356 | ListTile(
357 | title: Text("Log Out"),
358 | onTap: (){
359 | // Navigator.of(context).pop();
360 | showDialog(context: context, builder: (ctx){
361 | return AlertDialog(
362 | title: Text('Confirmation !!!'),
363 | content: Text('Are you sure to Log Out ? '),
364 | actions: [
365 |
366 | TextButton(onPressed: (){
367 |
368 | Navigator.of(ctx).pop();
369 |
370 | }, child: Text('No'),),
371 |
372 |
373 | TextButton(onPressed: (){
374 | Navigator.of(ctx).pop();
375 |
376 | FirebaseAuth.instance.signOut();
377 |
378 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
379 | return LoginScreen();
380 | }));
381 |
382 | }, child: Text('Yes'),),
383 |
384 | ],
385 | );
386 | }
387 | );
388 | },
389 | ),
390 | ],
391 | ),
392 |
393 |
394 | ),
395 | );
396 | }
397 |
398 | String getHumanReadableDate(int dt) {
399 | DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(dt);
400 |
401 | return DateFormat('dd MMM yyyy').format(dateTime);
402 | }
403 | }
404 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:NewsApp/Appointment/Appointment.dart';
3 |
4 | import 'package:NewsApp/login/screens/profile_screen.dart';
5 | import 'package:NewsApp/pages/about.dart';
6 | import 'package:NewsApp/pages/splash.dart';
7 |
8 | import 'package:NewsApp/styles/utisl.dart';
9 | import 'package:firebase_auth/firebase_auth.dart';
10 | import 'package:firebase_core/firebase_core.dart';
11 |
12 | import 'package:flutter/cupertino.dart';
13 | import 'package:flutter/material.dart';
14 | import 'package:flutter/widgets.dart';
15 |
16 |
17 | import 'styles/color_filters.dart';
18 | import 'News/home.dart';
19 |
20 | import 'login/screens/login_screen.dart';
21 | import 'styles/moods.dart';
22 |
23 |
24 |
25 | void main() async {
26 | WidgetsFlutterBinding.ensureInitialized();
27 | await Firebase.initializeApp();
28 | runApp(new MyApp());
29 |
30 | }
31 |
32 | class MyApp extends StatelessWidget {
33 |
34 |
35 | // This widget is the root of your application.
36 | @override
37 | Widget build(BuildContext context) {
38 | return MaterialApp(
39 | title: 'Flutter Demo',
40 | debugShowCheckedModeBanner: false,
41 | home:Splash()
42 | );
43 | }
44 | }
45 |
46 | class MyHomePage extends StatefulWidget {
47 | @override
48 | State createState() => _MyHomePageState();
49 | }
50 |
51 | class _MyHomePageState extends State {
52 |
53 |
54 | @override
55 | Widget build(BuildContext context) {
56 |
57 | // User user;
58 | // DatabaseReference taskRef;
59 | // void initState() {
60 | //
61 | // user = FirebaseAuth.instance.currentUser;
62 | // if( user != null )
63 | // {
64 | // var user;
65 | // taskRef = FirebaseDatabase.instance.reference().child('tasks').child(user.uid);
66 | // }
67 | // super.initState();
68 | // }
69 | return Scaffold(
70 | appBar: AppBar(
71 | title: Text('DIAGNO+',textAlign: TextAlign.center,),
72 | elevation: 0.0,
73 |
74 | backgroundColor: Colors.blue ,
75 | ),
76 | backgroundColor: mainBgColor,
77 | body: SingleChildScrollView(
78 | child: Column(
79 | mainAxisAlignment: MainAxisAlignment.start,
80 | children: [
81 | Stack(
82 | clipBehavior: Clip.none, alignment: AlignmentDirectional.topCenter,
83 | children: [
84 | _backBgCover(),
85 | _greetings(),
86 | _moodsHolder(),
87 | ],
88 | ),
89 | SizedBox(
90 | height: 50.0,
91 | ),
92 | SingleChildScrollView(
93 | scrollDirection: Axis.vertical,
94 | child: Padding(
95 | padding: EdgeInsets.all(20),
96 | child: Column(
97 | mainAxisAlignment: MainAxisAlignment.start,
98 | children: [
99 |
100 | buildAppointmentCard(),
101 | SizedBox(
102 | height: 20,
103 | ),
104 | // Reminder(),
105 | // SizedBox(
106 | // height: 20,
107 | // ),
108 |
109 | buildNewsCard(),
110 | // buildImageCard(),
111 | //_specialistsCardInfo(),
112 | ],
113 | ),
114 | ),
115 | ),
116 | ],
117 | ),
118 |
119 | ),
120 | drawer: Drawer(
121 | child: ListView(
122 | children: [
123 | // new UserAccountsDrawerHeader(
124 | // accountName: Text('Ritish'),
125 | // accountEmail: Text('ricjjcd@gmail.com'),
126 | // currentAccountPicture: const CircleAvatar(
127 | // backgroundImage: NetworkImage('https://images.squarespace-cdn.com/content/v1/5824673c2e69cfc8ac1e3cd3/1580377764933-1L0AVRF4MU86B18J3S4A/Picture+of+woodlands+taken+on+iphone+using+natural+light'),
128 | // ) ,
129 | // ),
130 |
131 | ListTile(
132 | title: Text("Home"),
133 | onTap: (){
134 | // Navigator.of(context).pop();
135 | Navigator.push(context, MaterialPageRoute(
136 | builder: (BuildContext context)=> MyHomePage(),
137 | ),
138 |
139 | );
140 | },
141 | ),
142 | new Divider(),
143 | ListTile(
144 | title: Text("My Profile"),
145 | onTap: (){
146 | Navigator.of(context).pop();
147 | Navigator.push(context, MaterialPageRoute(
148 | builder: (BuildContext context)=> ProfileScreen()
149 | ),
150 |
151 | );
152 | },
153 | ),
154 | new Divider(),
155 | ListTile(
156 | title: Text("Appointments"),
157 | onTap: (){
158 | Navigator.of(context).pop();
159 | Navigator.push(context, MaterialPageRoute(
160 | builder: (BuildContext context)=> Appointment(),
161 | ),
162 |
163 | );
164 | },
165 | ),
166 | // new Divider(),
167 | // ListTile(
168 | // title: Text("Medicine reminder"),
169 | // onTap: (){
170 | // Navigator.of(context).pop();
171 | // Navigator.push(context, MaterialPageRoute(
172 | // builder: (BuildContext context)=> Reminder(),
173 | // ),
174 | //
175 | // );
176 | // },
177 | // ),
178 | new Divider(),
179 | ListTile(
180 | title: Text("News"),
181 | onTap: (){
182 | Navigator.of(context).pop();
183 | Navigator.push(context, MaterialPageRoute(
184 | builder: (BuildContext context)=> HomePage()
185 | ),
186 |
187 | );
188 | },
189 | ),
190 |
191 |
192 | new Divider(),
193 | ListTile(
194 | title: Text("About Page"),
195 | onTap: (){
196 | Navigator.of(context).pop();
197 | Navigator.push(context, new MaterialPageRoute(
198 | builder: (BuildContext context)=> new AboutPage()
199 | ),
200 |
201 | );
202 | },
203 | ),
204 | new Divider(),
205 | ListTile(
206 | title: Text("Log Out"),
207 | onTap: (){
208 | // Navigator.of(context).pop();
209 | showDialog(context: context, builder: (ctx){
210 | return AlertDialog(
211 | title: Text('Confirmation !!!'),
212 | content: Text('Are you sure to Log Out ? '),
213 | actions: [
214 |
215 | TextButton(onPressed: (){
216 |
217 | Navigator.of(ctx).pop();
218 |
219 | }, child: Text('No'),),
220 |
221 |
222 | TextButton(onPressed: (){
223 | Navigator.of(ctx).pop();
224 |
225 | FirebaseAuth.instance.signOut();
226 |
227 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
228 | return LoginScreen();
229 | }));
230 |
231 | }, child: Text('Yes'),),
232 |
233 | ],
234 | );
235 | }
236 | );
237 | },
238 | ),
239 | ],
240 | ),
241 |
242 |
243 | ),
244 |
245 | );
246 |
247 | }
248 | Widget buildNewsCard() => GestureDetector(
249 | onTap: () {
250 | // Navigator.of(context).pop();
251 | Navigator.push(context, MaterialPageRoute(
252 | builder: (BuildContext context)=> HomePage()),
253 | );
254 |
255 | },
256 |
257 | child: Card(
258 | shadowColor: Colors.green,
259 | elevation: 8,
260 | clipBehavior: Clip.antiAlias,
261 | shape: RoundedRectangleBorder(
262 | borderRadius: BorderRadius.circular(24),
263 | ),
264 | child: Container(
265 | decoration: BoxDecoration(
266 | gradient: LinearGradient(
267 | colors: [Colors.lightGreen, Colors.green],
268 | begin: Alignment.topCenter,
269 | end: Alignment.bottomCenter,
270 | ),
271 | ),
272 |
273 | padding: EdgeInsets.all(16),
274 | child: Row(
275 | crossAxisAlignment:CrossAxisAlignment.end,
276 | children: [
277 |
278 | SizedBox(
279 | width: MediaQuery.of(context).size.width*0.60,
280 |
281 | child: Column(
282 |
283 | crossAxisAlignment: CrossAxisAlignment.start,
284 | children: [
285 | Text(
286 | 'Medical News',
287 | style: TextStyle(
288 | fontSize: 20,
289 | color: Colors.white,
290 | fontWeight: FontWeight.bold,
291 |
292 | ),
293 |
294 | ),
295 | const SizedBox(height: 20),
296 | Text(
297 | 'Check the latest news in the world of medicine!',
298 | style: TextStyle(
299 | fontSize: 14,
300 | color: Colors.white,
301 | ),
302 | ),
303 | ],
304 | ),
305 | ),
306 |
307 | SizedBox(
308 | width: MediaQuery.of(context).size.width*0.15,
309 |
310 |
311 | child: Icon(Icons.keyboard_arrow_right,size: 60 ,color: Color.fromRGBO(0, 0, 0, 0.6),),
312 |
313 | ),
314 | ],
315 | ),
316 | ),
317 |
318 | ),
319 | );
320 | Positioned _moodsHolder() {
321 |
322 | return Positioned(
323 | bottom: -45,
324 | child: Container(
325 | height: 100.0,
326 | width: MediaQuery.of(context).size.width - 40,
327 | padding: EdgeInsets.all(10),
328 | decoration: BoxDecoration(
329 | color: Colors.white,
330 | borderRadius: BorderRadius.all(Radius.circular(28)),
331 | boxShadow: [
332 | BoxShadow(
333 | color: Colors.black12,
334 | spreadRadius: 5.5,
335 | blurRadius: 5.5,
336 | )
337 | ]),
338 | child:MoodsSelector(),
339 | ),
340 | );
341 | }
342 | Container _backBgCover() {
343 | return Container(
344 | height: 220.0,
345 | decoration: BoxDecoration(
346 | color: Colors.blue,
347 | borderRadius: BorderRadius.only(
348 | bottomLeft: Radius.circular(40),
349 | bottomRight: Radius.circular(40),
350 | ),
351 | ),
352 | );
353 | }
354 | Positioned _greetings() {
355 | return Positioned(
356 | left: 20,
357 | bottom: 90,
358 | top: 20,
359 | child: Column(
360 | mainAxisAlignment: MainAxisAlignment.start,
361 | crossAxisAlignment: CrossAxisAlignment.start,
362 | children: [
363 | Text(
364 | 'HELLO!',
365 | style: TextStyle(
366 | fontSize: 36,
367 | fontWeight: FontWeight.w500,
368 | color: Colors.white,
369 | ),
370 | ),
371 | SizedBox(
372 | height: 10,
373 | ),
374 | Text(
375 | 'How are you feeling today ?',
376 | style: TextStyle(
377 | fontSize: 20,
378 | fontWeight: FontWeight.w300,
379 | color: Colors.white,
380 | ),
381 | ),
382 | ],
383 | ),
384 | );
385 | }
386 | // Widget buildSymptomsCard() => GestureDetector(
387 | //
388 | // onTap: () {
389 | // // Navigator.of(context).pop();
390 | // Navigator.push(context, MaterialPageRoute(
391 | // builder: (BuildContext context)=> Symptoms()),
392 | // );
393 | //
394 | // },
395 | //
396 | // child: Card(
397 | //
398 | // shadowColor: Colors.red,
399 | // elevation: 8,
400 | // clipBehavior: Clip.antiAlias,
401 | // shape: RoundedRectangleBorder(
402 | // borderRadius: BorderRadius.circular(24),
403 | // ),
404 | // child: Container(
405 | // width: MediaQuery.of(context).size.width ,
406 | // decoration: BoxDecoration(
407 | // gradient: LinearGradient(
408 | // colors: [Colors.yellow, Colors.orange],
409 | // begin: Alignment.topCenter,
410 | // end: Alignment.bottomCenter,
411 | // ),
412 | // ),
413 | //
414 | // padding: EdgeInsets.all(16),
415 | // child: Row(
416 | // crossAxisAlignment:CrossAxisAlignment.end,
417 | // children: [
418 | //
419 | // SizedBox(
420 | // width: 250,
421 | //
422 | // child: Column(
423 | //
424 | // crossAxisAlignment: CrossAxisAlignment.start,
425 | // children: [
426 | // Text(
427 | // 'Check your Symptoms',
428 | // style: TextStyle(
429 | // fontSize: 20,
430 | // color: Colors.white,
431 | // fontWeight: FontWeight.bold,
432 | //
433 | // ),
434 | //
435 | // ),
436 | // const SizedBox(height: 20),
437 | // Text(
438 | // 'Select the symptoms you have and know what possibly you are diagnosed with',
439 | // style: TextStyle(
440 | // fontSize: 14,
441 | // color: Colors.white,
442 | // ),
443 | // ),
444 | // ],
445 | // ),
446 | // ),
447 | //
448 | // SizedBox(
449 | // width: 81,
450 | //
451 | //
452 | // child: Icon(Icons.keyboard_arrow_right,size: 60 ,color: Color.fromRGBO(0, 0, 0, 0.6),),
453 | //
454 | // ),
455 | // ],
456 | // ),
457 | // ),
458 | //
459 | // ),
460 | // );
461 | Widget buildAppointmentCard() => GestureDetector(
462 |
463 | onTap: () {
464 | // Navigator.of(context).pop();
465 | Navigator.push(context, MaterialPageRoute(
466 | builder: (BuildContext context)=> Appointment()),
467 | );
468 |
469 | },
470 |
471 | child: Card(
472 |
473 | shadowColor: Colors.red,
474 | elevation: 8,
475 | clipBehavior: Clip.antiAlias,
476 | shape: RoundedRectangleBorder(
477 | borderRadius: BorderRadius.circular(24),
478 | ),
479 | child: Container(
480 | width: MediaQuery.of(context).size.width ,
481 | decoration: BoxDecoration(
482 | gradient: LinearGradient(
483 | colors: [Colors.redAccent, Colors.red],
484 | begin: Alignment.topCenter,
485 | end: Alignment.bottomCenter,
486 | ),
487 | ),
488 |
489 | padding: EdgeInsets.all(16),
490 | child: Row(
491 | crossAxisAlignment:CrossAxisAlignment.end,
492 | children: [
493 |
494 | SizedBox(
495 | width: MediaQuery.of(context).size.width*0.60,
496 |
497 | child: Column(
498 |
499 | crossAxisAlignment: CrossAxisAlignment.start,
500 | children: [
501 | Text(
502 | 'Book an appointment',
503 | style: TextStyle(
504 | fontSize: 20,
505 | color: Colors.white,
506 | fontWeight: FontWeight.bold,
507 |
508 | ),
509 |
510 | ),
511 | const SizedBox(height: 20),
512 | Text(
513 | 'Check the list of various doctors and fix an appointment with Them!',
514 | style: TextStyle(
515 | fontSize: 14,
516 | color: Colors.white,
517 | ),
518 | ),
519 | ],
520 | ),
521 | ),
522 |
523 | SizedBox(
524 | width: MediaQuery.of(context).size.width*0.15,
525 |
526 |
527 | child: Icon(Icons.keyboard_arrow_right,size: 60 ,color: Color.fromRGBO(0, 0, 0, 0.6),),
528 |
529 | ),
530 | ],
531 | ),
532 | ),
533 |
534 | ),
535 | );
536 |
537 |
538 | void sendRequest(String path) {}
539 | }
540 |
541 |
542 |
543 |
544 | Widget buildImageCard() => Card(
545 |
546 | clipBehavior: Clip.antiAlias,
547 | shape: RoundedRectangleBorder(
548 | borderRadius: BorderRadius.circular(24),
549 | ),
550 |
551 | child: Stack(
552 | alignment: Alignment.center,
553 | children: [
554 | Ink.image(
555 | image: NetworkImage(
556 | 'https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1327&q=80',
557 | ),
558 | colorFilter: ColorFilters.greyscale,
559 | child: InkWell(
560 | onTap: () {},
561 | ),
562 | height: 240,
563 | fit: BoxFit.cover,
564 | ),
565 | Text(
566 | 'Card With Splash',
567 | style: TextStyle(
568 | fontWeight: FontWeight.bold,
569 | color: Colors.white,
570 | fontSize: 24,
571 | ),
572 | ),
573 | ],
574 | ),
575 |
576 | );
577 | // Widget _Rock(){
578 | // Container(
579 | // child: Column(
580 | // mainAxisAlignment: MainAxisAlignment.center,
581 | // crossAxisAlignment: CrossAxisAlignment.center,
582 | // ),
583 | // );
584 | // }
--------------------------------------------------------------------------------
/lib/Appointment/doctor_details_page1.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 | import 'package:NewsApp/Appointment/Receipt8.dart';
3 | import 'package:NewsApp/Appointment/receipt.dart';
4 | import 'package:NewsApp/Appointment/receipt1.dart';
5 | import 'package:NewsApp/Appointment/receipt2.dart';
6 | import 'package:NewsApp/Appointment/receipt3.dart';
7 | import 'package:NewsApp/Appointment/receipt7.dart';
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter/rendering.dart';
10 |
11 | class DoctorDetail1Page extends StatefulWidget {
12 | @override
13 | State createState() => _DoctorDetail1State();
14 | }
15 |
16 | class _DoctorDetail1State extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return initWidget(context);
20 | }
21 |
22 | Widget initWidget(BuildContext context) {
23 | return Scaffold(
24 | appBar: AppBar(
25 | elevation: 0.0,
26 | backgroundColor: Colors.blue,
27 | centerTitle: true,
28 | leading: GestureDetector(
29 | onTap: () {
30 | Navigator.pop(context);
31 | },
32 | child: Icon(
33 | Icons.arrow_back,
34 | color: Colors.white,
35 | ),
36 | ),
37 | // actions: [
38 | // GestureDetector(
39 | // child: Container(
40 | // margin: EdgeInsets.only(right: 15),
41 | // child: Icon(
42 | // Icons.notifications_rounded,
43 | // color: Colors.white,
44 | // ),
45 | // ),
46 | // ),
47 | // ],
48 | ),
49 | body: SingleChildScrollView(
50 | child: Column(
51 | crossAxisAlignment: CrossAxisAlignment.start,
52 | children: [
53 | Container(
54 | height: 200,
55 | decoration: BoxDecoration(
56 | color: Colors.blue,
57 | borderRadius: BorderRadius.only(bottomLeft: Radius.circular(30), bottomRight: Radius.circular(30))
58 | ),
59 | child: Container(
60 | margin: EdgeInsets.only(left: 30, bottom: 30),
61 | child: Row(
62 | children: [
63 | /*Container(
64 | margin: EdgeInsets.only(bottom: 20),
65 | child: Image.asset(
66 | "assets/dr_details.png",
67 | ),
68 | ),*/
69 | Container(
70 | margin: EdgeInsets.only(left: 20),
71 | child: Column(
72 | mainAxisAlignment: MainAxisAlignment.start,
73 | crossAxisAlignment: CrossAxisAlignment.start,
74 | children: [
75 | Container(
76 | margin: EdgeInsets.only(top: 30),
77 | child: Text('Dr. Doctor 2',
78 | style: TextStyle(
79 | color: Colors.white,
80 | fontSize: 22,
81 | fontFamily: 'Roboto',
82 | fontWeight: FontWeight.w700,
83 | ),
84 | ),
85 | ),
86 | Container(
87 | margin: EdgeInsets.only(top: 10),
88 | child: Text('About',
89 | style: TextStyle(
90 | color: Colors.white,
91 | fontSize: 15,
92 | fontFamily: 'Roboto',
93 | fontWeight: FontWeight.w300,
94 | ),
95 | ),
96 | ),
97 | Container(
98 | margin: EdgeInsets.only(top: 15),
99 | child: Text('Rating: 4.6',
100 | style: TextStyle(
101 | color: Colors.yellow,
102 | fontSize: 15,
103 | fontFamily: 'Roboto',
104 | fontWeight: FontWeight.bold,
105 | ),
106 | ),
107 | ),
108 | ],
109 | ),
110 | )
111 | ],
112 | ),
113 | ),
114 | ),
115 | /*Container(
116 | margin: EdgeInsets.only(left: 20, top: 30),
117 | child: Text('November 2021',
118 | style: TextStyle(
119 | color: Color(0xff363636),
120 | fontSize: 25,
121 | fontFamily: 'Roboto',
122 | fontWeight: FontWeight.w700,
123 | ),
124 | ),
125 | ),
126 | Container(
127 | margin: EdgeInsets.only(left: 20, top: 20, right: 20),
128 | height: 90,
129 | child: ListView(
130 | scrollDirection: Axis.horizontal,
131 | children: [
132 | demoDates("Mon", "22", false),
133 | demoDates("Tue", "23", false),
134 | demoDates("Wed", "24", false),
135 | demoDates("Thur", "25", false),
136 | demoDates("Fri", "26", false),
137 | demoDates("Sat", "27", false),
138 | demoDates("Sun", "28", false),
139 | demoDates("Mon", "29", false),
140 | ],
141 | ),
142 | ),*/
143 | Container(
144 | margin: EdgeInsets.only(left: 20, top: 30),
145 | child: Text('Available Slots\n\nMorning\n',
146 | style: TextStyle(
147 | color: Color(0xff363636),
148 | fontSize: 25,
149 | fontFamily: 'Roboto',
150 | fontWeight: FontWeight.w700,
151 | ),
152 | ),
153 | ),
154 | Container(
155 | margin: EdgeInsets.only(right: 20),
156 | child: GridView.count(
157 | shrinkWrap: true,
158 | crossAxisCount: 3,
159 | physics: NeverScrollableScrollPhysics(),
160 | childAspectRatio: 2.7,
161 | children: [
162 |
163 | TextButton(onPressed:()=>{
164 | // Navigator.of(context).pop();
165 | showDialog(context: context, builder: (ctx){
166 | return AlertDialog(
167 | title: Text('Confirmation !!!'),
168 | content: Text('Are you sure to confirm the appointment ? '),
169 | actions: [
170 |
171 | TextButton(onPressed: (){
172 |
173 | Navigator.of(ctx).pop();
174 |
175 | }, child: Text('No'),),
176 |
177 |
178 | TextButton(onPressed: (){
179 |
180 |
181 |
182 |
183 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
184 | return Receipt3();
185 | }));
186 |
187 | }, child: Text('Yes'),),
188 |
189 | ],
190 | );
191 | }
192 | ),
193 | }, child: Text("8:00")),
194 | // SizedBox(
195 | // width: 9,
196 | // ),
197 | TextButton(onPressed:()=>{
198 | // Navigator.of(context).pop();
199 | showDialog(context: context, builder: (ctx){
200 | return AlertDialog(
201 | title: Text('Confirmation !!!'),
202 | content: Text('Are you sure to confirm the appointment ? '),
203 | actions: [
204 |
205 | TextButton(onPressed: (){
206 |
207 | Navigator.of(ctx).pop();
208 |
209 | }, child: Text('No'),),
210 |
211 |
212 | TextButton(onPressed: (){
213 |
214 |
215 |
216 |
217 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
218 | return Receipt2();
219 | }));
220 |
221 | }, child: Text('Yes'),),
222 |
223 | ],
224 | );
225 | }
226 | ),
227 | }, child: Text("9:30"))
228 |
229 | //doctorTimingsData("9:30 AM", false),
230 | //doctorTimingsData("10:00 AM", false),
231 | //doctorTimingsData("10:30 AM", false),
232 | // doctorTimingsData("11:00 AM", false),
233 | ],
234 | ),
235 | ),
236 | Container(
237 | margin: EdgeInsets.only(left: 25, top: 30),
238 | child: Text('\nEvening\n',
239 | style: TextStyle(
240 | color: Color(0xff363636),
241 | fontSize: 25,
242 | fontFamily: 'Roboto',
243 | fontWeight: FontWeight.w700,
244 | ),
245 | ),
246 | ),
247 | Container(
248 | margin: EdgeInsets.only(right: 20),
249 | child: GridView.count(
250 | shrinkWrap: true,
251 | crossAxisCount: 3,
252 | physics: NeverScrollableScrollPhysics(),
253 | childAspectRatio: 2.6,
254 | children: [
255 | TextButton(onPressed:()=>{
256 | // Navigator.of(context).pop();
257 | showDialog(context: context, builder: (ctx){
258 | return AlertDialog(
259 | title: Text('Confirmation !!!'),
260 | content: Text('Are you sure to confirm the appointment? '),
261 | actions: [
262 |
263 | TextButton(onPressed: (){
264 |
265 | Navigator.of(ctx).pop();
266 |
267 | }, child: Text('No'),),
268 |
269 |
270 | TextButton(onPressed: (){
271 |
272 |
273 |
274 |
275 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
276 | return Receipt3();
277 | }));
278 |
279 | }, child: Text('Yes'),),
280 |
281 | ],
282 | );
283 | }
284 | ),
285 | }, child: Text("8:00")),
286 | // SizedBox(
287 | // width: 9,
288 | // ),
289 | TextButton(onPressed:()=>{
290 | // Navigator.of(context).pop();
291 | showDialog(context: context, builder: (ctx){
292 | return AlertDialog(
293 | title: Text('Confirmation !!!'),
294 | content: Text('Are you sure to confirm the appointment ? '),
295 | actions: [
296 |
297 | TextButton(onPressed: (){
298 |
299 | Navigator.of(ctx).pop();
300 |
301 | }, child: Text('No'),),
302 |
303 |
304 | TextButton(onPressed: (){
305 |
306 |
307 |
308 |
309 | Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
310 | return Receipt2();
311 | }));
312 |
313 | }, child: Text('Yes'),),
314 |
315 | ],
316 | );
317 | }
318 | ),
319 | }, child: Text("9:30"))
320 |
321 | //doctorTimingsData("8:00 PM", false),
322 | //doctorTimingsData("8:30 PM", false),
323 | //doctorTimingsData("9:00 PM", false),
324 | ],
325 | ),
326 | ),
327 | Container(
328 | alignment: Alignment.center,
329 | width: MediaQuery.of(context).size.width,
330 | height: 54,
331 | margin: EdgeInsets.all(20),
332 | decoration: BoxDecoration(
333 | color: Color(0xff107163),
334 | borderRadius: BorderRadius.circular(5),
335 | boxShadow: [
336 | BoxShadow(
337 | color: Color(0x17000000),
338 | offset: Offset(0, 15),
339 | blurRadius: 15,
340 | spreadRadius: 0,
341 | ),
342 | ],
343 | ),
344 | child: Text(
345 | 'Contact Info: 2223453456',
346 | style: TextStyle(
347 | color: Colors.white,
348 | fontSize: 20,
349 | fontFamily: 'Roboto',
350 | fontWeight: FontWeight.w500,
351 | ),
352 | ),
353 | ),
354 | ],
355 | ),
356 | ),
357 | );
358 | }
359 |
360 | Widget demoDates(String day, String date, bool isSelected) {
361 | return isSelected ? Container(
362 | width: 70,
363 | margin: EdgeInsets.only(right: 15),
364 | decoration: BoxDecoration(
365 | color: Color(0xff107163),
366 | borderRadius: BorderRadius.circular(10),
367 | ),
368 | child: Column(
369 | mainAxisAlignment: MainAxisAlignment.center,
370 | children: [
371 | Container(
372 | child: Text(
373 | day,
374 | style: TextStyle(
375 | color: Colors.white,
376 | fontSize: 20,
377 | fontFamily: 'Roboto',
378 | fontWeight: FontWeight.w500,
379 | ),
380 | ),
381 | ),
382 | Container(
383 | margin: EdgeInsets.only(top: 10),
384 | padding: EdgeInsets.all(7),
385 | child: Text(
386 | date,
387 | style: TextStyle(
388 | color: Colors.white,
389 | fontSize: 15,
390 | fontFamily: 'Roboto',
391 | fontWeight: FontWeight.bold
392 | ),
393 | ),
394 | ),
395 | ],
396 | ),
397 | ) : Container(
398 | width: 70,
399 | margin: EdgeInsets.only(right: 15),
400 | decoration: BoxDecoration(
401 | color: Color(0xffEEEEEE),
402 | borderRadius: BorderRadius.circular(10),
403 | ),
404 | child: Column(
405 | mainAxisAlignment: MainAxisAlignment.center,
406 | children: [
407 | Container(
408 | child: Text(
409 | day,
410 | style: TextStyle(
411 | color: Colors.black,
412 | fontSize: 20,
413 | fontFamily: 'Roboto',
414 | fontWeight: FontWeight.w500,
415 | ),
416 | ),
417 | ),
418 | Container(
419 | margin: EdgeInsets.only(top: 10),
420 | padding: EdgeInsets.all(7),
421 | child: Text(
422 | date,
423 | style: TextStyle(
424 | color: Colors.black,
425 | fontSize: 15,
426 | fontFamily: 'Roboto',
427 | fontWeight: FontWeight.bold
428 | ),
429 | ),
430 | ),
431 | ],
432 | ),
433 | );
434 | }
435 |
436 | Widget doctorTimingsData(String time, bool isSelected) {
437 | return isSelected ? Container(
438 | margin: EdgeInsets.only(left: 20, top: 10),
439 | decoration: BoxDecoration(
440 | color: Color(0xff107163),
441 | borderRadius: BorderRadius.circular(5),
442 | ),
443 | child: Row(
444 | mainAxisAlignment: MainAxisAlignment.center,
445 | crossAxisAlignment: CrossAxisAlignment.center,
446 | children: [
447 | Container(
448 | margin: EdgeInsets.only(right: 2),
449 | child: Icon(
450 | Icons.access_time,
451 | color: Colors.white,
452 | size: 18,
453 | ),
454 | ),
455 | Container(
456 | margin: EdgeInsets.only(left: 2),
457 | child: Text('8:30',
458 | style: TextStyle(
459 | color: Colors.white,
460 | fontSize: 17,
461 | fontFamily: 'Roboto',
462 | ),
463 | ),
464 | ),
465 | ],
466 | ),
467 | ) : Container(
468 | margin: EdgeInsets.only(left: 20, top: 10),
469 | decoration: BoxDecoration(
470 | color: Color(0xffEEEEEE),
471 | borderRadius: BorderRadius.circular(5),
472 | ),
473 | child: Row(
474 | mainAxisAlignment: MainAxisAlignment.center,
475 | crossAxisAlignment: CrossAxisAlignment.center,
476 | children: [
477 | Container(
478 | margin: EdgeInsets.only(right: 2),
479 | child: Icon(
480 | Icons.access_time,
481 | color: Colors.black,
482 | size: 18,
483 | ),
484 | ),
485 | Container(
486 | margin: EdgeInsets.only(left: 2),
487 | child: Text('9.00',
488 | style: TextStyle(
489 | color: Colors.black,
490 | fontSize: 17,
491 | fontFamily: 'Roboto',
492 | ),
493 | ),
494 | ),
495 | ],
496 | ),
497 | );
498 | }
499 | }
--------------------------------------------------------------------------------