forked from yaso_meth/mih-project
Flutter web App home page, App Bar, Tile Grid & Tiles added
This commit is contained in:
48
Frontend/patient_manager/lib/components/homeTile.dart
Normal file
48
Frontend/patient_manager/lib/components/homeTile.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HomeTile extends StatelessWidget {
|
||||
final String tileName;
|
||||
final String tileDescription;
|
||||
final void Function() onTap;
|
||||
// final Widget tileIcon;
|
||||
|
||||
const HomeTile({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.tileName,
|
||||
required this.tileDescription,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Card(
|
||||
child: Column(
|
||||
//mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.abc),
|
||||
title: Text(
|
||||
tileName,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
subtitle: Text(tileDescription),
|
||||
),
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Icon(Icons.arrow_forward),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
44
Frontend/patient_manager/lib/components/homeTileGrid.dart
Normal file
44
Frontend/patient_manager/lib/components/homeTileGrid.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/homeTile.dart';
|
||||
|
||||
class HomeTileGrid extends StatelessWidget {
|
||||
void navigateToPage() {}
|
||||
|
||||
const HomeTileGrid({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 1000,
|
||||
child: GridView.count(
|
||||
padding: const EdgeInsets.all(20),
|
||||
crossAxisSpacing: 10,
|
||||
mainAxisSpacing: 10,
|
||||
childAspectRatio: MediaQuery.of(context).size.width / 600,
|
||||
crossAxisCount: 3,
|
||||
children: [
|
||||
HomeTile(
|
||||
onTap: navigateToPage,
|
||||
tileName: "Patient Manager",
|
||||
tileDescription:
|
||||
"This is a digital solution for doctors Offices to manage their patients",
|
||||
),
|
||||
HomeTile(
|
||||
onTap: navigateToPage,
|
||||
tileName: "Patient Manager",
|
||||
tileDescription:
|
||||
"This is a digital solution for doctors Offices to manage their patients",
|
||||
),
|
||||
HomeTile(
|
||||
onTap: navigateToPage,
|
||||
tileName: "Patient Manager",
|
||||
tileDescription:
|
||||
"This is a digital solution for doctors Offices to manage their patients",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
24
Frontend/patient_manager/lib/components/myAppBar.dart
Normal file
24
Frontend/patient_manager/lib/components/myAppBar.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyAppBar extends StatelessWidget {
|
||||
final String barTitle;
|
||||
|
||||
const MyAppBar({super.key, required this.barTitle});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
backgroundColor: Colors.blueAccent,
|
||||
elevation: 8,
|
||||
shadowColor: Colors.black,
|
||||
title: Text(
|
||||
barTitle,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
17
Frontend/patient_manager/lib/components/myAppDrawer.dart
Normal file
17
Frontend/patient_manager/lib/components/myAppDrawer.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyAppDrawer extends StatefulWidget {
|
||||
final String drawerTitle;
|
||||
|
||||
const MyAppDrawer({super.key, required this.drawerTitle});
|
||||
|
||||
@override
|
||||
State<MyAppDrawer> createState() => _MyAppDrawerState();
|
||||
}
|
||||
|
||||
class _MyAppDrawerState extends State<MyAppDrawer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ class MzanziInnovationHub extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
title: 'MyFlutterAp',
|
||||
title: 'Mzanzi Innovation Hub',
|
||||
themeMode: ThemeMode.system,
|
||||
debugShowCheckedModeBanner: false,
|
||||
initialRoute: '/',
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/homeTileGrid.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
|
||||
class Home extends StatelessWidget {
|
||||
const Home({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text("Hello World");
|
||||
return const Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(50),
|
||||
child: MyAppBar(
|
||||
barTitle: "Mzanzi Innovation Hub",
|
||||
),
|
||||
),
|
||||
body: HomeTileGrid(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user