Migration to mih_package_toolkit

This commit is contained in:
2026-03-18 16:42:12 +02:00
parent 84cb6b2e83
commit c67529dbac
180 changed files with 2112 additions and 8147 deletions

View File

@@ -1,13 +1,10 @@
import 'package:go_router/go_router.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_three.dart';
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_zero.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_action.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tools.dart';
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_one.dart';
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_two.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_data_helper_services.dart';
@@ -23,7 +20,7 @@ class PackageTest extends StatefulWidget {
}
class _PackageTestState extends State<PackageTest> {
int _selcetedIndex = 0;
int _selectedIndex = 0;
bool _isLoadingInitialData = true;
Future<void> _loadInitialData() async {
@@ -65,27 +62,27 @@ class _PackageTestState extends State<PackageTest> {
Map<Widget, void Function()?> temp = Map();
temp[const Icon(Icons.link)] = () {
setState(() {
_selcetedIndex = 0;
_selectedIndex = 0;
});
};
temp[const Icon(Icons.warning)] = () {
setState(() {
_selcetedIndex = 1;
_selectedIndex = 1;
});
};
temp[const Icon(Icons.inbox)] = () {
setState(() {
_selcetedIndex = 2;
_selectedIndex = 2;
});
};
temp[const Icon(Icons.outbond)] = () {
setState(() {
_selcetedIndex = 3;
_selectedIndex = 3;
});
};
return MihPackageTools(
tools: temp,
selcetedIndex: _selcetedIndex,
selectedIndex: _selectedIndex,
);
}
@@ -136,16 +133,16 @@ class _PackageTestState extends State<PackageTest> {
);
}
return MihPackage(
appActionButton: getAction(),
appTools: getTools(),
appBody: getToolBody(),
appToolTitles: getToolTitle(),
selectedbodyIndex: _selcetedIndex,
packageActionButton: getAction(),
packageTools: getTools(),
packageToolBodies: getToolBody(),
packageToolTitles: getToolTitle(),
selectedBodyIndex: _selectedIndex,
onIndexChange: (newValue) {
setState(() {
_selcetedIndex = newValue;
_selectedIndex = newValue;
});
print("Index: $_selcetedIndex");
print("Index: $_selectedIndex");
},
);
},

View File

@@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tile.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
class TestPackageTile extends StatefulWidget {
final double packageSize;
@@ -31,15 +29,13 @@ class _TestPackageTileState extends State<TestPackageTile> {
// ),
// );
},
appName: "Test",
appIcon: Icon(
packageName: "Test",
packageIcon: Icon(
Icons.warning_amber_rounded,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
),
iconSize: widget.packageSize,
textColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
textColor: MihColors.secondary(),
);
}
}

View File

@@ -7,33 +7,17 @@ import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:geolocator/geolocator.dart';
import 'package:ken_logger/ken_logger.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_business_info_card.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_location_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_date_field.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_numeric_stepper.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_floating_menu.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_image_display.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_radio_options.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_search_bar.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_text_form_field.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_time_field.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_toggle.dart';
import 'package:redacted/redacted.dart';
class PackageToolOne extends StatefulWidget {
@@ -97,28 +81,22 @@ class _PackageToolOneState extends State<PackageToolOne> {
return MihPackageWindow(
fullscreen: false,
borderOn: true,
foregroundColor: MihColors.getOrangeColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.getBluishPurpleColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
foregroundColor: MihColors.orange(),
backgroundColor: MihColors.bluishPurple(),
windowTitle: "Test No Full",
menuOptions: [
SpeedDialChild(
child: Icon(
Icons.add,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
),
label: "Show New Window",
labelBackgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
labelBackgroundColor: MihColors.green(),
labelStyle: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontWeight: FontWeight.bold,
),
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.green(),
onTap: () {
// showTestWindow();
},
@@ -138,6 +116,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
backgroundColor: MihColors.primary(),
borderOn: false,
bodyItem: getBody(screenWidth),
);
@@ -184,9 +163,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
),
),
],
@@ -197,16 +174,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
KenLogger.success("Successfully tested");
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.green(),
elevation: 10,
width: 300,
child: Text(
"Success Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -219,16 +193,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
KenLogger.error("Successfully tested");
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.red(),
elevation: 10,
width: 300,
child: Text(
"Error Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -241,16 +212,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
KenLogger.warning("Successfully tested");
},
buttonColor: MihColors.getOrangeColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.orange(),
elevation: 10,
width: 300,
child: Text(
"Warning Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -263,16 +231,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
KenLogger.info("Successfully tested");
},
buttonColor: MihColors.getBluishPurpleColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.bluishPurple(),
elevation: 10,
width: 300,
child: Text(
"Info Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -288,10 +253,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
initialSelection: '+27',
showDropDownButton: false,
pickerStyle: PickerStyle.bottomSheet,
dialogBackgroundColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
barrierColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
dialogBackgroundColor: MihColors.primary(),
barrierColor: MihColors.primary(),
),
const SizedBox(height: 10),
Center(
@@ -306,16 +269,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
},
);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.secondary(),
elevation: 10,
width: 300,
child: Text(
"Show Loading",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -332,9 +292,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
),
),
],
@@ -353,9 +311,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
),
),
],
@@ -433,8 +389,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
thickness: 2,
),
const SizedBox(height: 10),
@@ -447,9 +402,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
),
),
],
@@ -458,8 +411,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
MihBannerAd(),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
thickness: 2,
),
const SizedBox(height: 10),
@@ -468,12 +420,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
formFields: [
MihTextFormField(
width: 200,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _textFieldZeroController,
multiLineInput: false,
requiredText: false,
@@ -484,12 +432,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _textFieldOneController,
multiLineInput: false,
requiredText: true,
@@ -501,12 +445,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _textFieldTwoController,
multiLineInput: false,
requiredText: true,
@@ -519,12 +459,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _textFieldThreeController,
multiLineInput: false,
requiredText: true,
@@ -537,12 +473,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
const SizedBox(height: 10),
MihNumericStepper(
controller: _textFieldFiveController,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
hintText: "Number Stepper",
requiredText: true,
minValue: 1,
@@ -553,12 +485,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
MihToggle(
hintText: "Toggle",
initialPostion: switchpositioin,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
secondaryFillColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
secondaryFillColor: MihColors.primary(),
readOnly: false,
onChange: (value) {
setState(() {
@@ -571,12 +499,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
MihRadioOptions(
controller: _textFieldSixController,
hintText: "Radio Options",
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
secondaryFillColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
secondaryFillColor: MihColors.primary(),
requiredText: true,
radioOptions: const ["Option 1", "Option 2"],
),
@@ -617,12 +541,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
const SizedBox(height: 10),
MihTextFormField(
height: 250,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _textFieldFourController,
multiLineInput: true,
requiredText: false,
@@ -646,17 +566,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
MihAlertServices().inputErrorAlert(context);
}
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
buttonColor: MihColors.secondary(),
elevation: 10,
width: 300,
child: Text(
"Submit Form",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -667,8 +583,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
thickness: 2,
),
const SizedBox(height: 10),
@@ -679,10 +594,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
prefixIcon: Icons.search,
prefixAltIcon: MihIcons.mzansiAi,
width: 300,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
hintColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fillColor: MihColors.secondary(),
hintColor: MihColors.primary(),
onPrefixIconTap: () {
print("Search Icon Pressed: ${_searchController.text}");
},
@@ -693,16 +606,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
print("Button Pressed");
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.secondary(),
elevation: 10,
width: 300,
child: Text(
"Click Me",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -713,24 +623,19 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
print("Button Pressed");
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.green(),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.delete,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
),
Text(
"Click Me",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -743,15 +648,12 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {
print("Button Pressed");
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.red(),
width: 300,
child: Text(
"Click Me",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -768,9 +670,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
onPressed: () {},
icon: Icon(
MihIcons.mihLogo,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
),
),
),
@@ -782,10 +682,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
editable: false,
fileNameController: _fileNameController,
userSelectedfile: file,
frameColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
frameColor: MihColors.secondary(),
backgroundColor: MihColors.primary(),
onChange: (selectedImage) {
setState(() {
file = selectedImage;
@@ -794,10 +692,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _fileNameController,
hintText: "Selected Avatar File",
requiredText: false,
@@ -819,10 +715,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fillColor: MihColors.secondary(),
inputColor: MihColors.primary(),
controller: _imagefileController,
hintText: "Selected Image File",
requiredText: false,
@@ -842,19 +736,15 @@ class _PackageToolOneState extends State<PackageToolOne> {
SpeedDialChild(
child: Icon(
Icons.add,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
),
label: "Show New Window",
labelBackgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
labelBackgroundColor: MihColors.green(),
labelStyle: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontWeight: FontWeight.bold,
),
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.green(),
onTap: () {
showTestWindow();
},
@@ -862,19 +752,15 @@ class _PackageToolOneState extends State<PackageToolOne> {
SpeedDialChild(
child: Icon(
Icons.add,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
),
label: "Show New Full Window",
labelBackgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
labelBackgroundColor: MihColors.green(),
labelStyle: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontWeight: FontWeight.bold,
),
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.green(),
onTap: () {
showTestFullWindow();
},

View File

@@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
class PackageToolThree extends StatefulWidget {
const PackageToolThree({super.key});
@@ -15,6 +14,7 @@ class _PackageToolThreeState extends State<PackageToolThree> {
@override
Widget build(BuildContext context) {
return MihPackageToolBody(
backgroundColor: MihColors.primary(),
borderOn: false,
bodyItem: getBody(),
);

View File

@@ -1,10 +1,6 @@
import 'package:custom_rating_bar/custom_rating_bar.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
class PackageToolTwo extends StatefulWidget {
const PackageToolTwo({super.key});
@@ -17,6 +13,7 @@ class _PackageToolTwoState extends State<PackageToolTwo> {
@override
Widget build(BuildContext context) {
return MihPackageToolBody(
backgroundColor: MihColors.primary(),
borderOn: false,
bodyItem: getBody(),
);
@@ -35,8 +32,7 @@ class _PackageToolTwoState extends State<PackageToolTwo> {
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
),
),
const SizedBox(height: 10),
@@ -58,8 +54,7 @@ class _PackageToolTwoState extends State<PackageToolTwo> {
onPressed: () {},
icon: Icon(
MihIcons.mihLogo,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
),
),
)

View File

@@ -1,10 +1,6 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
class PackageToolZero extends StatefulWidget {
@@ -18,6 +14,7 @@ class _PackageToolZeroState extends State<PackageToolZero> {
@override
Widget build(BuildContext context) {
return MihPackageToolBody(
backgroundColor: MihColors.primary(),
borderOn: false,
bodyItem: getBody(),
);
@@ -35,8 +32,7 @@ class _PackageToolZeroState extends State<PackageToolZero> {
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
),
),
const SizedBox(height: 20),
@@ -49,13 +45,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
context,
);
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.green(),
child: Text(
"Basic Success Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -73,16 +67,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.primary(),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -92,16 +83,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
context.pop();
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.secondary(),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -111,13 +99,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
context,
);
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.green(),
child: Text(
"Advanced Success Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -130,13 +116,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
MihAlertServices().warningAlert(
"Warning Alert!", "This is a friendly warning mee", context);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.secondary(),
child: Text(
"Warning Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -154,16 +138,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.primary(),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -173,16 +154,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
context.pop();
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.red(),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -192,13 +170,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
context,
);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.secondary(),
child: Text(
"Advanced Warning Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -214,13 +190,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
context,
);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Basic Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -238,16 +212,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.primary(),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -257,16 +228,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
context.pop();
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
buttonColor: MihColors.secondary(),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
color: MihColors.primary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -276,13 +244,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
context,
);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Advanced Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -300,13 +266,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
context,
);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Delete Confirmation Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -318,13 +282,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().internetConnectionAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Internet Connection Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -336,13 +298,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().locationPermissionAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Location Permission Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -354,13 +314,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().inputErrorAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Input Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -372,14 +330,12 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().passwordRequirementAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: FittedBox(
child: Text(
"Password Requirement Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -392,13 +348,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().passwordMatchAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Password Match Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -410,13 +364,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().loginErrorAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Login Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -428,13 +380,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().emailExistsAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Email Exists Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -446,13 +396,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
onPressed: () {
MihAlertServices().invalidEmailAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
buttonColor: MihColors.red(),
child: Text(
"Invalid Email Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
color: MihColors.secondary(),
fontSize: 20,
fontWeight: FontWeight.bold,
),