Flutter web App home page, App Bar, Tile Grid & Tiles added

This commit is contained in:
2024-03-24 15:01:28 +02:00
parent 2242faef8a
commit e877072c7d
46 changed files with 166 additions and 23 deletions

View 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),
),
],
)
],
),
),
);
}
}

View 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",
),
],
),
),
);
}
}

View 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,
);
}
}

View 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();
}
}

View File

@@ -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: '/',

View File

@@ -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(),
);
}
}