add package size param

This commit is contained in:
2025-03-26 11:48:17 +02:00
parent 209f4361a4
commit d3871343cd
10 changed files with 114 additions and 96 deletions

View File

@@ -53,72 +53,70 @@ class _MihAppTileState extends State<MihAppTile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double borderRadius = widget.iconSize * 0.15; double borderRadius = widget.iconSize * 0.15;
return SizedBox( return Container(
width: widget.iconSize, alignment: Alignment.topCenter,
height: widget.iconSize, // color: Colors.black,
child: Container( // width: widget.iconSize,
alignment: Alignment.topCenter, // height: widget.iconSize + widget.iconSize / 3,
child: Column( child: Column(
children: [ children: [
Flexible( Flexible(
flex: 3, flex: 3,
child: LayoutBuilder( child: LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
double iconHeight = constraints.maxWidth; double iconHeight = constraints.maxWidth;
return AnimatedContainer( return AnimatedContainer(
height: iconHeight, height: iconHeight,
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
child: Material( child: Material(
color: widget.primaryColor, color: widget.primaryColor,
// shadowColor: // shadowColor:
// MzanziInnovationHub.of(context)!.theme.secondaryColor(), // MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// elevation: 5, // elevation: 5,
borderRadius: BorderRadius.circular(borderRadius),
child: InkWell(
borderRadius: BorderRadius.circular(borderRadius), borderRadius: BorderRadius.circular(borderRadius),
child: InkWell( // ho
borderRadius: BorderRadius.circular(borderRadius), onTap: widget.onTap,
// ho onLongPress: () {
onTap: widget.onTap, displayHint();
onLongPress: () { },
displayHint(); // hoverDuration: ,
}, splashColor: MzanziInnovationHub.of(context)!
// hoverDuration: ,
splashColor: MzanziInnovationHub.of(context)!
.theme
.highlightColor(),
highlightColor: MzanziInnovationHub.of(context)!
.theme
.highlightColor(),
child: FittedBox(child: widget.appIcon),
),
),
);
},
),
),
const SizedBox(height: 10),
Flexible(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
widget.appName,
textAlign: TextAlign.center,
// softWrap: true,
// overflow: TextOverflow.visible,
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .highlightColor(),
fontSize: 20.0, highlightColor: MzanziInnovationHub.of(context)!
fontWeight: FontWeight.bold, .theme
.highlightColor(),
child: FittedBox(child: widget.appIcon),
), ),
), ),
], );
), },
) ),
], ),
), const SizedBox(height: 10),
Flexible(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
widget.appName,
textAlign: TextAlign.center,
// softWrap: true,
// overflow: TextOverflow.visible,
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
],
),
)
],
), ),
); );
} }

View File

@@ -4,7 +4,11 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class AboutMihTile extends StatefulWidget { class AboutMihTile extends StatefulWidget {
const AboutMihTile({super.key}); final double packageSize;
const AboutMihTile({
super.key,
required this.packageSize,
});
@override @override
State<AboutMihTile> createState() => _AboutMihTileState(); State<AboutMihTile> createState() => _AboutMihTileState();
@@ -27,14 +31,14 @@ class _AboutMihTileState extends State<AboutMihTile> {
child: FaIcon( child: FaIcon(
FontAwesomeIcons.circleInfo, FontAwesomeIcons.circleInfo,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 200, size: widget.packageSize,
), ),
), ),
// Icon( // Icon(
// Icons.info, // Icons.info,
// color: MzanziInnovationHub.of(context)!.theme.primaryColor(), // color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
// ), // ),
iconSize: 200, iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -5,9 +5,12 @@ import 'package:flutter/material.dart';
class MihAccessTile extends StatefulWidget { class MihAccessTile extends StatefulWidget {
final AppUser signedInUser; final AppUser signedInUser;
final double packageSize;
const MihAccessTile({ const MihAccessTile({
super.key, super.key,
required this.signedInUser, required this.signedInUser,
required this.packageSize,
}); });
@override @override
@@ -25,14 +28,14 @@ class _MihAccessTileState extends State<MihAccessTile> {
); );
}, },
appName: "MIH Access", appName: "MIH Access",
appIcon: Padding( appIcon: Container(
padding: const EdgeInsets.all(1), padding: const EdgeInsets.all(1),
child: Icon( child: Icon(
Icons.check_box, Icons.check_box,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
), ),
iconSize: 200, iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -4,9 +4,12 @@ import 'package:flutter/material.dart';
class MihCalculatorTile extends StatefulWidget { class MihCalculatorTile extends StatefulWidget {
final bool personalSelected; final bool personalSelected;
final double packageSize;
const MihCalculatorTile({ const MihCalculatorTile({
super.key, super.key,
required this.personalSelected, required this.personalSelected,
required this.packageSize,
}); });
@override @override
@@ -24,14 +27,14 @@ class _MihCalculatorTileState extends State<MihCalculatorTile> {
); );
}, },
appName: "Calculator", appName: "Calculator",
appIcon: Padding( appIcon: Container(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
child: Icon( child: Icon(
Icons.calculate, Icons.calculate,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
), ),
iconSize: 200, iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -5,9 +5,12 @@ import 'package:flutter/material.dart';
class MzansiCalendarTile extends StatefulWidget { class MzansiCalendarTile extends StatefulWidget {
final CalendarArguments arguments; final CalendarArguments arguments;
final double packageSize;
const MzansiCalendarTile({ const MzansiCalendarTile({
super.key, super.key,
required this.arguments, required this.arguments,
required this.packageSize,
}); });
@override @override
@@ -25,14 +28,14 @@ class _MzansiCalendarTileState extends State<MzansiCalendarTile> {
); );
}, },
appName: "Calendar", appName: "Calendar",
appIcon: Padding( appIcon: Container(
padding: const EdgeInsets.all(1), padding: const EdgeInsets.all(0.5),
child: Icon( child: Icon(
Icons.calendar_month, Icons.calendar_month,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
), ),
), ),
iconSize: 200, iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -5,9 +5,12 @@ import 'package:flutter/material.dart';
class MzansiAiTile extends StatefulWidget { class MzansiAiTile extends StatefulWidget {
final AppUser signedInUser; final AppUser signedInUser;
final double packageSize;
const MzansiAiTile({ const MzansiAiTile({
super.key, super.key,
required this.signedInUser, required this.signedInUser,
required this.packageSize,
}); });
@override @override
@@ -29,11 +32,11 @@ class _MzansiAiTileState extends State<MzansiAiTile> {
appIcon: Padding( appIcon: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: SizedBox( child: SizedBox(
width: 225, width: widget.packageSize,
child: Image(image: aiLogo), child: Image(image: aiLogo),
), ),
), ),
iconSize: 200, iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -7,10 +7,13 @@ import 'package:flutter/material.dart';
class MzansiProfileTile extends StatefulWidget { class MzansiProfileTile extends StatefulWidget {
final AppUser signedInUser; final AppUser signedInUser;
final ImageProvider<Object>? propicFile; final ImageProvider<Object>? propicFile;
final double packageSize;
const MzansiProfileTile({ const MzansiProfileTile({
super.key, super.key,
required this.signedInUser, required this.signedInUser,
required this.propicFile, required this.propicFile,
required this.packageSize,
}); });
@override @override
@@ -32,14 +35,11 @@ class _MzansiProfileTileState extends State<MzansiProfileTile> {
); );
}, },
appName: "Mzansi Profile", appName: "Mzansi Profile",
appIcon: Padding( appIcon: Container(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(25),
child: SizedBox( child: Image(image: logo),
width: 225,
child: Image(image: logo),
),
), ),
iconSize: 200, iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -6,9 +6,12 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MihWalletTile extends StatefulWidget { class MihWalletTile extends StatefulWidget {
final AppUser signedInUser; final AppUser signedInUser;
final double packageSize;
const MihWalletTile({ const MihWalletTile({
super.key, super.key,
required this.signedInUser, required this.signedInUser,
required this.packageSize,
}); });
@override @override
@@ -26,12 +29,12 @@ class _MihWalletTileState extends State<MihWalletTile> {
); );
}, },
appName: "Mzansi Wallet", appName: "Mzansi Wallet",
appIcon: Padding( appIcon: Container(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(25),
child: FaIcon( child: FaIcon(
FontAwesomeIcons.wallet, FontAwesomeIcons.wallet,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 200, size: widget.packageSize,
), ),
), ),
iconSize: 200, iconSize: 200,

View File

@@ -2,13 +2,15 @@ import 'package:Mzansi_Innovation_Hub/main.dart';
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_tile.dart'; import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/mih_app_tile.dart';
import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart'; import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class PatientProfileTile extends StatefulWidget { class PatientProfileTile extends StatefulWidget {
final PatientViewArguments arguments; final PatientViewArguments arguments;
final double packageSize;
const PatientProfileTile({ const PatientProfileTile({
super.key, super.key,
required this.arguments, required this.arguments,
required this.packageSize,
}); });
@override @override
@@ -26,15 +28,14 @@ class _PatientProfileTileState extends State<PatientProfileTile> {
); );
}, },
appName: "Patient Profile", appName: "Patient Profile",
appIcon: Padding( appIcon: Container(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(15),
child: FaIcon( child: Icon(
FontAwesomeIcons.bookMedical, Icons.medical_information_outlined,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(), color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 200, size: widget.packageSize,
), )),
), iconSize: widget.packageSize,
iconSize: 200,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(), primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
); );

View File

@@ -24,7 +24,7 @@ import '../mih_objects/arguments.dart';
import '../mih_packages/authentication/forgot_password.dart'; import '../mih_packages/authentication/forgot_password.dart';
import '../mih_packages/authentication/reset_password.dart'; import '../mih_packages/authentication/reset_password.dart';
import '../mih_packages/patient_profile/pat_profile/components/full_screen_file.dart'; import '../mih_packages/patient_profile/pat_profile/components/full_screen_file.dart';
import '../mih_packages/manage_business/profile_business_add.dart'; import '../mih_packages/mzansi_profile/manage_business/profile_business_add.dart';
class RouteGenerator { class RouteGenerator {
static Route<dynamic> generateRoute(RouteSettings settings) { static Route<dynamic> generateRoute(RouteSettings settings) {
@@ -112,7 +112,7 @@ class RouteGenerator {
//=============================================================== //===============================================================
//User Profile //User Profile
case '/user-profile': case '/mzansi-profile':
if (args is AppProfileUpdateArguments) { if (args is AppProfileUpdateArguments) {
return MaterialPageRoute( return MaterialPageRoute(
settings: settings, settings: settings,