Commit 43228676 authored by Wickramasinghe R.J.P's avatar Wickramasinghe R.J.P

Merge branch 'mobile_app_v1' into 'master'

display information using onboarding screens

See merge request !3
parents 1dfd0b7f 564e0c5d
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 '../data/disease_sub_topics.dart';
......@@ -15,6 +16,8 @@ class DiseaseDetails extends StatelessWidget {
return Scaffold(
appBar: AppBar(title: const Text('Disease Information')),
body: Container(
color: Colors.blue[100],
padding: EdgeInsets.only(bottom: 30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
......@@ -31,15 +34,17 @@ class DiseaseDetails extends StatelessWidget {
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) => DiseaseSubTopic(
// disease: disease,
// category: categories[index])),
// );
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseaseIndividual(
disease: disease,
category: categories[index],
)),
);
},
child: Container(
margin: const EdgeInsets.all(20),
margin: const EdgeInsets.only(
left: 15, right: 15, bottom: 15, top: 10),
height: 120,
child: Stack(
children: [
......
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> {
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseaseList()),
builder: (context) => DiseaseList(
title: 'All Diseases',
)),
);
},
child: Container(
......
This diff is collapsed.
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:google_fonts/google_fonts.dart';
......@@ -18,12 +18,6 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
drawer: SideDrawer(),
appBar: AppBar(
title: const Text(
"Home Page",
textAlign: TextAlign.center,
),
),
body: Container(
color: Colors.blue[100],
alignment: Alignment.center,
......@@ -37,7 +31,7 @@ class _HomePageState extends State<HomePage> {
child: Stack(
children: [
Container(
height: 250,
height: 350,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
......@@ -102,14 +96,14 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(16),
crossAxisSpacing: 5,
mainAxisSpacing: 5,
maxCrossAxisExtent: 250.0,
maxCrossAxisExtent: 280.0,
children: [
GestureDetector(
child: Container(
padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(60),
borderRadius: BorderRadius.circular(40),
child: Container(
decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)),
......@@ -143,7 +137,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(60),
borderRadius: BorderRadius.circular(40),
child: Container(
decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)),
......@@ -183,7 +177,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(60),
borderRadius: BorderRadius.circular(40),
child: Container(
decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)),
......@@ -217,7 +211,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(60),
borderRadius: BorderRadius.circular(40),
child: Container(
decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.6)),
......
......@@ -29,13 +29,12 @@ class WelcomeScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Center(
child: ClipOval(
child: Container(
width: 180,
height: 180,
color: Colors.transparent,
alignment: Alignment.center,
child: Image.asset("images/logo1.png"),
child: CircleAvatar(
backgroundColor: Colors.cyan,
radius: 80.0,
child: CircleAvatar(
radius: 70.0,
child: ClipOval(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