You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.8 KiB
Dart
104 lines
2.8 KiB
Dart
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
import '../widgets/home/home_item.dart';
|
|
import '../widgets/shared/app.drawer.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class Category {
|
|
final String id;
|
|
final String title;
|
|
final String image;
|
|
final String link;
|
|
|
|
const Category(
|
|
{@required this.id,
|
|
@required this.title,
|
|
@required this.image,
|
|
@required this.link});
|
|
}
|
|
|
|
class HomeScreen extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
const DUMMY_CATEGORIES = const [
|
|
Category(
|
|
id: 'c1',
|
|
title: 'My Schedule',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: MY_SCHEDULE),
|
|
Category(
|
|
id: 'c2',
|
|
title: 'Patient Search',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENT_SEARCH),
|
|
Category(
|
|
id: 'c3',
|
|
title: 'outPatiant',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENTS),
|
|
Category(
|
|
id: 'c4',
|
|
title: 'InPatiant',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENTS),
|
|
Category(
|
|
id: 'c5',
|
|
title: 'Referral',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENTS),
|
|
Category(
|
|
id: 'c6',
|
|
title: 'Referred',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENTS),
|
|
Category(
|
|
id: 'c7',
|
|
title: 'Discharged Patient',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENTS),
|
|
Category(
|
|
id: 'c8',
|
|
title: 'Referral Discharge',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: PATIENTS),
|
|
Category(
|
|
id: 'c9',
|
|
title: 'Search For Medicine',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: MEDICINE_SEARCH),
|
|
Category(
|
|
id: 'c10',
|
|
title: 'Doctor Reply',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: DOCTOR_REPLY),
|
|
Category(
|
|
id: 'c11',
|
|
title: 'Blood Bank',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: BLOOD_BANK),
|
|
Category(
|
|
id: 'c12',
|
|
title: 'QR Reader',
|
|
image: 'assets/images/user_id_icon.png',
|
|
link: QR_READER),
|
|
];
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text('Home'),
|
|
),
|
|
drawer: AppDrawer(),
|
|
body: GridView(
|
|
padding: EdgeInsets.all(25),
|
|
children: DUMMY_CATEGORIES
|
|
.map((data) =>
|
|
HomeItem(data.id, data.title, data.image, data.link))
|
|
.toList(),
|
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
|
maxCrossAxisExtent: 200,
|
|
childAspectRatio: 3 / 2,
|
|
crossAxisSpacing: 20,
|
|
mainAxisSpacing: 20)),
|
|
);
|
|
}
|
|
}
|