Commit 1dfd0b7f authored by Wickramasinghe R.J.P's avatar Wickramasinghe R.J.P

Merge branch 'mobile_app_v1' into 'master'

side drawer and home page added

See merge request 2022-226/intelligent_system_for_skin_diseases!2
parents 795766ca d193cdba
import 'dart:ui';
import '../models/category.dart';
import '../models/component.dart';
class Utils {
static List<ComponentCategory> getComponentCategories() {
return [
ComponentCategory(
categoryName: "All Diseases", imgUrl: "images/symbols/all.png"),
ComponentCategory(
categoryName: "Allergic Diseases",
imgUrl: "images/symbols/allergic.png"),
ComponentCategory(
categoryName: "Viral Diseases", imgUrl: "images/symbols/viral.png"),
ComponentCategory(
categoryName: "Bacterial Diseases",
imgUrl: "images/symbols/bacterial.png"),
];
}
static List<Category> getMockedCategories() {
return [
Category(
......
class ComponentCategory {
late String categoryName;
late String imgUrl;
ComponentCategory({
required this.categoryName,
required this.imgUrl,
});
}
import 'package:canis_care/screens/disease_screen.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../data/disease_sub_topics.dart';
import '../models/component.dart';
import '../widgets/side_drawer.dart';
class DiseaseIntelligence extends StatefulWidget {
const DiseaseIntelligence({Key? key}) : super(key: key);
@override
State<DiseaseIntelligence> createState() => _DiseaseIntelligenceState();
}
class _DiseaseIntelligenceState extends State<DiseaseIntelligence> {
final List<ComponentCategory> componentCategories =
Utils.getComponentCategories();
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: SideDrawer(),
appBar: AppBar(
title: Text(
"Home Page",
textAlign: TextAlign.center,
),
),
body: Container(
color: Colors.blue[100],
alignment: Alignment.center,
child: Column(
children: [
ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(60),
bottomRight: Radius.circular(60),
),
child: Stack(
children: [
Container(
height: 250,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
'images/symbols/dogvet2.jpg',
),
fit: BoxFit.cover)),
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Colors.black.withOpacity(0.6),
Colors.transparent
])),
)),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(bottom: 10),
child: Text(
"CANIS CARE",
style: GoogleFonts.bungeeShade(
textStyle: const TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: Colors.cyan),
),
),
)
],
))
],
),
),
SizedBox(
height: 20,
),
Expanded(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(60),
topRight: Radius.circular(60),
),
child: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
'images/symbols/2.jpg',
),
fit: BoxFit.cover,
opacity: 0.2)),
child: GridView.count(
crossAxisCount: 2,
children: List.generate(
componentCategories.length,
(index) => GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DiseaseList()),
);
},
child: Container(
padding: const EdgeInsets.only(
top: 10, left: 10, right: 10, bottom: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(60),
child: Container(
decoration: BoxDecoration(
color:
Colors.blueAccent.withOpacity(0.6)),
child: Column(
children: [
Image.asset(
componentCategories[index].imgUrl,
fit: BoxFit.cover,
width: 100,
height: 100,
),
const SizedBox(
height: 10,
),
Text(
componentCategories[index]
.categoryName,
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
)
],
),
),
),
),
)),
),
),
]),
))
],
),
),
);
}
}
This diff is collapsed.
import 'package:canis_care/screens/home_screen.dart';
import 'package:canis_care/screens/login_screen.dart';
import 'package:canis_care/screens/signup_screen.dart';
import 'package:flutter/material.dart';
......@@ -48,7 +49,7 @@ class WelcomeScreen extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DiseaseList()));
builder: (context) => const LoginScreen()));
},
color: Colors.cyan,
shape: RoundedRectangleBorder(
......@@ -100,6 +101,29 @@ class WelcomeScreen extends StatelessWidget {
),
),
),
Padding(
padding:
const EdgeInsets.only(left: 20, right: 20, bottom: 20),
child: FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const HomePage()));
},
color: Colors.cyan,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
padding: const EdgeInsets.all(25),
child: const Text(
"Get Started",
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.bold),
),
),
),
],
),
)
......
import 'package:canis_care/widgets/side_drawer_tile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ternav_icons/ternav_icons.dart';
import '../screens/home_screen.dart';
class SideDrawer extends StatelessWidget {
const SideDrawer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Drawer(
width: MediaQuery.of(context).size.width / 1.5,
child: ListView(
shrinkWrap: true,
children: [
SizedBox(
height: 160,
child: DrawerHeader(
decoration: BoxDecoration(color: Colors.blue[100]),
child: Image.asset(
"images/symbols/logo.png",
)),
),
DrawerListTile(
icon: TernavIcons.lightOutline.profile,
title: "My Profile",
onTap: () {},
),
DrawerListTile(
icon: TernavIcons.bold.scan,
title: "Identify Disease",
onTap: () {},
),
DrawerListTile(
icon: TernavIcons.bold.in_progress,
title: "Severity Level",
onTap: () {},
),
DrawerListTile(
icon: TernavIcons.lightOutline.info_1,
title: "Disease Information",
onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(builder: (context) => const HomePage()),
// );
},
),
DrawerListTile(
icon: TernavIcons.lightOutline.message,
title: "Chat Service",
onTap: () {},
),
const SizedBox(
height: 10,
),
Image.asset(
"images/symbols/help.png",
height: 120,
),
const SizedBox(
height: 10,
),
Container(
height: 100,
margin: const EdgeInsets.all(24),
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.blue[100],
borderRadius: BorderRadius.circular(15)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Text("Upgrade your plan",
style: TextStyle(fontWeight: FontWeight.bold)),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Go to Pro",
style: TextStyle(
color: Colors.blue[900],
fontWeight: FontWeight.w800)),
InkWell(
onTap: () {},
child: Container(
height: 30,
width: 30,
decoration: BoxDecoration(
border: Border.all(color: const Color(0xff369FFF)),
borderRadius: BorderRadius.circular(10),
),
child: const Icon(
Icons.keyboard_double_arrow_right_rounded,
color: Colors.blue,
),
),
)
],
)
],
),
),
],
),
);
}
}
import 'package:flutter/material.dart';
class DrawerListTile extends StatelessWidget {
const DrawerListTile({
Key? key,
required this.icon,
required this.title,
required this.onTap,
}) : super(key: key);
final IconData icon;
final String title;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
return ListTile(
onTap: onTap,
horizontalTitleGap: 0,
leading: Icon(
icon,
color: Colors.black,
size: 20,
),
title: Text(
title,
style: const TextStyle(color: Colors.cyan, fontWeight: FontWeight.w600),
),
);
}
}
......@@ -43,6 +43,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
cupertino_icons:
dependency: "direct main"
description:
......@@ -57,6 +64,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.4"
flutter:
dependency: "direct main"
description: flutter
......@@ -69,13 +90,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_staggered_animations:
dependency: "direct main"
description:
name: flutter_staggered_animations
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: "direct main"
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.2.1"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
http:
dependency: "direct dev"
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
......@@ -123,6 +165,76 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.20"
path_provider_ios:
dependency: transitive
description:
name: path_provider_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.7"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.4"
sky_engine:
dependency: transitive
description: flutter
......@@ -163,6 +275,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
ternav_icons:
dependency: "direct main"
description:
name: ternav_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
test_api:
dependency: transitive
description:
......@@ -184,5 +303,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
vertical_card_pager:
dependency: "direct main"
description:
name: vertical_card_pager
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+2"
sdks:
dart: ">=2.17.6 <3.0.0"
flutter: ">=3.0.0"
......@@ -34,6 +34,12 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
http: ^0.13.5
vertical_card_pager: ^1.5.0
ternav_icons: ^1.0.0
font_awesome_flutter: ^10.2.1
flutter_staggered_animations: any
google_fonts:
dev_dependencies:
flutter_test:
......@@ -80,6 +86,18 @@ flutter:
- images/dog_prevention-removebg.png
- images/dog_area-removebg.png
- images/dog_sy2-removebg.png
- images/symbols/img1.png
- images/symbols/brand.png
- images/symbols/help.png
- images/symbols/logo.png
- images/symbols/dog_sy-removebg-preview.png
- images/symbols/dogvet.jpg
- images/symbols/dogvet2.jpg
- images/symbols/all.png
- images/symbols/allergic.png
- images/symbols/bacterial.png
- images/symbols/viral.png
- images/symbols/2.jpg
# - images/a_dot_ham.jpeg
# 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