Commit 9063bd34 authored by Wickramasinghe R.J.P's avatar Wickramasinghe R.J.P

mobile app administrator & doctor related functionalities

parent 841e6056
...@@ -24,9 +24,10 @@ if (flutterVersionName == null) { ...@@ -24,9 +24,10 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion 32
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
compileOptions { compileOptions {
...@@ -47,8 +48,8 @@ android { ...@@ -47,8 +48,8 @@ android {
applicationId "com.example.canis_care" applicationId "com.example.canis_care"
// You can update the following values to match your application needs. // 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. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 19 minSdkVersion 20
targetSdkVersion flutter.targetSdkVersion targetSdkVersion 33
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
...@@ -68,4 +69,6 @@ flutter { ...@@ -68,4 +69,6 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:30.4.1')
implementation 'com.google.firebase:firebase-analytics'
} }
{
"project_info": {
"project_number": "315503392169",
"project_id": "caniscare-2033a",
"storage_bucket": "caniscare-2033a.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:315503392169:android:0f2d891b40cf7c3780c0b8",
"android_client_info": {
"package_name": "com.example.canis_care"
}
},
"oauth_client": [
{
"client_id": "315503392169-cr01f1pfqrocvm0d8bribiqrtce9vup6.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCscmFzISq6qV8m-Q5Z1D0kgdsyrxIMBlQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "315503392169-cr01f1pfqrocvm0d8bribiqrtce9vup6.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.
package io.flutter.app;
import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;
/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
...@@ -8,6 +8,7 @@ buildscript { ...@@ -8,6 +8,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.1.2' classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.13'
} }
} }
......
Dandruff Dandruff
Invalid_images Invalid images
Ring_Worm Ringworm
Yeast_Infection YeastInfection
\ No newline at end of file \ No newline at end of file
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import '../models/category.dart'; import '../models/category.dart';
import '../models/component.dart'; import '../models/component.dart';
......
import 'package:canis_care/screens/splash_screen.dart'; import 'package:canis_care/screens/splash_screen.dart';
import 'package:canis_care/screens/welcome_screen.dart'; import 'package:canis_care/screens/welcome_screen.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() { void main() async{
runApp(const MyApp()); runApp(const MyApp());
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
......
This diff is collapsed.
import 'dart:convert';
import 'package:bubble/bubble.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class ChatBot extends StatefulWidget {
@override
_ChatBotState createState() => _ChatBotState();
}
class _ChatBotState extends State<ChatBot> {
final GlobalKey<AnimatedListState> _listKey = GlobalKey();
List<String> _data = [];
static const String BOT_URL = "http://52.38.189.55:5000/predict/";
TextEditingController queryController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[300],
appBar: AppBar(
backgroundColor: Colors.blue,
centerTitle: true,
title: Text("Vet Bot"),
automaticallyImplyLeading: false,
leading: new IconButton(
icon: new Icon(Icons.arrow_back, color: Colors.orange),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Stack(
children: <Widget>[
AnimatedList(
key: _listKey,
initialItemCount: _data.length,
itemBuilder:
(BuildContext context, int index, Animation<double> animation) {
return buildItem(_data[index], animation, index);
},
),
Align(
alignment: Alignment.bottomCenter,
child: ColorFiltered(
colorFilter: ColorFilter.linearToSrgbGamma(),
child: Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: TextField(
decoration: InputDecoration(
icon: Icon(
Icons.message,
color: Colors.blue,
),
hintText: "Hello",
fillColor: Colors.white12,
),
controller: queryController,
textInputAction: TextInputAction.send,
onSubmitted: (msg) {
this.getResponse();
},
),
),
),
),
)
],
),
);
}
void getResponse() {
if (queryController.text.length > 0) {
this.insertSingleItem(queryController.text);
var client = getClient();
try {
client.post(
Uri.parse(BOT_URL),
body: {"message": queryController.text},
)..then((response) {
print(response.body);
String data = jsonDecode(response.body);
insertSingleItem(data + "<bot>");
});
} finally {
client.close();
queryController.clear();
}
}
}
void insertSingleItem(String message) {
_data.add(message);
_listKey.currentState?.insertItem(_data.length - 1);
}
http.Client getClient() {
return http.Client();
}
}
Widget buildItem(String item, Animation<double> animation, int index) {
bool mine = item.endsWith("<bot>");
return SizeTransition(
sizeFactor: animation,
child: Padding(
padding: EdgeInsets.only(top: 10),
child: Container(
alignment: mine ? Alignment.topLeft : Alignment.topRight,
child: Bubble(
child: Text(
item.replaceAll("<bot>", ""),
style: TextStyle(color: mine ? Colors.white : Colors.black),
),
color: mine ? Colors.blue : Colors.grey[200],
padding: BubbleEdges.all(10),
),
),
),
);
}
This diff is collapsed.
This diff is collapsed.
import 'dart:convert'; import 'dart:convert';
import 'package:canis_care/screens/web_view_screen.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
...@@ -33,6 +34,9 @@ class _DiseaseIndividualTopicInfoState ...@@ -33,6 +34,9 @@ class _DiseaseIndividualTopicInfoState
List<DiseaseIndividualSubTopicInfo> subTopicInfoList = []; List<DiseaseIndividualSubTopicInfo> subTopicInfoList = [];
int pageIndex = 0; int pageIndex = 0;
PageController? _pageController; PageController? _pageController;
late String link;
String url = "https://canis-care-auto.herokuapp.com";
// String url = "http://192.168.1.101:8000";
@override @override
void dispose() { void dispose() {
...@@ -42,32 +46,39 @@ class _DiseaseIndividualTopicInfoState ...@@ -42,32 +46,39 @@ class _DiseaseIndividualTopicInfoState
@override @override
void initState() { void initState() {
_retrieveSeeAlsoLink();
_retrieveSubTopicsDetails(); _retrieveSubTopicsDetails();
super.initState(); super.initState();
_pageController = PageController(); _pageController = PageController();
} }
_retrieveSeeAlsoLink() async {
String retrieveUri = "$url/diseaselink/${widget.disease.diseaseName}/";
List responses = json.decode(
utf8.decode((await client.get(Uri.parse(retrieveUri))).bodyBytes));
setState(() {
link = responses[0];
});
}
_retrieveSubTopicsDetails() async { _retrieveSubTopicsDetails() async {
subTopicsInfo = []; subTopicsInfo = [];
String retrieveUri = "http://192.168.1.102:8000/disease/" + String retrieveUri =
widget.disease.diseaseName + "$url/disease/${widget.disease.diseaseName}/${widget.category.topic}/${widget.diseaseIndividualTopic.individualTopic}/";
"/" +
widget.category.topic +
"/" +
widget.diseaseIndividualTopic.individualTopic +
"/";
List responses = json.decode( List responses = json.decode(
utf8.decode((await client.get(Uri.parse(retrieveUri))).bodyBytes)); utf8.decode((await client.get(Uri.parse(retrieveUri))).bodyBytes));
for (var element in responses) { for (var element in responses) {
// String res = element.substring(element.indexOf('#'));
// String res2 = res.replaceAll("#", "");
var encoded = utf8.encode(element); var encoded = utf8.encode(element);
var decoded = utf8.decode(encoded); var decoded = utf8.decode(encoded);
if (decoded.startsWith(RegExp(r'[A-Z][a-z]'))) {
subTopicsInfo.add(decoded);
} else {
var formatted = decoded.substring(1); var formatted = decoded.substring(1);
subTopicsInfo.add(formatted); subTopicsInfo.add(formatted);
} }
// var newDiseases = List<String>.from(diseases); }
subTopicInfoList = List.generate( subTopicInfoList = List.generate(
subTopicsInfo.length, subTopicsInfo.length,
(index) => DiseaseIndividualSubTopicInfo( (index) => DiseaseIndividualSubTopicInfo(
...@@ -141,13 +152,14 @@ class _DiseaseIndividualTopicInfoState ...@@ -141,13 +152,14 @@ class _DiseaseIndividualTopicInfoState
BorderRadius.circular(16), BorderRadius.circular(16),
color: Colors.blue, color: Colors.blue,
), ),
margin: EdgeInsets.only( margin: const EdgeInsets.only(
top: 5.0, bottom: 15), top: 5.0, bottom: 15),
child: Card( child: Card(
child: Container( child: Container(
margin: EdgeInsets.only( margin: const EdgeInsets.only(
bottom: 30), bottom: 30),
padding: EdgeInsets.all(5.0), padding:
const EdgeInsets.all(5.0),
child: Text( child: Text(
subTopicInfoList[index] subTopicInfoList[index]
.individualTopicInfo, .individualTopicInfo,
...@@ -169,27 +181,44 @@ class _DiseaseIndividualTopicInfoState ...@@ -169,27 +181,44 @@ class _DiseaseIndividualTopicInfoState
visible: index == subTopicInfoList.length - 1, visible: index == subTopicInfoList.length - 1,
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 10), padding: const EdgeInsets.only(top: 10),
child: FlatButton( child: ClipRRect(
onPressed: () { borderRadius: BorderRadius.circular(50),
// Navigator.of(context).push( child: Material(
// MaterialPageRoute( color: Colors.greenAccent,
// builder: (context) => child: InkWell(
// DiseaseDetails( splashColor:
// disease: diseaseList[index], Colors.cyan.withOpacity(0.2),
// )), highlightColor:
// ); Colors.cyan.withOpacity(0.2),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
DiseaseWebView(
link: link,
disease:
widget.disease,
)));
}, },
color: Colors.cyan, child: Container(
shape: RoundedRectangleBorder( padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.circular(50)), BorderRadius.circular(50),
padding: const EdgeInsets.all(15), color: Colors.transparent,
border: Border.all(
color: Colors.cyan,
width: 4)),
child: const Text( child: const Text(
"See Also", "See Also",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.black, fontWeight: FontWeight.bold,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), color: Colors.black),
),
),
),
), ),
), ),
), ),
...@@ -201,7 +230,7 @@ class _DiseaseIndividualTopicInfoState ...@@ -201,7 +230,7 @@ class _DiseaseIndividualTopicInfoState
), ),
RawScrollbar( RawScrollbar(
thumbColor: Colors.redAccent, thumbColor: Colors.redAccent,
radius: Radius.circular(20), radius: const Radius.circular(20),
thickness: 10, thickness: 10,
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
...@@ -219,7 +248,7 @@ class _DiseaseIndividualTopicInfoState ...@@ -219,7 +248,7 @@ class _DiseaseIndividualTopicInfoState
child: Container( child: Container(
width: 20, width: 20,
height: 20, height: 20,
margin: EdgeInsets.all(10), margin: const EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.cyan, color: Colors.cyan,
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(50),
...@@ -240,7 +269,7 @@ class _DiseaseIndividualTopicInfoState ...@@ -240,7 +269,7 @@ class _DiseaseIndividualTopicInfoState
), ),
], ],
), ),
Positioned(bottom: 0, left: 0, right: 0, child: BotBar()) const Positioned(bottom: 0, left: 0, right: 0, child: BotBar())
]), ]),
), ),
); );
......
...@@ -6,6 +6,7 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; ...@@ -6,6 +6,7 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:localstorage/localstorage.dart';
import '../models/category.dart'; import '../models/category.dart';
import '../models/disease.dart'; import '../models/disease.dart';
...@@ -30,20 +31,30 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> { ...@@ -30,20 +31,30 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> {
Client client = http.Client(); Client client = http.Client();
List<String> subTopics = []; List<String> subTopics = [];
List<DiseaseIndividualTopic> subTopicList = []; List<DiseaseIndividualTopic> subTopicList = [];
String status = "true";
final LocalStorage storage = LocalStorage('local_storage_app');
String? infoRole, infoEmail;
String url = "https://canis-care-auto.herokuapp.com";
// String url = "http://192.168.1.101:8000";
@override @override
void initState() { void initState() {
_retrieveSubTopics(); _retrieveSubTopics();
getItemFromLocalStorage();
super.initState(); super.initState();
} }
void getItemFromLocalStorage() {
Map<String, dynamic> info = json.decode(storage.getItem('info'));
infoEmail = info['email'];
infoRole = info['role'];
}
_retrieveSubTopics() async { _retrieveSubTopics() async {
subTopics = []; subTopics = [];
String retrieveUri = "http://192.168.1.102:8000/disease/" + String retrieveUri =
widget.disease.diseaseName + "$url/disease/${widget.disease.diseaseName}/${widget.category.topic}/";
"/" +
widget.category.topic +
"/";
List responses = List responses =
json.decode((await client.get(Uri.parse(retrieveUri))).body); json.decode((await client.get(Uri.parse(retrieveUri))).body);
...@@ -52,7 +63,6 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> { ...@@ -52,7 +63,6 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> {
String res2 = res.replaceAll("#", ""); String res2 = res.replaceAll("#", "");
subTopics.add(res2); subTopics.add(res2);
} }
// var newDiseases = List<String>.from(diseases);
subTopicList = List.generate(subTopics.length, subTopicList = List.generate(subTopics.length,
(index) => DiseaseIndividualTopic(individualTopic: subTopics[index])); (index) => DiseaseIndividualTopic(individualTopic: subTopics[index]));
setState(() {}); setState(() {});
...@@ -63,7 +73,7 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> { ...@@ -63,7 +73,7 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: title:
Text(widget.disease.diseaseName + " " + widget.category.topic)), Text("${widget.disease.diseaseName} ${widget.category.topic}")),
body: Stack(children: [ body: Stack(children: [
Container( Container(
color: Colors.blue[100], color: Colors.blue[100],
...@@ -122,8 +132,8 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> { ...@@ -122,8 +132,8 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> {
Row( Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment.center,
children: [ children: const [
const SizedBox(width: 8), SizedBox(width: 8),
], ],
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
...@@ -137,49 +147,23 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> { ...@@ -137,49 +147,23 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> {
width: 1, width: 1,
color: Colors.grey[200]!.withOpacity(0.7), color: Colors.grey[200]!.withOpacity(0.7),
), ),
/* RotatedBox( RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Text( child: Text(
reminder!.isCompleted == 1 ? "NOTED" : "WAITING", status == "true" && infoRole == "User"
? "Verified"
: " ",
style: GoogleFonts.lato( style: GoogleFonts.lato(
textStyle: const TextStyle( textStyle: const TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white), color: Colors.lightGreenAccent),
), ),
), ),
),*/ )
]), ]),
), ),
), ),
// child: Container(
// width: MediaQuery.of(context).size.width,
// padding: const EdgeInsets.all(15.0),
// child: ListTile(
// title: Text(
// diseaseList[index].diseaseName,
// style: const TextStyle(
// fontSize: 20, fontWeight: FontWeight.w600),
// ),
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) => DiseaseDetails(
// disease: diseaseList[index],
// )),
// );
// },
// trailing: IconButton(
// icon: const Icon(Icons.view_headline_sharp),
// // onPressed: () => {_deleteNote((notes[index].id).toString())},
// onPressed: () => {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) => OnBoarding()),
// )
// }),
// ),
// ),
), ),
), ),
), ),
...@@ -189,7 +173,7 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> { ...@@ -189,7 +173,7 @@ class _DiseaseIndividualState extends State<DiseaseIndividual> {
), ),
), ),
), ),
Positioned(bottom: 0, left: 0, right: 0, child: BotBar()) const Positioned(bottom: 0, left: 0, right: 0, child: BotBar())
]), ]),
); );
} }
......
import 'dart:convert';
import 'package:canis_care/screens/disease_screen.dart'; import 'package:canis_care/screens/disease_screen.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:localstorage/localstorage.dart';
import '../data/disease_sub_topics.dart'; import '../data/disease_sub_topics.dart';
import '../models/component.dart'; import '../models/component.dart';
...@@ -20,10 +23,10 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -20,10 +23,10 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
drawer: SideDrawer(), drawer: const SideDrawer(),
appBar: AppBar( appBar: AppBar(
title: Text( title: const Text(
"Home Page", "Disease Intelligence",
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
...@@ -33,7 +36,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -33,7 +36,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
child: Column( child: Column(
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: BorderRadius.only( borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(60), bottomLeft: Radius.circular(60),
bottomRight: Radius.circular(60), bottomRight: Radius.circular(60),
), ),
...@@ -44,7 +47,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -44,7 +47,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
'images/symbols/dogvet2.jpg', 'images/symbols/dogs.jpg',
), ),
fit: BoxFit.cover)), fit: BoxFit.cover)),
), ),
...@@ -67,7 +70,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -67,7 +70,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(bottom: 10), padding: const EdgeInsets.only(bottom: 10),
child: Text( child: Text(
"CANIS CARE", "CANIS CARE",
style: GoogleFonts.bungeeShade( style: GoogleFonts.bungeeShade(
...@@ -83,12 +86,12 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -83,12 +86,12 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
], ],
), ),
), ),
SizedBox( const SizedBox(
height: 20, height: 20,
), ),
Expanded( Expanded(
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.only( borderRadius: const BorderRadius.only(
topLeft: Radius.circular(60), topLeft: Radius.circular(60),
topRight: Radius.circular(60), topRight: Radius.circular(60),
), ),
...@@ -110,7 +113,8 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -110,7 +113,8 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => DiseaseList( builder: (context) => DiseaseList(
title: 'All Diseases', title: componentCategories[index]
.categoryName,
)), )),
); );
}, },
...@@ -137,7 +141,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -137,7 +141,7 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
Text( Text(
componentCategories[index] componentCategories[index]
.categoryName, .categoryName,
style: TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
......
This diff is collapsed.
This diff is collapsed.
import 'package:flutter/material.dart';
class ResetPassword extends StatefulWidget {
const ResetPassword({Key? key}) : super(key: key);
@override
_ResetPasswordState createState() => _ResetPasswordState();
}
class _ResetPasswordState extends State<ResetPassword> {
@override
Widget build(BuildContext context) {
// TODO: implement build
throw UnimplementedError();
}
// TextEditingController _emailTextController = TextEditingController();
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// extendBodyBehindAppBar: true,
// appBar: AppBar(
// backgroundColor: Colors.transparent,
// elevation: 0,
// title: const Text(
// "Reset Password",
// style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
// ),
// ),
// body: Container(
// width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.height,
// decoration: BoxDecoration(
// gradient: LinearGradient(colors: [
// hexStringToColor("CB2B93"),
// hexStringToColor("9546C4"),
// hexStringToColor("5E61F4")
// ], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
// child: SingleChildScrollView(
// child: Padding(
// padding: EdgeInsets.fromLTRB(20, 120, 20, 0),
// child: Column(
// children: <Widget>[
// const SizedBox(
// height: 20,
// ),
// reusableTextField("Enter Email Id", Icons.person_outline, false,
// _emailTextController),
// const SizedBox(
// height: 20,
// ),
// firebaseUIButton(context, "Reset Password", () {
// FirebaseAuth.instance
// .sendPasswordResetEmail(email: _emailTextController.text)
// .then((value) => Navigator.of(context).pop());
// })
// ],
// ),
// ))),
// );
// }
}
This diff is collapsed.
// import 'package:canis_care/screens//firebase_auth.dart';
import 'dart:convert';
import 'package:canis_care/screens/admin_screen.dart';
import 'package:canis_care/screens/disease_screen.dart';
import 'package:canis_care/widgets/reusable_widget.dart';
import 'package:canis_care/screens/home_screen.dart';
import 'package:canis_care/screens/reset_password.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
// import 'package:firebase_signin/screens/signup_screen.dart';
// import 'package:canis_care/utils/color_utils.dart';
import 'package:flutter/material.dart';
import 'package:localstorage/localstorage.dart';
class SignInScreen extends StatefulWidget {
const SignInScreen({Key? key}) : super(key: key);
@override
_SignInScreenState createState() => _SignInScreenState();
}
class _SignInScreenState extends State<SignInScreen> {
final _auth = FirebaseAuth.instance;
final _formkey = GlobalKey<FormState>();
TextEditingController _passwordTextController = TextEditingController();
TextEditingController _emailTextController = TextEditingController();
final LocalStorage storage = LocalStorage('local_storage_app');
void addItemsToLocalStorage(String email, String role) {
final info = json.encode({'email': email, 'role': role});
storage.setItem('info', info);
}
void getItemFromLocalStorage() {
Map<String, dynamic> info = json.decode(storage.getItem('info'));
final infoEmail = info['email'];
final infoRole = info['role'];
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.cyan.withOpacity(0.8), Colors.transparent],
begin: Alignment.topCenter,
end: Alignment.bottomCenter)),
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.fromLTRB(
20, MediaQuery.of(context).size.height * 0.2, 20, 0),
child: Column(
children: <Widget>[
logoWidget("images/dog_infection-removebg.png"),
const SizedBox(
height: 30,
),
reusableTextField("Enter Username", Icons.person_outline, false,
_emailTextController),
const SizedBox(
height: 20,
),
reusableTextField("Enter Password", Icons.lock_outline, true,
_passwordTextController),
const SizedBox(
height: 5,
),
forgetPassword(context),
firebaseUIButton(context, "Sign In", () {
signIn(
_emailTextController.text, _passwordTextController.text);
}),
// signUpOption()
],
),
),
),
),
);
}
// Row signUpOption() {
// return Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// const Text("Don't have account?",
// style: TextStyle(color: Colors.white70)),
// GestureDetector(
// onTap: () {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => SignUpScreen()));
// },
// child: const Text(
// " Sign Up",
// style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
// ),
// )
// ],
// );
// }
Widget forgetPassword(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
height: 35,
alignment: Alignment.bottomRight,
child: TextButton(
child: const Text(
"Forgot Password?",
style: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
textAlign: TextAlign.right,
),
onPressed: () => Navigator.push(
context, MaterialPageRoute(builder: (context) => ResetPassword())),
),
);
}
void route(String email) {
User? user = FirebaseAuth.instance.currentUser;
var kk = FirebaseFirestore.instance
.collection('users')
.doc(user!.uid)
.get()
.then((DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists) {
String getRole = documentSnapshot.get('role');
addItemsToLocalStorage(email, getRole);
getItemFromLocalStorage();
if (getRole == "Doctor") {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const HomePage(),
),
);
} else if (getRole == "Admin") {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const AdminScreen(),
),
);
} else {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const HomePage(),
),
);
}
} else {
print('Document does not exist on the database');
}
});
}
void signIn(String email, String password) async {
const CircularProgressIndicator();
if (_formkey.currentState?.validate() ?? true) {
try {
UserCredential userCredential =
await FirebaseAuth.instance.signInWithEmailAndPassword(
email: email,
password: password,
);
route(email);
} on FirebaseAuthException catch (e) {
if (e.code == 'user-not-found') {
print('No user found for that email.');
} else if (e.code == 'wrong-password') {
print('Wrong password provided for that user.');
}
}
}
}
}
// import 'package:firebase_auth/firebase_auth.dart';
// import 'package:firebase_signin/reusable_widgets/reusable_widget.dart';
// import 'package:firebase_signin/screens/home_screen.dart';
// import 'package:firebase_signin/utils/color_utils.dart';
import 'package:canis_care/screens/signin_screen.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SignUpScreen extends StatelessWidget { import '../utils/color_utils.dart';
import '../widgets/reusable_widget.dart';
class SignUpScreen extends StatefulWidget {
const SignUpScreen({Key? key}) : super(key: key); const SignUpScreen({Key? key}) : super(key: key);
@override
_SignUpScreenState createState() => _SignUpScreenState();
}
class _SignUpScreenState extends State<SignUpScreen> {
bool showProgress = false;
bool visible = false;
final _formkey = GlobalKey<FormState>();
final _auth = FirebaseAuth.instance;
String role = "Admin";
TextEditingController _passwordTextController = TextEditingController();
TextEditingController _emailTextController = TextEditingController();
TextEditingController _userNameTextController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Scaffold( return Scaffold(
body: Center(child: Text("Sign Up Page")), // extendBodyBehindAppBar: true,
// appBar: AppBar(
// backgroundColor: Colors.transparent,
// elevation: 0,
// // title: const Text(
// // "Sign Up",
// // style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
// // ),
// ),
body: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.cyan.withOpacity(0.8), Colors.transparent],
begin: Alignment.topCenter,
end: Alignment.bottomCenter)),
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 200, 20, 0),
child: Column(
children: <Widget>[
Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(40)),
),
child: const Text("Sign Up",
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
color: Colors.white)),
),
const SizedBox(
height: 50,
),
reusableTextField("Enter Username", Icons.person_outline, false,
_userNameTextController),
const SizedBox(
height: 20,
),
reusableTextField("Enter Email ID", Icons.person_outline, false,
_emailTextController),
const SizedBox(
height: 20,
),
reusableTextField("Enter Password", Icons.lock_outlined, true,
_passwordTextController),
const SizedBox(
height: 20,
),
firebaseUIButton(context, "Sign Up", () {
signUp(_emailTextController.text,
_passwordTextController.text, role);
})
],
),
))),
); );
} }
void signUp(String email, String password, String role) async {
const CircularProgressIndicator();
if (_formkey.currentState?.validate() ?? true) {
await _auth
.createUserWithEmailAndPassword(
email: _emailTextController.text,
password: _passwordTextController.text)
.then((value) => {postDetailsToFirestore(email, role)})
.catchError((e) {});
}
}
postDetailsToFirestore(String email, String role) async {
FirebaseFirestore firebaseFirestore = FirebaseFirestore.instance;
var user = _auth.currentUser;
CollectionReference ref = firebaseFirestore.collection('users');
ref.doc(user!.uid).set({'email': email, 'role': role});
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => const SignInScreen()));
}
} }
...@@ -19,11 +19,6 @@ class SplashScreen extends StatelessWidget { ...@@ -19,11 +19,6 @@ class SplashScreen extends StatelessWidget {
color: Colors.cyan, color: Colors.cyan,
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset("images/logo.png"), child: Image.asset("images/logo.png"),
// child: const IconFont(
// color: Colors.white,
// size: 100,
// iconName: 'a',
// ),
), ),
); );
} }
......
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;
import '../models/disease.dart';
import '../widgets/navigation_controller.dart';
import '../widgets/web_view_menu.dart';
import '../widgets/web_view_stack.dart';
class DiseaseWebView extends StatefulWidget {
const DiseaseWebView({Key? key, required this.link, required this.disease})
: super(key: key);
final String link;
final Disease disease;
@override
State<DiseaseWebView> createState() => _DiseaseWebViewState();
}
class _DiseaseWebViewState extends State<DiseaseWebView> {
final controller =
Completer<WebViewController>(); // Instantiate the controller
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('WebView'),
actions: [
NavigationControls(controller: controller),
// Menu(controller: controller),
],
),
body: WebViewStack(
link: widget.link,
controller: controller,
disease: widget.disease,
));
}
}
import 'package:canis_care/screens/admin_screen.dart';
import 'package:canis_care/screens/home_screen.dart'; import 'package:canis_care/screens/home_screen.dart';
import 'package:canis_care/screens/login_screen.dart'; import 'package:canis_care/screens/login_screen.dart';
import 'package:canis_care/screens/signin_screen.dart';
import 'package:canis_care/screens/signup_screen.dart'; import 'package:canis_care/screens/signup_screen.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -41,25 +43,40 @@ class WelcomeScreen extends StatelessWidget { ...@@ -41,25 +43,40 @@ class WelcomeScreen extends StatelessWidget {
const SizedBox( const SizedBox(
height: 50, height: 50,
), ),
Padding( Container(
padding: const EdgeInsets.all(20), margin:
child: FlatButton( const EdgeInsets.only(left: 20, right: 20, bottom: 20),
onPressed: () { child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Material(
color: Colors.transparent,
child: InkWell(
splashColor: Colors.cyan.withOpacity(0.2),
highlightColor: Colors.cyan.withOpacity(0.2),
onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const LoginScreen())); builder: (context) =>
const SignInScreen()));
}, },
child: Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.cyan, color: Colors.cyan,
shape: RoundedRectangleBorder( border: Border.all(
borderRadius: BorderRadius.circular(50)), color: Colors.transparent, width: 4)),
padding: const EdgeInsets.all(25),
child: const Text( child: const Text(
"Log In", "Log In",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.black, fontWeight: FontWeight.bold,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold), color: Colors.black),
),
),
),
), ),
), ),
), ),
...@@ -100,26 +117,39 @@ class WelcomeScreen extends StatelessWidget { ...@@ -100,26 +117,39 @@ class WelcomeScreen extends StatelessWidget {
), ),
), ),
), ),
Padding( Container(
padding: margin:
const EdgeInsets.only(left: 20, right: 20, bottom: 20), const EdgeInsets.only(left: 20, right: 20, bottom: 20),
child: FlatButton( child: ClipRRect(
onPressed: () { borderRadius: BorderRadius.circular(50),
child: Material(
color: Colors.transparent,
child: InkWell(
splashColor: Colors.cyan.withOpacity(0.2),
highlightColor: Colors.cyan.withOpacity(0.2),
onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const HomePage())); builder: (context) => const AdminScreen()));
}, },
color: Colors.cyan, child: Container(
shape: RoundedRectangleBorder( padding: const EdgeInsets.all(20),
borderRadius: BorderRadius.circular(50)), decoration: BoxDecoration(
padding: const EdgeInsets.all(25), borderRadius: BorderRadius.circular(50),
color: Colors.transparent,
border:
Border.all(color: Colors.cyan, width: 4)),
child: const Text( child: const Text(
"Get Started", "Admin",
textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.black, fontWeight: FontWeight.bold,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold), color: Colors.black),
),
),
),
), ),
), ),
), ),
......
import 'package:flutter/material.dart';
hexStringToColor(String hexColor) {
hexColor = hexColor.toUpperCase().replaceAll("#", "");
if (hexColor.length == 6) {
hexColor = "FF$hexColor";
}
return Color(int.parse(hexColor, radix: 6));
}
import 'package:canis_care/screens/chat_bot.dart';
import 'package:canis_care/screens/disease_intelligence_screen.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../screens/home_screen.dart';
class BotBar extends StatelessWidget { class BotBar extends StatelessWidget {
const BotBar({Key? key}) : super(key: key); const BotBar({Key? key}) : super(key: key);
...@@ -25,7 +29,11 @@ class BotBar extends StatelessWidget { ...@@ -25,7 +29,11 @@ class BotBar extends StatelessWidget {
size: 30, size: 30,
color: Colors.blue, color: Colors.blue,
), ),
onPressed: () {}, onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const HomePage()),
);
},
), ),
), ),
), ),
...@@ -33,11 +41,15 @@ class BotBar extends StatelessWidget { ...@@ -33,11 +41,15 @@ class BotBar extends StatelessWidget {
child: Material( child: Material(
child: IconButton( child: IconButton(
icon: const Icon( icon: const Icon(
Icons.add_a_photo, Icons.camera_alt,
size: 30, size: 30,
color: Colors.blue, color: Colors.blue,
), ),
onPressed: () {}, onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const HomePage()),
);
},
), ),
), ),
), ),
...@@ -45,11 +57,16 @@ class BotBar extends StatelessWidget { ...@@ -45,11 +57,16 @@ class BotBar extends StatelessWidget {
child: Material( child: Material(
child: IconButton( child: IconButton(
icon: const Icon( icon: const Icon(
Icons.account_circle, Icons.info_rounded,
size: 30, size: 30,
color: Colors.blue, color: Colors.blue,
), ),
onPressed: () {}, onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => const DiseaseIntelligence()),
);
},
), ),
), ),
), ),
...@@ -57,11 +74,15 @@ class BotBar extends StatelessWidget { ...@@ -57,11 +74,15 @@ class BotBar extends StatelessWidget {
child: Material( child: Material(
child: IconButton( child: IconButton(
icon: const Icon( icon: const Icon(
Icons.ac_unit_rounded, Icons.chat_rounded,
size: 30, size: 30,
color: Colors.blue, color: Colors.blue,
), ),
onPressed: () {}, onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => ChatBot()),
);
},
), ),
), ),
), ),
......
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_fonts/google_fonts.dart';
class LoadingPage extends StatelessWidget {
const LoadingPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.indigo,
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SpinKitFadingCircle(
color: Colors.cyan,
size: 100.0,
),
Text(
"Please Wait...",
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 26,
fontWeight: FontWeight.bold,
color: Colors.lightGreenAccent),
),
),
]),
),
);
}
}
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class NavigationControls extends StatelessWidget {
const NavigationControls({required this.controller, super.key});
final Completer<WebViewController> controller;
@override
Widget build(BuildContext context) {
return FutureBuilder<WebViewController>(
future: controller.future,
builder: (context, snapshot) {
final WebViewController? controller = snapshot.data;
if (snapshot.connectionState != ConnectionState.done ||
controller == null) {
return Row(
children: const <Widget>[
Icon(Icons.arrow_back_ios),
Icon(Icons.arrow_forward_ios),
Icon(Icons.replay),
],
);
}
return Row(
children: <Widget>[
IconButton(
icon: const Icon(Icons.arrow_back_ios),
onPressed: () async {
if (await controller.canGoBack()) {
await controller.goBack();
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('No back history item')),
);
return;
}
},
),
IconButton(
icon: const Icon(Icons.arrow_forward_ios),
onPressed: () async {
if (await controller.canGoForward()) {
await controller.goForward();
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('No forward history item')),
);
return;
}
},
),
IconButton(
icon: const Icon(Icons.replay),
onPressed: () {
controller.reload();
},
),
],
);
},
);
}
}
import 'package:flutter/material.dart';
Image logoWidget(String imageName) {
return Image.asset(
imageName,
fit: BoxFit.fitWidth,
width: 240,
height: 240,
color: Colors.white,
);
}
TextField reusableTextField(String text, IconData icon, bool isPasswordType,
TextEditingController controller) {
return TextField(
controller: controller,
obscureText: isPasswordType,
enableSuggestions: !isPasswordType,
autocorrect: !isPasswordType,
cursorColor: Colors.black,
style: TextStyle(color: Colors.black.withOpacity(0.9)),
decoration: InputDecoration(
prefixIcon: Icon(
icon,
color: Colors.blueGrey,
),
labelText: text,
labelStyle:
const TextStyle(color: Colors.blueGrey, fontWeight: FontWeight.bold),
filled: true,
floatingLabelBehavior: FloatingLabelBehavior.never,
fillColor: Colors.white.withOpacity(0.3),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30.0),
borderSide: const BorderSide(width: 0, style: BorderStyle.none)),
),
keyboardType: isPasswordType
? TextInputType.visiblePassword
: TextInputType.emailAddress,
);
}
Container firebaseUIButton(BuildContext context, String title, Function onTap) {
return Container(
width: MediaQuery.of(context).size.width,
height: 50,
margin: const EdgeInsets.fromLTRB(0, 10, 0, 20),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(90)),
child: ElevatedButton(
onPressed: () {
onTap();
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.pressed)) {
return Colors.cyan.withOpacity(0.8);
}
return Colors.white;
}),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)))),
child: Text(
title,
style: const TextStyle(
color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 16),
),
),
);
}
import 'package:canis_care/screens/chat_bot.dart';
import 'package:canis_care/widgets/side_drawer_tile.dart'; import 'package:canis_care/widgets/side_drawer_tile.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:ternav_icons/ternav_icons.dart'; import 'package:ternav_icons/ternav_icons.dart';
import '../screens/disease_intelligence_screen.dart';
import '../screens/home_screen.dart'; import '../screens/home_screen.dart';
class SideDrawer extends StatelessWidget { class SideDrawer extends StatelessWidget {
...@@ -42,15 +44,17 @@ class SideDrawer extends StatelessWidget { ...@@ -42,15 +44,17 @@ class SideDrawer extends StatelessWidget {
icon: TernavIcons.lightOutline.info_1, icon: TernavIcons.lightOutline.info_1,
title: "Disease Information", title: "Disease Information",
onTap: () { onTap: () {
// Navigator.of(context).push( Navigator.of(context).push(MaterialPageRoute(
// MaterialPageRoute(builder: (context) => const HomePage()), builder: (context) => const DiseaseIntelligence()));
// );
}, },
), ),
DrawerListTile( DrawerListTile(
icon: TernavIcons.lightOutline.message, icon: TernavIcons.lightOutline.message,
title: "Chat Service", title: "Chat Service",
onTap: () {}, onTap: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => ChatBot()));
},
), ),
const SizedBox( const SizedBox(
height: 10, height: 10,
......
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
enum _MenuOptions {
navigationDelegate,
}
class Menu extends StatelessWidget {
const Menu({required this.controller, super.key});
final Completer<WebViewController> controller;
@override
Widget build(BuildContext context) {
return FutureBuilder<WebViewController>(
future: controller.future,
builder: (context, controller) {
return PopupMenuButton<_MenuOptions>(
onSelected: (value) async {
switch (value) {
case _MenuOptions.navigationDelegate:
await controller.data!.loadUrl('https://youtube.com');
break;
}
},
itemBuilder: (context) => [
const PopupMenuItem<_MenuOptions>(
value: _MenuOptions.navigationDelegate,
child: Text('Navigate to YouTube'),
),
],
);
},
);
}
}
This diff is collapsed.
This diff is collapsed.
...@@ -40,9 +40,19 @@ dependencies: ...@@ -40,9 +40,19 @@ dependencies:
font_awesome_flutter: ^10.2.1 font_awesome_flutter: ^10.2.1
flutter_staggered_animations: any flutter_staggered_animations: any
google_fonts: google_fonts:
tflite: ^1.1.2 # tflite: ^1.1.2
meta: ^1.8.0 meta: ^1.8.0
image_picker: ^0.8.5+3 image_picker: ^0.8.5+3
url_launcher: ^6.1.6
flutter_spinkit: ^5.1.0
webview_flutter: ^3.0.4
bubble: ^1.2.1
firebase_core: ^1.24.0
firebase_auth: ^3.11.2
localstorage: ^4.0.0+1
badges: ^2.0.3
cloud_firestore:
basic_utils: any
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
...@@ -101,11 +111,19 @@ flutter: ...@@ -101,11 +111,19 @@ flutter:
- images/symbols/bacterial.png - images/symbols/bacterial.png
- images/symbols/viral.png - images/symbols/viral.png
- images/symbols/2.jpg - images/symbols/2.jpg
- images/symbols/Admin1.jpg
- images/symbols/Admin2.jpg
- images/symbols/extract5.png
- images/symbols/userm.png
- images/symbols/dogs.jpg
- images/symbols/preprocess.png
- images/symbols/onto.png
- images/symbols/onto2.png
- assets/skinDiseaseIdentificationModel.tflite - assets/skinDiseaseIdentificationModel.tflite
- assets/labels.txt - assets/labels.txt
- assets/newdog1model1.tflite - assets/newdog1model1.tflite
- assets/levels-s.txt - assets/levels-s.txt
- assets/severitymodel.tflite - assets/noneSeverityModel.tflite
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment