Commit 564e0c5d authored by Wickramasinghe R.J.P's avatar Wickramasinghe R.J.P

display information using onboarding screens

parent 1dfd0b7f
class DiseaseDescriptionPoint {
late String descriptionPoint;
DiseaseDescriptionPoint({
required this.descriptionPoint,
});
}
class DiseaseIndividualTopic {
late String individualTopic;
DiseaseIndividualTopic({
required this.individualTopic,
});
}
class DiseaseIndividualSubTopicInfo {
late String individualTopicInfo;
late String imgUrl;
DiseaseIndividualSubTopicInfo({
required this.individualTopicInfo,
required this.imgUrl,
});
}
import 'package:canis_care/screens/disease_individual_screen.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../data/disease_sub_topics.dart'; import '../data/disease_sub_topics.dart';
...@@ -15,6 +16,8 @@ class DiseaseDetails extends StatelessWidget { ...@@ -15,6 +16,8 @@ class DiseaseDetails extends StatelessWidget {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Disease Information')), appBar: AppBar(title: const Text('Disease Information')),
body: Container( body: Container(
color: Colors.blue[100],
padding: EdgeInsets.only(bottom: 30),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
...@@ -31,15 +34,17 @@ class DiseaseDetails extends StatelessWidget { ...@@ -31,15 +34,17 @@ class DiseaseDetails extends StatelessWidget {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
// Navigator.of(context).push( Navigator.of(context).push(
// MaterialPageRoute( MaterialPageRoute(
// builder: (context) => DiseaseSubTopic( builder: (context) => DiseaseIndividual(
// disease: disease, disease: disease,
// category: categories[index])), category: categories[index],
// ); )),
);
}, },
child: Container( child: Container(
margin: const EdgeInsets.all(20), margin: const EdgeInsets.only(
left: 15, right: 15, bottom: 15, top: 10),
height: 120, height: 120,
child: Stack( child: Stack(
children: [ children: [
...@@ -96,7 +101,7 @@ class DiseaseDetails extends StatelessWidget { ...@@ -96,7 +101,7 @@ class DiseaseDetails extends StatelessWidget {
width: 10, width: 10,
), ),
Text( Text(
"${disease.diseaseName} ${categories[index].topic}", "${disease.diseaseName} ${categories[index].topic}",
style: const TextStyle( style: const TextStyle(
fontSize: 20, color: Colors.white), fontSize: 20, color: Colors.white),
) )
......
This diff is collapsed.
import 'dart:convert';
import 'package:canis_care/models/disease_individual.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;
import '../models/category.dart';
import '../models/disease.dart';
import '../widgets/bottom_nav_bar.dart';
import 'disease_individual_info_screen.dart';
class DiseaseIndividual extends StatefulWidget {
final Disease disease;
final Category category;
const DiseaseIndividual({
Key? key,
required this.disease,
required this.category,
}) : super(key: key);
@override
State<DiseaseIndividual> createState() => _DiseaseIndividualState();
}
class _DiseaseIndividualState extends State<DiseaseIndividual> {
Client client = http.Client();
List<String> subTopics = [];
List<DiseaseIndividualTopic> subTopicList = [];
@override
void initState() {
_retrieveSubTopics();
super.initState();
}
_retrieveSubTopics() async {
subTopics = [];
String retrieveUri = "http://192.168.1.102:8000/disease/" +
widget.disease.diseaseName +
"/" +
widget.category.topic +
"/";
List responses =
json.decode((await client.get(Uri.parse(retrieveUri))).body);
for (var element in responses) {
String res = element.substring(element.indexOf('#'));
String res2 = res.replaceAll("#", "");
subTopics.add(res2);
}
// var newDiseases = List<String>.from(diseases);
subTopicList = List.generate(subTopics.length,
(index) => DiseaseIndividualTopic(individualTopic: subTopics[index]));
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title:
Text(widget.disease.diseaseName + " " + widget.category.topic)),
body: Stack(children: [
Container(
color: Colors.blue[100],
child: Container(
margin: const EdgeInsets.only(top: 15.0),
child: ListView.builder(
itemCount: subTopicList.length,
itemBuilder: (BuildContext context, int index) {
return AnimationConfiguration.staggeredGrid(
position: index,
columnCount: subTopicList.length,
child: SlideAnimation(
child: FadeInAnimation(
child: GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
DiseaseIndividualTopicInfo(
disease: widget.disease,
category: widget.category,
diseaseIndividualTopic:
subTopicList[index],
)),
);
},
child: Container(
margin: const EdgeInsets.only(top: 10.0),
padding: const EdgeInsets.only(left: 5.0, right: 5.0),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
width: MediaQuery.of(context).size.width,
margin: const EdgeInsets.only(bottom: 12),
child: Container(
padding: const EdgeInsets.all(16),
// width: SizeConfig.screenWidth * 0.78,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.cyan,
),
child: Row(children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
subTopicList[index].individualTopic,
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
const SizedBox(width: 8),
],
),
const SizedBox(height: 12),
],
),
),
Container(
margin: const EdgeInsets.symmetric(
horizontal: 10),
height: 60,
width: 1,
color: Colors.grey[200]!.withOpacity(0.7),
),
/* RotatedBox(
quarterTurns: 3,
child: Text(
reminder!.isCompleted == 1 ? "NOTED" : "WAITING",
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
),*/
]),
),
),
// 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()),
// )
// }),
// ),
// ),
),
),
),
),
);
},
),
),
),
Positioned(bottom: 0, left: 0, right: 0, child: BotBar())
]),
);
}
}
...@@ -109,7 +109,9 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> { ...@@ -109,7 +109,9 @@ class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
onTap: () { onTap: () {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => DiseaseList()), builder: (context) => DiseaseList(
title: 'All Diseases',
)),
); );
}, },
child: Container( child: Container(
......
This diff is collapsed.
import 'package:canis_care/models/component.dart'; import 'package:canis_care/models/component.dart';
import 'package:canis_care/screens/disease_intelligence.dart'; import 'package:canis_care/screens/disease_intelligence_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';
...@@ -18,12 +18,6 @@ class _HomePageState extends State<HomePage> { ...@@ -18,12 +18,6 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
drawer: SideDrawer(), drawer: SideDrawer(),
appBar: AppBar(
title: const Text(
"Home Page",
textAlign: TextAlign.center,
),
),
body: Container( body: Container(
color: Colors.blue[100], color: Colors.blue[100],
alignment: Alignment.center, alignment: Alignment.center,
...@@ -37,7 +31,7 @@ class _HomePageState extends State<HomePage> { ...@@ -37,7 +31,7 @@ class _HomePageState extends State<HomePage> {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
height: 250, height: 350,
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
...@@ -102,14 +96,14 @@ class _HomePageState extends State<HomePage> { ...@@ -102,14 +96,14 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
crossAxisSpacing: 5, crossAxisSpacing: 5,
mainAxisSpacing: 5, mainAxisSpacing: 5,
maxCrossAxisExtent: 250.0, maxCrossAxisExtent: 280.0,
children: [ children: [
GestureDetector( GestureDetector(
child: Container( child: Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10), top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(60), borderRadius: BorderRadius.circular(40),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)), color: Colors.blueAccent.withOpacity(0.6)),
...@@ -143,7 +137,7 @@ class _HomePageState extends State<HomePage> { ...@@ -143,7 +137,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10), top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(60), borderRadius: BorderRadius.circular(40),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)), color: Colors.blueAccent.withOpacity(0.6)),
...@@ -183,7 +177,7 @@ class _HomePageState extends State<HomePage> { ...@@ -183,7 +177,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10), top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(60), borderRadius: BorderRadius.circular(40),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)), color: Colors.blueAccent.withOpacity(0.6)),
...@@ -217,7 +211,7 @@ class _HomePageState extends State<HomePage> { ...@@ -217,7 +211,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10), top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(60), borderRadius: BorderRadius.circular(40),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)), color: Colors.blueAccent.withOpacity(0.6)),
......
...@@ -29,13 +29,12 @@ class WelcomeScreen extends StatelessWidget { ...@@ -29,13 +29,12 @@ class WelcomeScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Center( Center(
child: ClipOval( child: CircleAvatar(
child: Container( backgroundColor: Colors.cyan,
width: 180, radius: 80.0,
height: 180, child: CircleAvatar(
color: Colors.transparent, radius: 70.0,
alignment: Alignment.center, child: ClipOval(child: Image.asset("images/logo1.png")),
child: Image.asset("images/logo1.png"),
), ),
), ),
), ),
......
import 'package:flutter/material.dart';
class BotBar extends StatelessWidget {
const BotBar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(color: Colors.blue[100], boxShadow: [
BoxShadow(
blurRadius: 20,
color: Colors.black.withOpacity(0.2),
offset: Offset.zero)
]),
height: 60,
padding: const EdgeInsets.only(bottom: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
ClipOval(
child: Material(
child: IconButton(
icon: const Icon(
Icons.home,
size: 30,
color: Colors.blue,
),
onPressed: () {},
),
),
),
ClipOval(
child: Material(
child: IconButton(
icon: const Icon(
Icons.add_a_photo,
size: 30,
color: Colors.blue,
),
onPressed: () {},
),
),
),
ClipOval(
child: Material(
child: IconButton(
icon: const Icon(
Icons.account_circle,
size: 30,
color: Colors.blue,
),
onPressed: () {},
),
),
),
ClipOval(
child: Material(
child: IconButton(
icon: const Icon(
Icons.ac_unit_rounded,
size: 30,
color: Colors.blue,
),
onPressed: () {},
),
),
),
],
),
);
}
}
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