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
Widget build(BuildContext context) {
double borderRadius = widget.iconSize * 0.15;
return SizedBox(
width: widget.iconSize,
height: widget.iconSize,
child: Container(
alignment: Alignment.topCenter,
child: Column(
children: [
Flexible(
flex: 3,
child: LayoutBuilder(
builder: (context, constraints) {
double iconHeight = constraints.maxWidth;
return AnimatedContainer(
height: iconHeight,
duration: const Duration(seconds: 2),
child: Material(
color: widget.primaryColor,
// shadowColor:
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// elevation: 5,
return Container(
alignment: Alignment.topCenter,
// color: Colors.black,
// width: widget.iconSize,
// height: widget.iconSize + widget.iconSize / 3,
child: Column(
children: [
Flexible(
flex: 3,
child: LayoutBuilder(
builder: (context, constraints) {
double iconHeight = constraints.maxWidth;
return AnimatedContainer(
height: iconHeight,
duration: const Duration(seconds: 2),
child: Material(
color: widget.primaryColor,
// shadowColor:
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
// elevation: 5,
borderRadius: BorderRadius.circular(borderRadius),
child: InkWell(
borderRadius: BorderRadius.circular(borderRadius),
child: InkWell(
borderRadius: BorderRadius.circular(borderRadius),
// ho
onTap: widget.onTap,
onLongPress: () {
displayHint();
},
// 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)!
// ho
onTap: widget.onTap,
onLongPress: () {
displayHint();
},
// hoverDuration: ,
splashColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 20.0,
fontWeight: FontWeight.bold,
.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.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';
class AboutMihTile extends StatefulWidget {
const AboutMihTile({super.key});
final double packageSize;
const AboutMihTile({
super.key,
required this.packageSize,
});
@override
State<AboutMihTile> createState() => _AboutMihTileState();
@@ -27,14 +31,14 @@ class _AboutMihTileState extends State<AboutMihTile> {
child: FaIcon(
FontAwesomeIcons.circleInfo,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 200,
size: widget.packageSize,
),
),
// Icon(
// Icons.info,
// color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
// ),
iconSize: 200,
iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
secondaryColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
);

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,10 +7,13 @@ import 'package:flutter/material.dart';
class MzansiProfileTile extends StatefulWidget {
final AppUser signedInUser;
final ImageProvider<Object>? propicFile;
final double packageSize;
const MzansiProfileTile({
super.key,
required this.signedInUser,
required this.propicFile,
required this.packageSize,
});
@override
@@ -32,14 +35,11 @@ class _MzansiProfileTileState extends State<MzansiProfileTile> {
);
},
appName: "Mzansi Profile",
appIcon: Padding(
padding: const EdgeInsets.all(15.0),
child: SizedBox(
width: 225,
child: Image(image: logo),
),
appIcon: Container(
padding: const EdgeInsets.all(25),
child: Image(image: logo),
),
iconSize: 200,
iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
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 {
final AppUser signedInUser;
final double packageSize;
const MihWalletTile({
super.key,
required this.signedInUser,
required this.packageSize,
});
@override
@@ -26,12 +29,12 @@ class _MihWalletTileState extends State<MihWalletTile> {
);
},
appName: "Mzansi Wallet",
appIcon: Padding(
padding: const EdgeInsets.all(20.0),
appIcon: Container(
padding: const EdgeInsets.all(25),
child: FaIcon(
FontAwesomeIcons.wallet,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 200,
size: widget.packageSize,
),
),
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_objects/arguments.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class PatientProfileTile extends StatefulWidget {
final PatientViewArguments arguments;
final double packageSize;
const PatientProfileTile({
super.key,
required this.arguments,
required this.packageSize,
});
@override
@@ -26,15 +28,14 @@ class _PatientProfileTileState extends State<PatientProfileTile> {
);
},
appName: "Patient Profile",
appIcon: Padding(
padding: const EdgeInsets.all(20.0),
child: FaIcon(
FontAwesomeIcons.bookMedical,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: 200,
),
),
iconSize: 200,
appIcon: Container(
padding: const EdgeInsets.all(15),
child: Icon(
Icons.medical_information_outlined,
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
size: widget.packageSize,
)),
iconSize: widget.packageSize,
primaryColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
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/reset_password.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 {
static Route<dynamic> generateRoute(RouteSettings settings) {
@@ -112,7 +112,7 @@ class RouteGenerator {
//===============================================================
//User Profile
case '/user-profile':
case '/mzansi-profile':
if (args is AppProfileUpdateArguments) {
return MaterialPageRoute(
settings: settings,