forked from yaso_meth/mih-project
Merge pull request #83 from yaso-meth/QOL--add-tiles-to-business
QOL--add-tiles-to-business
This commit is contained in:
@@ -169,3 +169,13 @@ class AuthArguments {
|
||||
this.firstBoot,
|
||||
);
|
||||
}
|
||||
|
||||
class CalendarArguments {
|
||||
final AppUser signedInUser;
|
||||
final bool personalSelected;
|
||||
|
||||
CalendarArguments(
|
||||
this.signedInUser,
|
||||
this.personalSelected,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih-app_tool_bo
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_objects/appointment.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/appointment/builder/build_appointment_list.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/builder/build_appointment_list.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_action.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_tools.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_objects/app_user.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/appointment/appointments.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/appointments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MzansiCalendar extends StatefulWidget {
|
||||
final AppUser signedInUser;
|
||||
final CalendarArguments arguments;
|
||||
const MzansiCalendar({
|
||||
super.key,
|
||||
required this.signedInUser,
|
||||
required this.arguments,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -44,7 +43,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
'/',
|
||||
arguments: AuthArguments(true, false),
|
||||
arguments: AuthArguments(widget.arguments.personalSelected, false),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -67,7 +66,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
List<Widget> getToolBody() {
|
||||
List<Widget> toolBodies = [
|
||||
//appointment here
|
||||
Appointments(signedInUser: widget.signedInUser),
|
||||
Appointments(signedInUser: widget.arguments.signedInUser),
|
||||
];
|
||||
return toolBodies;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calendar',
|
||||
arguments: widget.signedInUser,
|
||||
arguments: CalendarArguments(widget.signedInUser, true),
|
||||
);
|
||||
},
|
||||
tileName: "Calendar",
|
||||
@@ -350,6 +350,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
}
|
||||
|
||||
void setAppsBusiness(List<MIHTile> tileList) {
|
||||
ImageProvider aiLogo = MzanziInnovationHub.of(context)!.theme.aiLogoImage();
|
||||
tileList.add(MIHTile(
|
||||
videoID: "NWyJZq2ZYOM",
|
||||
onTap: () {
|
||||
@@ -422,6 +423,105 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
));
|
||||
|
||||
tileList.add(MIHTile(
|
||||
videoID: "nfzhJFY_W4Y",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calendar',
|
||||
arguments: CalendarArguments(widget.signedInUser, false),
|
||||
);
|
||||
},
|
||||
tileName: "Calendar",
|
||||
tileIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.calendarDays,
|
||||
color: getSec(),
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
// Icon(
|
||||
// Icons.calendar_month,
|
||||
// color: getSec(),
|
||||
// size: 230,
|
||||
// ),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
));
|
||||
|
||||
tileList.add(MIHTile(
|
||||
videoID: "dYuLqZWzMnM",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-ai',
|
||||
arguments: widget.signedInUser,
|
||||
);
|
||||
},
|
||||
tileName: "Mzansi AI",
|
||||
tileIcon: Center(
|
||||
child: SizedBox(
|
||||
width: 225,
|
||||
child: Image(image: aiLogo),
|
||||
),
|
||||
),
|
||||
// Icon(
|
||||
// Icons.medication,
|
||||
// color: getSec(),
|
||||
// size: 200,
|
||||
// ),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
));
|
||||
|
||||
tileList.add(MIHTile(
|
||||
videoID: "woQ5hND5EaU",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calculator',
|
||||
//arguments: widget.signedInUser,
|
||||
);
|
||||
},
|
||||
tileName: "Calculator",
|
||||
tileIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.calculator,
|
||||
color: getSec(),
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
// Icon(
|
||||
// Icons.info_outline,
|
||||
// color: getSec(),
|
||||
// size: 230,
|
||||
// ),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
));
|
||||
|
||||
tileList.add(MIHTile(
|
||||
videoID: "hbKhlmY_56U",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/about',
|
||||
//arguments: widget.signedInUser,
|
||||
);
|
||||
},
|
||||
tileName: "About MIH",
|
||||
tileIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.circleInfo,
|
||||
color: getSec(),
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
// Icon(
|
||||
// Icons.info_outline,
|
||||
// color: getSec(),
|
||||
// size: 230,
|
||||
// ),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
));
|
||||
}
|
||||
|
||||
void setAppsDev(List<MIHTile> tileList) {
|
||||
@@ -944,7 +1044,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
headerAlignment: MainAxisAlignment.center,
|
||||
headerItems: [
|
||||
Text(
|
||||
"Mzanzi Innovation Hub",
|
||||
"MIH",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/test/package_test.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/appointment/mzansi_calendar.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/mzansi_calendar.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calculator/calculator.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mih_policy_tos/mih_privacy_polocy.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mih_policy_tos/mih_terms_of_service.dart';
|
||||
@@ -213,12 +213,12 @@ class RouteGenerator {
|
||||
|
||||
// Appointment Page
|
||||
case '/calendar':
|
||||
if (args is AppUser) {
|
||||
if (args is CalendarArguments) {
|
||||
//print("route generator: $args");
|
||||
return MaterialPageRoute(
|
||||
settings: settings,
|
||||
builder: (_) => MzansiCalendar(
|
||||
signedInUser: args,
|
||||
arguments: args,
|
||||
),
|
||||
// Appointments(
|
||||
// signedInUser: args,
|
||||
@@ -227,12 +227,12 @@ class RouteGenerator {
|
||||
}
|
||||
return _errorRoute();
|
||||
case '/appointments':
|
||||
if (args is AppUser) {
|
||||
if (args is CalendarArguments) {
|
||||
//print("route generator: $args");
|
||||
return MaterialPageRoute(
|
||||
settings: settings,
|
||||
builder: (_) => MzansiCalendar(
|
||||
signedInUser: args,
|
||||
arguments: args,
|
||||
),
|
||||
// Appointments(
|
||||
// signedInUser: args,
|
||||
|
||||
Reference in New Issue
Block a user