rename container folders

This commit is contained in:
2026-01-29 11:11:45 +02:00
parent d5349d981c
commit 5b052a1fa9
654 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,154 @@
import 'package:go_router/go_router.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';
import 'package:provider/provider.dart';
class PackageTest extends StatefulWidget {
const PackageTest({
super.key,
});
@override
State<PackageTest> createState() => _PackageTestState();
}
class _PackageTestState extends State<PackageTest> {
int _selcetedIndex = 0;
bool _isLoadingInitialData = true;
Future<void> _loadInitialData() async {
setState(() {
_isLoadingInitialData = true;
});
MzansiProfileProvider mzansiProfileProvider =
context.read<MzansiProfileProvider>();
if (mzansiProfileProvider.user == null) {
await MihDataHelperServices().loadUserDataWithBusinessesData(
mzansiProfileProvider,
);
}
setState(() {
_isLoadingInitialData = false;
});
}
MihPackageAction getAction() {
return MihPackageAction(
icon: const Icon(Icons.arrow_back),
iconSize: 35,
onTap: () {
context.goNamed(
'mihHome',
extra: true,
);
FocusScope.of(context).unfocus();
// Navigator.of(context).pop();
// Navigator.of(context).popAndPushNamed(
// '/',
// arguments: AuthArguments(true, false),
// );
},
);
}
MihPackageTools getTools() {
Map<Widget, void Function()?> temp = Map();
temp[const Icon(Icons.link)] = () {
setState(() {
_selcetedIndex = 0;
});
};
temp[const Icon(Icons.warning)] = () {
setState(() {
_selcetedIndex = 1;
});
};
temp[const Icon(Icons.inbox)] = () {
setState(() {
_selcetedIndex = 2;
});
};
temp[const Icon(Icons.outbond)] = () {
setState(() {
_selcetedIndex = 3;
});
};
return MihPackageTools(
tools: temp,
selcetedIndex: _selcetedIndex,
);
}
void showAlert() {
MihAlertServices().inputErrorAlert(context);
}
List<Widget> getToolBody() {
MzansiProfileProvider profileProvider =
context.read<MzansiProfileProvider>();
List<Widget> toolBodies = [
const PackageToolThree(),
const PackageToolZero(),
PackageToolOne(
user: profileProvider.user!,
business: profileProvider.business,
),
const PackageToolTwo(),
];
return toolBodies;
}
List<String> getToolTitle() {
List<String> toolTitles = [
"Tool Zero",
"Tool One",
"Tool Two",
];
return toolTitles;
}
@override
void initState() {
super.initState();
_loadInitialData();
}
@override
Widget build(BuildContext context) {
return Consumer<MzansiProfileProvider>(
builder:
(BuildContext context, MzansiProfileProvider value, Widget? child) {
if (_isLoadingInitialData) {
return Scaffold(
body: Center(
child: Mihloadingcircle(),
),
);
}
return MihPackage(
appActionButton: getAction(),
appTools: getTools(),
appBody: getToolBody(),
appToolTitles: getToolTitle(),
selectedbodyIndex: _selcetedIndex,
onIndexChange: (newValue) {
setState(() {
_selcetedIndex = newValue;
});
print("Index: $_selcetedIndex");
},
);
},
);
}
}

View File

@@ -0,0 +1,45 @@
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';
class TestPackageTile extends StatefulWidget {
final double packageSize;
const TestPackageTile({
super.key,
required this.packageSize,
});
@override
State<TestPackageTile> createState() => _TestPackageTileState();
}
class _TestPackageTileState extends State<TestPackageTile> {
@override
Widget build(BuildContext context) {
return MihPackageTile(
onTap: () {
context.goNamed(
'testPackage',
);
// Navigator.of(context).pushNamed(
// '/package-dev',
// arguments: TestArguments(
// widget.signedInUser,
// widget.business,
// ),
// );
},
appName: "Test",
appIcon: Icon(
Icons.warning_amber_rounded,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
iconSize: widget.packageSize,
textColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
);
}
}

View File

@@ -0,0 +1,881 @@
import 'package:country_code_picker/country_code_picker.dart';
import 'package:file_picker/file_picker.dart';
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: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 {
final AppUser user;
final Business? business;
const PackageToolOne({
super.key,
required this.user,
required this.business,
});
@override
State<PackageToolOne> createState() => _PackageToolOneState();
}
class _PackageToolOneState extends State<PackageToolOne> {
late ImageProvider<Object>? imagePreview;
PlatformFile? file;
PlatformFile? imageFile;
TextEditingController _fileNameController = TextEditingController();
TextEditingController _imagefileController = TextEditingController();
TextEditingController _searchController = TextEditingController();
TextEditingController _textFieldZeroController = TextEditingController();
TextEditingController _textFieldOneController = TextEditingController();
TextEditingController _textFieldTwoController = TextEditingController();
TextEditingController _textFieldThreeController = TextEditingController();
TextEditingController _textFieldFourController = TextEditingController();
TextEditingController _textFieldFiveController = TextEditingController();
TextEditingController _textFieldSixController = TextEditingController();
TextEditingController _textFieldSevenController = TextEditingController();
TextEditingController _textFieldEightController = TextEditingController();
TextEditingController _textFieldNineController = TextEditingController();
bool switchpositioin = true;
final FocusNode searchFocusNode = FocusNode();
final _formKey = GlobalKey<FormState>();
late Future<Position?> myCoordinates;
String myLocation = "";
void showTestFullWindow() {
showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
return MihPackageWindow(
fullscreen: true,
windowTitle: "Test Full",
onWindowTapClose: () {
Navigator.of(context).pop();
},
windowBody: Text("Testing Window Body"),
);
},
);
}
void showTestWindow() {
showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
return MihPackageWindow(
fullscreen: false,
borderOn: true,
foregroundColor: MihColors.getOrangeColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.getBluishPurpleColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
windowTitle: "Test No Full",
menuOptions: [
SpeedDialChild(
child: Icon(
Icons.add,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
label: "Show New Window",
labelBackgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
labelStyle: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontWeight: FontWeight.bold,
),
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
onTap: () {
// showTestWindow();
},
),
],
onWindowTapClose: () {
Navigator.of(context).pop();
},
windowBody: Text(
"Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body "),
);
},
);
}
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
borderOn: false,
bodyItem: getBody(screenWidth),
);
}
@override
void dispose() {
_fileNameController.dispose();
_imagefileController.dispose();
_searchController.dispose();
searchFocusNode.dispose();
super.dispose();
}
@override
void initState() {
super.initState();
setState(() {
imagePreview = null;
});
}
Widget getBody(double width) {
return Stack(
children: [
MihSingleChildScroll(
child: Padding(
padding:
MzansiInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Hello",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
],
),
const SizedBox(height: 20),
Center(
child: MihButton(
onPressed: () {
KenLogger.success("Successfully tested");
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
elevation: 10,
width: 300,
child: Text(
"Success Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
Center(
child: MihButton(
onPressed: () {
KenLogger.error("Successfully tested");
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
elevation: 10,
width: 300,
child: Text(
"Error Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
Center(
child: MihButton(
onPressed: () {
KenLogger.warning("Successfully tested");
},
buttonColor: MihColors.getOrangeColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
elevation: 10,
width: 300,
child: Text(
"Warning Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
Center(
child: MihButton(
onPressed: () {
KenLogger.info("Successfully tested");
},
buttonColor: MihColors.getBluishPurpleColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
elevation: 10,
width: 300,
child: Text(
"Info Logger",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
CountryCodePicker(
padding: EdgeInsetsGeometry.all(0),
onChanged: (selectedCode) {
debugPrint("Selected Country Code: $selectedCode");
},
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"),
),
const SizedBox(height: 10),
Center(
child: MihButton(
onPressed: () {
showDialog(
context: context,
builder: (context) {
return const Mihloadingcircle(
message: "Getting your profile data",
);
},
);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
elevation: 10,
width: 300,
child: Text(
"Show Loading",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Personal Preview",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
],
),
const SizedBox(height: 10),
// MihPersonalProfilePreview(
// user: widget.user,
// ),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Business Preview",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
],
),
const SizedBox(height: 10),
FutureBuilder(
future: MIHLocationAPI().getGPSPosition(context),
builder: (context, asyncSnapshot) {
// print(asyncSnapshot.connectionState);
if (asyncSnapshot.connectionState ==
ConnectionState.waiting) {
// return MihBusinessProfilePreview(
// business: widget.business,
// myLocation: null,
// ).redacted(
// context: context,
// redact: true,
// );
return Container(
width: 150,
height: 50,
// color: Colors.black,
child: Center(child: CircularProgressIndicator()),
);
} else if (asyncSnapshot.hasError ||
!asyncSnapshot.hasData ||
asyncSnapshot.data == null) {
return Container(
width: 150,
height: 50,
color: Colors.red,
child: Center(child: Text("Location unavailable")),
);
} else {
// final myLocation = asyncSnapshot.data
// .toString()
// .replaceAll("Latitude: ", "")
// .replaceAll("Longitude: ", "");
// print("My Location is this: $myLocation");
// return widget.business != null
// ? MihBusinessProfilePreview(
// business: widget.business!,
// )
return Text("NoBusiness Data");
}
}),
// const SizedBox(height: 10),
// Text("This text should be redacted").redacted(
// context: context,
// redact: true,
// ),
MihBusinessCard(
business: Business(
"business_id",
"Name",
"type",
"registration_no",
"logo_name",
"logo_path",
"+27812345679",
"bus_email",
"app_id",
"gps_location",
"practice_no",
"vat_no",
"website",
"rating",
"mission_vision",
),
// startUpSearch: '',
width: 300,
).redacted(
context: context,
redact: true,
),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
thickness: 2,
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Ad Test",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
],
),
MihBannerAd(),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
thickness: 2,
),
const SizedBox(height: 10),
MihForm(
formKey: _formKey,
formFields: [
MihTextFormField(
width: 200,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
controller: _textFieldZeroController,
multiLineInput: false,
requiredText: false,
hintText: "Username",
validator: (value) {
return MihValidationServices().validateUsername(value);
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
controller: _textFieldOneController,
multiLineInput: false,
requiredText: true,
hintText: "Email",
autofillHints: [AutofillHints.email],
validator: (value) {
return MihValidationServices().validateEmail(value);
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
controller: _textFieldTwoController,
multiLineInput: false,
requiredText: true,
hintText: "Password",
passwordMode: true,
autofillHints: [AutofillHints.password],
validator: (value) {
return MihValidationServices().validatePassword(value);
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
controller: _textFieldThreeController,
multiLineInput: false,
requiredText: true,
hintText: "Numbers Only",
numberMode: true,
validator: (value) => value == null || value.isEmpty
? 'This Field is required'
: null,
),
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"),
hintText: "Number Stepper",
requiredText: true,
minValue: 1,
maxValue: 5,
validationOn: true,
),
const SizedBox(height: 10),
MihToggle(
hintText: "Toggle",
initialPostion: switchpositioin,
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
secondaryFillColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
readOnly: false,
onChange: (value) {
setState(() {
switchpositioin = value;
});
print("Toggle Value: $switchpositioin");
},
),
const SizedBox(height: 10),
MihRadioOptions(
controller: _textFieldSixController,
hintText: "Radio Options",
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
secondaryFillColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
requiredText: true,
radioOptions: const ["Option 1", "Option 2"],
),
const SizedBox(height: 10),
MihDropdownField(
controller: _textFieldNineController,
hintText: "Dropdown",
dropdownOptions: const [
"Option 1",
"Option 2",
"Option 3",
],
editable: true,
enableSearch: true,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
requiredText: true,
),
const SizedBox(height: 10),
MihDateField(
controller: _textFieldSevenController,
labelText: "Date Field",
required: true,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 10),
MihTimeField(
controller: _textFieldEightController,
labelText: "Time Field",
required: true,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
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"),
controller: _textFieldFourController,
multiLineInput: true,
requiredText: false,
hintText: "Enter Multi Line Text",
validator: (value) {
return MihValidationServices()
.validateLength(_textFieldFourController.text, 50);
},
),
const SizedBox(height: 20),
Align(
alignment: Alignment.center,
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
// Process data
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text("Input Valid")),
);
} else {
MihAlertServices().inputErrorAlert(context);
}
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
elevation: 10,
width: 300,
child: Text(
"Submit Form",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
const SizedBox(height: 10),
Divider(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
thickness: 2,
),
const SizedBox(height: 10),
MihSearchBar(
controller: _searchController,
hintText: "Ask Mzansi",
// prefixIcon: Icons.search,
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"),
onPrefixIconTap: () {
print("Search Icon Pressed: ${_searchController.text}");
},
searchFocusNode: searchFocusNode,
),
const SizedBox(height: 20),
MihButton(
onPressed: () {
print("Button Pressed");
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
elevation: 10,
width: 300,
child: Text(
"Click Me",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 40),
MihButton(
onPressed: () {
print("Button Pressed");
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.delete,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
Text(
"Click Me",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
const SizedBox(height: 10),
MihButton(
onPressed: () {
print("Button Pressed");
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
child: Text(
"Click Me",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
Container(
color: Colors.black,
width: 200,
height: 200,
padding: EdgeInsets.zero,
alignment: Alignment.center,
child: IconButton.filled(
onPressed: () {},
icon: Icon(
MihIcons.mihLogo,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
),
),
),
const SizedBox(height: 10),
MihCircleAvatar(
imageFile: imagePreview,
width: 50,
editable: false,
fileNameController: _fileNameController,
userSelectedfile: file,
frameColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
backgroundColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
onChange: (selectedImage) {
setState(() {
file = selectedImage;
});
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
controller: _fileNameController,
hintText: "Selected Avatar File",
requiredText: false,
readOnly: false,
),
const SizedBox(height: 10),
MihImageDisplay(
imageFile: imagePreview,
width: 300,
height: 200,
editable: true,
fileNameController: _imagefileController,
userSelectedfile: imageFile,
onChange: (selectedFile) {
setState(() {
imageFile = selectedFile;
});
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
inputColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
controller: _imagefileController,
hintText: "Selected Image File",
requiredText: false,
readOnly: false,
),
const SizedBox(height: 10),
],
),
),
),
Positioned(
right: 0,
bottom: 0,
child: MihFloatingMenu(
animatedIcon: AnimatedIcons.menu_close,
children: [
SpeedDialChild(
child: Icon(
Icons.add,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
label: "Show New Window",
labelBackgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
labelStyle: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontWeight: FontWeight.bold,
),
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
onTap: () {
showTestWindow();
},
),
SpeedDialChild(
child: Icon(
Icons.add,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
label: "Show New Full Window",
labelBackgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
labelStyle: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontWeight: FontWeight.bold,
),
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
onTap: () {
showTestFullWindow();
},
),
]),
)
],
);
}
}

View File

@@ -0,0 +1,127 @@
import 'package:flutter/material.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});
@override
State<PackageToolThree> createState() => _PackageToolThreeState();
}
class _PackageToolThreeState extends State<PackageToolThree> {
@override
Widget build(BuildContext context) {
return MihPackageToolBody(
borderOn: false,
bodyItem: getBody(),
);
}
Widget getBody() {
List<ProfileLink> links = [
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Youtube",
web_link: "https://www.youtube.com/@MzansiInnovationHub",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Threads",
web_link: "https://www.threads.com/@mzansi.innovation.hub",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "TikTok",
web_link: "https://www.tiktok.com/@mzansiinnovationhub",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "WhatsApp",
web_link: "https://whatsapp.com/channel/0029Vax3INCIyPtMn8KgeM2F",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Twitch",
web_link: "https://www.twitch.tv/mzansiinnovationhub",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Instagram",
web_link: "https://www.instagram.com/mzansi.innovation.hub/",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "X",
web_link: "https://x.com/mzansi_inno_hub",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "LinkedIn",
web_link: "https://www.linkedin.com/in/yasien-meth-172352108/",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Facebook",
web_link: "https://www.facebook.com/profile.php?id=61565345762136",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Reddit",
web_link: "https://www.reddit.com/r/Mzani_Innovation_Hub/",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "Discord",
web_link: "https://discord.gg/ZtTZYd5d",
),
ProfileLink(
idprofile_links: 1,
app_id: "1234",
business_id: "",
destination: "My App",
web_link: "https://app.mzansi-innovation-hub.co.za/about",
),
];
return Stack(
children: [
MihSingleChildScroll(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
MihProfileLinks(
links: links,
// links: [],
),
],
),
),
],
);
}
}

View File

@@ -0,0 +1,69 @@
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';
class PackageToolTwo extends StatefulWidget {
const PackageToolTwo({super.key});
@override
State<PackageToolTwo> createState() => _PackageToolTwoState();
}
class _PackageToolTwoState extends State<PackageToolTwo> {
@override
Widget build(BuildContext context) {
return MihPackageToolBody(
borderOn: false,
bodyItem: getBody(),
);
}
Widget getBody() {
return MihSingleChildScroll(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Text(
"World",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
),
const SizedBox(height: 10),
RatingBar(
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
onRatingChanged: (value) => debugPrint('$value'),
initialRating: 3,
maxRating: 5,
),
const SizedBox(height: 10),
Container(
color: Colors.black,
width: 200,
height: 200,
padding: EdgeInsets.zero,
alignment: Alignment.center,
child: IconButton.filled(
onPressed: () {},
icon: Icon(
MihIcons.mihLogo,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
),
)
],
),
);
}
}

View File

@@ -0,0 +1,465 @@
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:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
class PackageToolZero extends StatefulWidget {
const PackageToolZero({super.key});
@override
State<PackageToolZero> createState() => _PackageToolZeroState();
}
class _PackageToolZeroState extends State<PackageToolZero> {
@override
Widget build(BuildContext context) {
return MihPackageToolBody(
borderOn: false,
bodyItem: getBody(),
);
}
Widget getBody() {
return MihSingleChildScroll(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"This is Package Tool Zero to test MIH Alerts",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
),
),
const SizedBox(height: 20),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().successBasicAlert(
"Success!",
"This is the message for the success message",
context,
);
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
child: Text(
"Basic Success Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().successAdvancedAlert(
"Success!",
"This is the advanced alert message",
[
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
],
context,
);
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
child: Text(
"Advanced Success Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().warningAlert(
"Warning Alert!", "This is a friendly warning mee", context);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
child: Text(
"Warning Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().warningAdvancedAlert(
"warning!",
"This is the advanced alert message",
[
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
],
context,
);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
child: Text(
"Advanced Warning Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().errorBasicAlert(
"Error!",
"Thisis the basic error alert message",
context,
);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Basic Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().errorAdvancedAlert(
"Error!",
"This is the advanced alert message",
[
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
],
context,
);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Advanced Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().deleteConfirmationAlert(
"THis is a delete confirmation",
() {
context.pop();
},
context,
);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Delete Confirmation Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().internetConnectionAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Internet Connection Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().locationPermissionAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Location Permission Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().inputErrorAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Input Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().passwordRequirementAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: FittedBox(
child: Text(
"Password Requirement Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().passwordMatchAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Password Match Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().loginErrorAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Login Error Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().emailExistsAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Email Exists Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().invalidEmailAlert(context);
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
child: Text(
"Invalid Email Alert",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
],
),
);
}
}