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 '../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: [
......@@ -96,7 +101,7 @@ class DiseaseDetails extends StatelessWidget {
width: 10,
),
Text(
"${disease.diseaseName} ${categories[index].topic}",
"${disease.diseaseName} ${categories[index].topic}",
style: const TextStyle(
fontSize: 20, color: Colors.white),
)
......
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;
import '../models/category.dart';
import '../models/disease.dart';
import '../models/disease_individual.dart';
import '../models/disease_individual_info.dart';
import '../widgets/bottom_nav_bar.dart';
class DiseaseIndividualTopicInfo extends StatefulWidget {
final Disease disease;
final Category category;
final DiseaseIndividualTopic diseaseIndividualTopic;
const DiseaseIndividualTopicInfo(
{Key? key,
required this.disease,
required this.category,
required this.diseaseIndividualTopic})
: super(key: key);
@override
State<DiseaseIndividualTopicInfo> createState() =>
_DiseaseIndividualTopicInfoState();
}
class _DiseaseIndividualTopicInfoState
extends State<DiseaseIndividualTopicInfo> {
Client client = http.Client();
List<String> subTopicsInfo = [];
List<DiseaseIndividualSubTopicInfo> subTopicInfoList = [];
int pageIndex = 0;
PageController? _pageController;
@override
void dispose() {
super.dispose();
_pageController?.dispose();
}
@override
void initState() {
_retrieveSubTopicsDetails();
super.initState();
_pageController = PageController();
}
_retrieveSubTopicsDetails() async {
subTopicsInfo = [];
String retrieveUri = "http://192.168.1.102:8000/disease/" +
widget.disease.diseaseName +
"/" +
widget.category.topic +
"/" +
widget.diseaseIndividualTopic.individualTopic +
"/";
List responses = json.decode(
utf8.decode((await client.get(Uri.parse(retrieveUri))).bodyBytes));
for (var element in responses) {
// String res = element.substring(element.indexOf('#'));
// String res2 = res.replaceAll("#", "");
var encoded = utf8.encode(element);
var decoded = utf8.decode(encoded);
var formatted = decoded.substring(1);
subTopicsInfo.add(formatted);
}
// var newDiseases = List<String>.from(diseases);
subTopicInfoList = List.generate(
subTopicsInfo.length,
(index) => DiseaseIndividualSubTopicInfo(
imgUrl: widget.category.icon,
individualTopicInfo: subTopicsInfo[index]));
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.diseaseIndividualTopic.individualTopic),
),
body: Container(
child: Stack(children: [
Column(
children: [
Expanded(
child: PageView(
controller: _pageController,
onPageChanged: (int page) {
setState(() {
pageIndex = page;
});
},
children: List.generate(
subTopicInfoList.length,
(index) => Container(
padding: const EdgeInsets.only(
left: 40, right: 40, top: 40, bottom: 20),
margin: const EdgeInsets.only(
left: 40, right: 40, top: 40, bottom: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(50),
boxShadow: [
BoxShadow(
color: Colors.cyan.withOpacity(0.5),
blurRadius: 20,
offset: Offset.zero),
]),
child: Column(
children: [
Expanded(
child: Column(
children: [
Image.asset(
subTopicInfoList[index].imgUrl,
fit: BoxFit.cover,
height: 160,
width: 160,
),
const SizedBox(
height: 40,
),
Expanded(
flex: 1,
child: RawScrollbar(
thumbColor: Colors.redAccent,
radius: Radius.circular(20),
thickness: 10,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: ClipRRect(
borderRadius:
BorderRadius.circular(12.0),
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(16),
color: Colors.blue,
),
margin: EdgeInsets.only(
top: 5.0, bottom: 15),
child: Card(
child: Container(
margin: EdgeInsets.only(
bottom: 30),
padding: EdgeInsets.all(5.0),
child: Text(
subTopicInfoList[index]
.individualTopicInfo,
textAlign: TextAlign.start,
style: const TextStyle(
color: Colors.cyan,
fontSize: 20),
),
),
),
),
),
),
),
),
],
)),
Visibility(
visible: index == subTopicInfoList.length - 1,
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: FlatButton(
onPressed: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// DiseaseDetails(
// disease: diseaseList[index],
// )),
// );
},
color: Colors.cyan,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(50)),
padding: const EdgeInsets.all(15),
child: const Text(
"See Also",
style: TextStyle(
color: Colors.black,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
),
],
),
)),
),
),
RawScrollbar(
thumbColor: Colors.redAccent,
radius: Radius.circular(20),
thickness: 10,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(
subTopicInfoList.length,
(index) => GestureDetector(
onTap: () {
_pageController?.animateTo(
MediaQuery.of(context).size.width * index,
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut);
},
child: Container(
width: 20,
height: 20,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.cyan,
borderRadius: BorderRadius.circular(50),
border: Border.all(
width: 6,
color: pageIndex == index
? Colors.cyanAccent
: Theme.of(context).canvasColor)),
),
)),
),
),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {},
child: Text("HI"),
),
],
),
Positioned(bottom: 0, left: 0, right: 0, child: BotBar())
]),
),
);
}
}
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(
......
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import '../models/disease.dart';
import '../models/disease_description_point.dart';
import '../widgets/side_drawer.dart';
import 'disease_details_screen.dart';
class DiseaseList extends StatefulWidget {
const DiseaseList({Key? key}) : super(key: key);
const DiseaseList({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<DiseaseList> createState() => _DiseaseListState();
......@@ -17,7 +23,9 @@ class DiseaseList extends StatefulWidget {
class _DiseaseListState extends State<DiseaseList> {
Client client = http.Client();
List<String> diseases = [];
List<Disease> diseaseList = [];
List<Disease> allDiseaseList = [];
List<String> diseaseDescriptions = [];
List<DiseaseDescriptionPoint> diseaseDescriptionsList = [];
@override
void initState() {
......@@ -25,9 +33,31 @@ class _DiseaseListState extends State<DiseaseList> {
super.initState();
}
_retrieveDiseaseDescription(disease) async {
diseaseDescriptions = [];
String retrieveUri = "http://192.168.1.102:8000/disease/" + disease + "/";
List responses = json.decode(
utf8.decode((await client.get(Uri.parse(retrieveUri))).bodyBytes));
for (var element in responses) {
// String res = element.substring(element.indexOf('#'));
// String res2 = res.replaceAll("#", "");
var encoded = utf8.encode(element);
var decoded = utf8.decode(encoded);
var formatted = decoded.substring(1);
diseaseDescriptions.add(formatted);
}
var newDiseases = List<String>.from(diseaseDescriptions);
diseaseDescriptionsList = List.generate(
diseaseDescriptions.length,
(index) => DiseaseDescriptionPoint(
descriptionPoint: diseaseDescriptions[index]));
setState(() {});
}
_retrieveDiseases() async {
diseases = [];
String retrieveUri = "http://192.168.1.5:8000/diseases/";
String retrieveUri = "https://canis-care-app.herokuapp.com/diseases/";
List responses =
json.decode((await client.get(Uri.parse(retrieveUri))).body);
......@@ -37,78 +67,404 @@ class _DiseaseListState extends State<DiseaseList> {
diseases.add(element);
}
// var newDiseases = List<String>.from(diseases);
diseaseList = List.generate(
allDiseaseList = List.generate(
diseases.length, (index) => Disease(diseaseName: diseases[index]));
diseaseList = List.from(allDiseaseList);
setState(() {});
}
List<Disease> diseaseList = [];
void updateDiseaseList(String item) {
setState(() {
diseaseList = allDiseaseList
.where((element) =>
element.diseaseName.toLowerCase().contains(item.toLowerCase()))
.toList();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Diseases")),
body: GridView.builder(
itemCount: diseaseList.length,
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 15,
childAspectRatio: 2.5,
crossAxisCount: 1,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseaseDetails(
disease: diseaseList[index],
)),
);
},
drawer: SideDrawer(),
appBar: AppBar(
title: Text(widget.title, textAlign: TextAlign.center),
actions: [
Container(
margin: const EdgeInsets.only(right: 40),
padding: EdgeInsets.all(10.0),
child: ClipOval(
child: Icon(Icons.ac_unit_rounded),
),
)
],
),
body: RefreshIndicator(
onRefresh: () async {
_retrieveDiseases();
},
child: Container(
color: Colors.blue[100],
child: Column(children: [
Padding(
padding: EdgeInsets.all(16),
child: TextField(
onChanged: (value) => updateDiseaseList(value),
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
filled: true,
fillColor: Color(0xff302390),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide.none),
hintText: "Search diseases...",
hintStyle: TextStyle(color: Colors.cyan),
prefixIcon: Icon(
Icons.search,
color: Colors.white,
),
prefixIconColor: Colors.purple.shade900),
),
),
Expanded(
child: Container(
margin: const EdgeInsets.only(left: 15, top: 30, right: 15),
decoration: BoxDecoration(
color: const Color(0xff87CEEB),
borderRadius: BorderRadius.circular(15)),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 24, vertical: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
diseaseList[index].diseaseName,
style: const TextStyle(
fontSize: 17,
color: Colors.black,
fontWeight: FontWeight.w900),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 40,
width: 7,
decoration: BoxDecoration(
color: const Color(0xff369FFF),
borderRadius: BorderRadius.circular(15)),
),
Text(
diseaseList[index].diseaseName,
style: const TextStyle(
fontSize: 20,
margin: const EdgeInsets.only(top: 0.0),
child: RawScrollbar(
thumbColor: Colors.redAccent,
radius: Radius.circular(10),
thickness: 10,
child: ListView.builder(
itemCount: diseaseList.length,
itemBuilder: (BuildContext context, int index) {
return AnimationConfiguration.staggeredGrid(
position: index,
columnCount: diseaseList.length,
child: SlideAnimation(
child: FadeInAnimation(
child: GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseaseDetails(
disease: diseaseList[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.blue,
),
child: Row(children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
diseaseList[index].diseaseName,
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white),
),
),
const SizedBox(
height: 12,
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Icon(
Icons.remove_red_eye_outlined,
size: 22,
),
const SizedBox(width: 8),
// Text(
// "Get More...",
// style: GoogleFonts.lato(
// textStyle: TextStyle(
// fontSize: 15,
// fontWeight: FontWeight.w800,
// ),
// ),
// ),
Padding(
padding:
const EdgeInsets.all(0),
child: FlatButton(
onPressed: () {
Navigator.of(context)
.push(
MaterialPageRoute(
builder: (context) =>
DiseaseDetails(
disease:
diseaseList[
index],
)),
);
},
color: Colors.cyan,
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(
50)),
padding:
const EdgeInsets.all(5),
child: const Text(
"Get More",
style: TextStyle(
color: Colors.black,
fontSize: 15,
fontWeight:
FontWeight.bold),
),
),
),
],
),
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: Color(0xff006ED3),
color: Colors.white),
),
),
),*/
IconButton(
onPressed: () async {
await _retrieveDiseaseDescription(
diseaseList[index].diseaseName);
_showTestDialog(
context,
diseaseList[index].diseaseName,
diseaseDescriptionsList,
diseaseList[index]);
},
icon: const Icon(
Icons.perm_device_info_rounded,
size: 30,
),
),
]),
),
),
// 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()),
// )
// }),
// ),
// ),
),
),
)
],
)
],
),
),
);
},
),
),
),
);
}),
),
]),
),
),
// floatingActionButton: FloatingActionButton(
// onPressed: () => Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => CreatePage(
// client: client,
// ))),
// tooltip: 'Increment',
// child: const Icon(Icons.add),
// ), // This trailing comma makes auto-formatting nicer for build methods.
);
}
void _showTestDialog(
BuildContext context,
String diseaseName,
List<DiseaseDescriptionPoint> diseaseDescriptionsList,
Disease diseaseList) {
showDialog(
context: context,
barrierDismissible: false,
//context: _scaffoldKey.currentContext,
builder: (context) {
return AlertDialog(
backgroundColor: Colors.blue[100],
elevation: 50.0,
contentPadding: EdgeInsets.only(left: 25, right: 25),
title: Center(child: Text("About " + diseaseName)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20.0))),
content: Container(
height: 440,
width: 600,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
height: 200,
child: RawScrollbar(
thumbColor: Colors.redAccent,
radius: Radius.circular(20),
thickness: 10,
child: ListView.builder(
itemCount: diseaseDescriptionsList.length,
itemBuilder: (BuildContext context, int index) {
return AnimationConfiguration.staggeredGrid(
columnCount: diseaseDescriptionsList.length,
position: index,
child: SlideAnimation(
child: FadeInAnimation(
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(16),
color: Colors.blue,
),
margin: EdgeInsets.only(top: 5.0),
child: Card(
elevation: 5.0,
child: ListTile(
title: Text(
diseaseDescriptionsList[index]
.descriptionPoint,
style: GoogleFonts.lato(
textStyle: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),
),
),
),
),
);
}),
),
),
),
),
],
),
),
actions: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.20,
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.1),
child: RaisedButton(
child: Text(
'More...',
style: TextStyle(color: Colors.white),
),
color: Color(0xFF32CD32),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseaseDetails(
disease: diseaseList,
)),
);
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.1,
),
Padding(
padding: const EdgeInsets.only(right: 40.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.20,
child: RaisedButton(
child: new Text(
'Close',
style: TextStyle(color: Colors.white),
),
color: Color(0xFFFF0000),
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(30.0),
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
),
],
)
],
);
});
}
}
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