Skip to content

Commit

Permalink
Major Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AumGupta committed Jan 11, 2024
1 parent 1f9b655 commit de7bc57
Show file tree
Hide file tree
Showing 45 changed files with 4,224 additions and 1,717 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
applicationId "com.example.docotg"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 23
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
30 changes: 17 additions & 13 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,36 @@
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:label="Doc-OTG"
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="Doc-OTG"
android:usesCleartextTraffic="true">


<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/drawable/launch_background.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item android:drawable="@color/ic_launcher_background" />

<!-- You can insert your own image assets here -->
<!-- <item>
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#ffffff</color>
<color name="ic_launcher_background">#ff585be4</color>
</resources>
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Binary file added assets/fonts/Bastliga-One.ttf
Binary file not shown.
Binary file added assets/fonts/Montserrat-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/Montserrat-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/signature_font.otf
Binary file not shown.
38 changes: 3 additions & 35 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:docotg/provider/user_provider.dart';
import 'package:docotg/screens/login_screen.dart';
import 'package:docotg/screens/mobile_screen_layout.dart';
import 'package:docotg/utils/colors.dart';
import 'package:docotg/utils/constants.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -48,7 +48,7 @@ class MyApp extends StatelessWidget {
),
),
),
home: LoginPage(),
home: const LoginPage(),
),
);
}
Expand All @@ -69,7 +69,7 @@ class LogicBuilder extends StatelessWidget {
// This means that whenever the connection is active and our snapshot has any data we are going to return a responsive layout
return MobileScreenLayout(
isDoctor:
true); // TRUE hai isiliye DOctor Screen AAti hai bar bar
true); // TRUE hai isiliye DOctor Screen AAti hai bar bar
} else if (snapshot.hasError) {
return Center(
child: Text(
Expand All @@ -90,35 +90,3 @@ class LogicBuilder extends StatelessWidget {
);
}
}

// class MyHomePage extends StatefulWidget {
// const MyHomePage({super.key, });
// @override
// State<MyHomePage> createState() => _MyHomePageState();
// }
//
// class _MyHomePageState extends State<MyHomePage> {
// Future<FirebaseApp> _initializeFirebase () async {
// FirebaseApp firebaseApp = await Firebase.initializeApp();
// return firebaseApp;
// }
//
//
// @override
// Widget build(BuildContext context) {
//
// return Scaffold(
//
// body: FutureBuilder(
// future: _initializeFirebase(),
// builder: (context, snapshot) {
// if (snapshot.connectionState == ConnectionState.done) {
// return const HomePage();
// }
// return const Center(
// child: CircularProgressIndicator (),
// );}
// )
// );
// }
// }
37 changes: 22 additions & 15 deletions lib/model/post.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import 'package:cloud_firestore/cloud_firestore.dart';

class Post {
final Map<String,String> symptoms; // Post Description entered by the user
final Map<String, String> symptoms; // Post Description entered by the user
final String uid; // UID that made the post
final String name; // Name of the user that made the post
final String postId; // Unique post ID
final DateTime datePublished; // Date the post was published
final String imageUrl; //
final String profImage; //
final String profImage;
String? finalResult;
String? otherSymptom;
String? audio;
String? video;

Post(
Post(
{required this.symptoms,
required this.uid,
required this.name,
Expand All @@ -20,8 +22,9 @@ class Post {
required this.imageUrl,
required this.profImage,
required this.audio,
required this.otherSymptom
});
required this.video,
required this.otherSymptom,
required this.finalResult});

Map<String, dynamic> toJson() => {
'symptoms': symptoms,
Expand All @@ -32,23 +35,27 @@ class Post {
'postUrl': imageUrl,
'profImage': profImage,
'audio': audio,
'otherSymptom' : otherSymptom
'video': video,
'otherSymptom': otherSymptom,
'finalResult': finalResult
};

static Post fromSnap(DocumentSnapshot snap) {
// TODO: If there is any issue with user sign up functions refer to this "User instance" in this function definition
var snapshot = snap.data() as Map<String, dynamic>;

return Post(
uid: snapshot['uid'],
name: snapshot['name'],
symptoms: snapshot['symptoms'],
postId: snapshot['postId'],
datePublished: snapshot['datePublished'],
imageUrl: snapshot['postUrl'],
profImage: snapshot['following'],
audio: snapshot['audio'],
otherSymptom: snapshot['otherSymptom']
uid: snapshot['uid'],
name: snapshot['name'],
symptoms: snapshot['symptoms'],
postId: snapshot['postId'],
datePublished: snapshot['datePublished'],
imageUrl: snapshot['postUrl'],
profImage: snapshot['following'],
audio: snapshot['audio'],
video: snapshot['video'],
otherSymptom: snapshot['otherSymptom'],
finalResult: snapshot['finalResult'],
);
}
}
61 changes: 41 additions & 20 deletions lib/model/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,63 @@ class Report {
final String uid;
final String postId;
final String textResult;
final String imageResult;
final datePublished;
String? finalResult;
String? prescription;
String? doctorName;

Report({
required this.reportId,
required this.uid,
required this.postId,
required this.textResult,
required this.datePublished,
});
Report(
{required this.reportId,
required this.uid,
required this.postId,
required this.textResult,
required this.imageResult,
required this.datePublished,
required this.doctorName,
required this.finalResult,
required this.prescription});

Map<String, dynamic> toJson() => {
'reportId': reportId,
'uid': uid,
'postId': postId,
'textResult': textResult,
'imageResult': imageResult,
'datePublished': datePublished,
'doctorName': doctorName,
'finalResult': finalResult,
'prescription': prescription,
};

static Report fromSnap(DocumentSnapshot snap) {
var snapshot = snap.data() as Map<String, dynamic>;
return Report(
reportId: snapshot['reportId'],
uid: snapshot['uid'],
postId: snapshot['postId'],
textResult: snapshot['textResult'],
datePublished: snapshot['datePublished'],
);
reportId: snapshot['reportId'],
uid: snapshot['uid'],
postId: snapshot['postId'],
textResult: snapshot['textResult'],
imageResult: snapshot['imageResult'],
datePublished: snapshot['datePublished'],
doctorName: snapshot['doctorName'],
finalResult: snapshot['finalResult'],
prescription: snapshot['prescription']);
}

static List<Report> fromQuerySnap(QuerySnapshot snap) {
List<Report> reportList = [];
for (int i = 0; i <= snap.size-1; i++) {
for (int i = 0; i <= snap.size - 1; i++) {
var snapshot = snap.docs[i].data() as Map<String, dynamic>;
Report report = Report(
reportId: snapshot['reportId'],
uid: snapshot['uid'],
postId: snapshot['postId'],
textResult: snapshot['textResult'],
datePublished: snapshot['datePublished'],
);
reportId: snapshot['reportId'],
uid: snapshot['uid'],
postId: snapshot['postId'],
textResult: snapshot['textResult'],
imageResult: snapshot['imageResult'],
datePublished: snapshot['datePublished'],
doctorName: snapshot['doctorName'],
finalResult: snapshot['finalResult'],
prescription: snapshot['prescription']);
reportList.add(report);
}
return reportList;
Expand All @@ -57,8 +74,12 @@ class Report {
'uid': uid,
'postId': postId,
'textResult': textResult,
'imageResult': imageResult,
'datePublished': DateFormat.yMMMd().format(datePublished.toDate()),
'doctorName': doctorName!,
'timePublished': DateFormat.jm().format(datePublished.toDate()),
'finalResult': finalResult!,
'prescription': prescription!,
};
return readableReport;
}
Expand Down
6 changes: 2 additions & 4 deletions lib/provider/user_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UserProvider extends ChangeNotifier {
age: 18,
number: "number",
profImageUrl:
"https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png");
"https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png");

user get getUser => _user!;

Expand All @@ -23,13 +23,11 @@ class UserProvider extends ChangeNotifier {
// user user1 = await _authMethods.getUserDetails();
// _user = user1;
_user = await _authMethods.getUserDetails(_isDoctor);
print({_user});
print("user:$_user");
notifyListeners();
}

void setUser(user User) {
_user = User;
notifyListeners();
}
}
}
Loading

0 comments on commit de7bc57

Please sign in to comment.