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.
50 lines
1.2 KiB
Dart
50 lines
1.2 KiB
Dart
import 'package:doctor_app_flutter/widgets/home/home_item.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app.drawer.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class Category {
|
|
final String id;
|
|
final String title;
|
|
final String image;
|
|
|
|
const Category({
|
|
@required this.id,
|
|
@required this.title,
|
|
this.image,
|
|
});
|
|
}
|
|
|
|
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',
|
|
),
|
|
Category(
|
|
id: 'c2',
|
|
title: 'Patient Search',
|
|
image: 'assets/images/user_id_icon.png',
|
|
),
|
|
];
|
|
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))
|
|
.toList(),
|
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
|
maxCrossAxisExtent: 200,
|
|
childAspectRatio: 3 / 2,
|
|
crossAxisSpacing: 20,
|
|
mainAxisSpacing: 20)),
|
|
);
|
|
}
|
|
}
|