Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e5ce03e396 | |||
| c67529dbac | |||
| 84cb6b2e83 | |||
| 6e07a55885 | |||
| 8fb31695a8 | |||
| 4fafa35888 | |||
| 0cf9634c5d | |||
| 787a8057b2 | |||
| 5f911d51f9 | |||
| 8da29792b4 |
@@ -489,7 +489,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_packageIcon_NAME = packageIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
@@ -672,7 +672,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_packageIcon_NAME = packageIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
@@ -699,7 +699,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_packageIcon_NAME = packageIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihColors {
|
||||
bool women4Change = true;
|
||||
static Color getPrimaryColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0XFF3A4454); // Original
|
||||
// return const Color(0XFF6641b2); // Women4change
|
||||
} else {
|
||||
return const Color(0XFFbedcfe); // Original
|
||||
// return const Color(0xFFE0D1FF); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSecondaryColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0XFFbedcfe); // Original
|
||||
// return const Color(0xFFE0D1FF); // Women4change
|
||||
} else {
|
||||
return const Color(0XFF3A4454); // Original
|
||||
// return const Color(0XFF6641b2); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSecondaryInvertedColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0XFF412301); // Original
|
||||
// return const Color(0XFF1f2e00); // Women4change
|
||||
} else {
|
||||
return const Color(0XFFc5bbab); // Original
|
||||
// return const Color(0XFF99be4d); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getHighlightColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0XFF9bc7fa);
|
||||
// return const Color(0xFFC8AFFB); // Women4change
|
||||
} else {
|
||||
return const Color(0XFF354866);
|
||||
// return const Color(0XFF6641b2); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGreyColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0XFFc8c8c8);
|
||||
} else {
|
||||
return const Color(0XFF747474);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGreenColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xff8ae290);
|
||||
} else {
|
||||
return const Color(0xFF41B349);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getRedColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffD87E8B);
|
||||
} else {
|
||||
return const Color(0xffbb3d4f);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getPinkColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffdaa2e9);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffdaa2e9);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getOrangeColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffd69d7d);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFBD7145);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getYellowColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xfff4e467);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffd4af37);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getBluishPurpleColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xff6e7dcc);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFF5567C0);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getPurpleColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffb682e7);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFF9857D4);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGoldColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xFFD4AF37);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffFFD700);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSilverColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffC0C0C0);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFA6A6A6);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getBronze(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffB1560F);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFCD7F32);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import "package:universal_html/html.dart" as html;
|
||||
|
||||
class MihTheme {
|
||||
@@ -17,66 +17,63 @@ class MihTheme {
|
||||
ThemeData getData(bool bool) {
|
||||
return ThemeData(
|
||||
fontFamily: 'Segoe UI',
|
||||
scaffoldBackgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
scaffoldBackgroundColor: MihColors.primary(),
|
||||
colorScheme: ColorScheme(
|
||||
brightness: getBritness(),
|
||||
primary: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
onPrimary: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
secondary: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
onSecondary: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
error: MihColors.getRedColor(mode == "Dark"),
|
||||
onError: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
surface: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
onSurface: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
primary: MihColors.secondary(),
|
||||
onPrimary: MihColors.primary(),
|
||||
secondary: MihColors.primary(),
|
||||
onSecondary: MihColors.secondary(),
|
||||
error: MihColors.red(),
|
||||
onError: MihColors.primary(),
|
||||
surface: MihColors.primary(),
|
||||
onSurface: MihColors.secondary(),
|
||||
),
|
||||
datePickerTheme: DatePickerThemeData(
|
||||
backgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
headerBackgroundColor: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
headerForegroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
backgroundColor: MihColors.primary(),
|
||||
headerBackgroundColor: MihColors.secondary(),
|
||||
headerForegroundColor: MihColors.primary(),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
color: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
foregroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
foregroundColor: MihColors.primary(),
|
||||
titleTextStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||
backgroundColor: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
foregroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
extendedTextStyle:
|
||||
TextStyle(color: MihColors.getPrimaryColor(mode == "Dark")),
|
||||
backgroundColor: MihColors.secondary(),
|
||||
foregroundColor: MihColors.primary(),
|
||||
extendedTextStyle: TextStyle(color: MihColors.primary()),
|
||||
),
|
||||
drawerTheme: DrawerThemeData(
|
||||
backgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
backgroundColor: MihColors.primary(),
|
||||
),
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
cursorColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
selectionColor:
|
||||
MihColors.getPrimaryColor(mode == "Dark").withOpacity(0.25),
|
||||
selectionHandleColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
cursorColor: MihColors.primary(),
|
||||
selectionColor: MihColors.primary().withOpacity(0.25),
|
||||
selectionHandleColor: MihColors.primary(),
|
||||
),
|
||||
tooltipTheme: TooltipThemeData(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color:
|
||||
MihColors.getPrimaryColor(mode == "Dark").withOpacity(0.18),
|
||||
color: MihColors.primary().withOpacity(0.18),
|
||||
blurRadius: 6,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
textStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 13,
|
||||
height: 1.2,
|
||||
),
|
||||
|
||||
@@ -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 {
|
||||
@@ -44,6 +41,7 @@ class _PackageTestState extends State<PackageTest> {
|
||||
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
iconColor: MihColors.secondary(),
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
@@ -65,27 +63,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 +134,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");
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/bookmarked_business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business_review.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_add_bookmark_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_delete_bookmark_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_review_business_window.dart';
|
||||
@@ -50,8 +46,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
RedactedConfiguration getRedactedConfiguration() {
|
||||
return RedactedConfiguration(
|
||||
// redactedColor: Colors.pink,
|
||||
redactedColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
redactedColor: MihColors.primary(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -159,13 +154,10 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
Function()? ontap,
|
||||
) {
|
||||
return Material(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
child: InkWell(
|
||||
onTap: ontap,
|
||||
splashColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
||||
.withOpacity(0.2),
|
||||
splashColor: MihColors.primary().withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsGeometry.symmetric(
|
||||
@@ -186,8 +178,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
child: Icon(
|
||||
icon,
|
||||
// size: 35,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
).redacted(
|
||||
@@ -207,9 +198,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
height: 1.0,
|
||||
),
|
||||
).redacted(
|
||||
@@ -222,9 +211,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
).redacted(
|
||||
context: context,
|
||||
@@ -278,16 +265,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
builder: (BuildContext context, MzansiProfileProvider profileProvider,
|
||||
MzansiDirectoryProvider directoryProvider, Widget? child) {
|
||||
return Material(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
||||
.withValues(alpha: 0.6),
|
||||
color: MihColors.secondary().withValues(alpha: 0.6),
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
elevation: 10,
|
||||
shadowColor: Colors.black,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
@@ -297,8 +281,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
"Call",
|
||||
"Give us a quick call.",
|
||||
Icons.phone,
|
||||
MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
MihColors.green(),
|
||||
false,
|
||||
() {
|
||||
// print("Calling ${widget.cellNumber}");
|
||||
@@ -306,15 +289,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
},
|
||||
),
|
||||
Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
_buildContactInfo(
|
||||
"Email",
|
||||
"Send us an email.",
|
||||
Icons.email,
|
||||
MihColors.getPinkColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
MihColors.pink(),
|
||||
false,
|
||||
() {
|
||||
// print("Emailing ${widget.email}");
|
||||
@@ -330,17 +311,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
_buildContactInfo(
|
||||
"Location",
|
||||
"Come visit us.",
|
||||
Icons.location_on,
|
||||
MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.orange(),
|
||||
false,
|
||||
() {
|
||||
final latitude = double.parse(
|
||||
@@ -362,17 +339,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
_buildContactInfo(
|
||||
"Website",
|
||||
"Find out more about us.",
|
||||
Icons.vpn_lock,
|
||||
MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.red(),
|
||||
false,
|
||||
() {
|
||||
_launchWebsite(widget.business.website);
|
||||
@@ -393,9 +366,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
@@ -403,9 +374,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
"Loading Rating",
|
||||
"Loading your rating.",
|
||||
Icons.star_rate_rounded,
|
||||
MihColors.getYellowColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.yellow(),
|
||||
true,
|
||||
null,
|
||||
),
|
||||
@@ -426,18 +395,14 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
_buildContactInfo(
|
||||
ratingDisplayTitle,
|
||||
"Let us know how we are doing.",
|
||||
Icons.star_rate_rounded,
|
||||
MihColors.getYellowColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.yellow(),
|
||||
false,
|
||||
() {
|
||||
businessReviewRatingWindow(directoryProvider,
|
||||
@@ -461,9 +426,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
@@ -471,9 +434,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
"Loading Bookmark",
|
||||
"Loading your bookmark.",
|
||||
Icons.bookmark_add_rounded,
|
||||
MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.bluishPurple(),
|
||||
true,
|
||||
null,
|
||||
),
|
||||
@@ -494,9 +455,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Divider(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
_buildContactInfo(
|
||||
@@ -505,9 +464,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
bookmarkBusiness == null
|
||||
? Icons.bookmark_add_rounded
|
||||
: Icons.bookmark_remove_rounded,
|
||||
MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.bluishPurple(),
|
||||
false,
|
||||
() {
|
||||
// _launchWebsite(widget.website);
|
||||
@@ -526,14 +483,14 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
// child: Divider(
|
||||
// color: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.primary(),
|
||||
// ),
|
||||
// ),
|
||||
// _buildContactInfo(
|
||||
// "Bookmark",
|
||||
// "Save us for later.",
|
||||
// Icons.bookmark_add_rounded,
|
||||
// MihColors.getBluishPurpleColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// MihColors.bluishPurple(),
|
||||
// () {
|
||||
// // _launchWebsite(widget.website);
|
||||
// print("Saving ${widget.business.Name} to Directory");
|
||||
@@ -544,7 +501,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
// child: Divider(
|
||||
// color: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.primary(),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
@@ -646,16 +603,14 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
Icon(
|
||||
MihIcons.mihLogo,
|
||||
size: 125,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Let's Get Started",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -664,8 +619,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
Text(
|
||||
"Ready to dive in to the world of MIH?\nSign in or create a free MIH account to unlock all the powerful features of the MIH app. It's quick and easy!",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
@@ -678,16 +632,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
||||
extra: true,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Sign In/ Create Account",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/bookmarked_business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business_review.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_add_bookmark_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_delete_bookmark_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_review_business_window.dart';
|
||||
@@ -50,8 +46,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
RedactedConfiguration getRedactedConfiguration() {
|
||||
return RedactedConfiguration(
|
||||
// redactedColor: Colors.pink,
|
||||
redactedColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
redactedColor: MihColors.primary(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -200,12 +195,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
onPressed: () {
|
||||
_makePhoneCall(widget.business.contact_no);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
child: Icon(
|
||||
Icons.phone,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
),
|
||||
@@ -215,9 +208,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"Call",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
@@ -236,12 +227,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"Dear ${widget.business.Name},\n\nI would like to inquire about your services.\n\nBest regards,\n",
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getPinkColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.pink(),
|
||||
child: Icon(
|
||||
Icons.email,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
),
|
||||
@@ -251,9 +240,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"Email",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
@@ -276,13 +263,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
longitude: longitude,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.orange(),
|
||||
child: Icon(
|
||||
Icons.location_on,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
),
|
||||
@@ -292,9 +276,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"Maps",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
@@ -311,13 +293,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
onPressed: () {
|
||||
_launchWebsite(widget.business.website);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
child: Icon(
|
||||
Icons.language,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
),
|
||||
@@ -327,9 +306,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"Website",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
@@ -346,14 +323,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
width: 80,
|
||||
height: 80,
|
||||
onPressed: () {},
|
||||
buttonColor: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.grey(),
|
||||
child: Icon(
|
||||
Icons.star_rate_rounded,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
).redacted(context: context, redact: true),
|
||||
@@ -363,9 +336,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"Rate Us",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
).redacted(context: context, redact: true),
|
||||
@@ -389,14 +360,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
businessReviewRatingWindow(directoryProvider,
|
||||
businessReview, true, widget.width);
|
||||
},
|
||||
buttonColor: MihColors.getYellowColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.yellow(),
|
||||
child: Icon(
|
||||
Icons.star_rate_rounded,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
),
|
||||
@@ -406,9 +373,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
ratingTitle,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
@@ -428,14 +393,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
width: 80,
|
||||
height: 80,
|
||||
onPressed: () {},
|
||||
buttonColor: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.grey(),
|
||||
child: Icon(
|
||||
Icons.bookmark_add_rounded,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
).redacted(context: context, redact: true),
|
||||
@@ -445,9 +406,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
"bookmark",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
).redacted(context: context, redact: true),
|
||||
@@ -474,16 +433,12 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
showDeleteBookmarkAlert(bookmarkBusiness);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.bluishPurple(),
|
||||
child: Icon(
|
||||
bookmarkBusiness == null
|
||||
? Icons.bookmark_add_rounded
|
||||
: Icons.bookmark_remove_rounded,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: iconSize,
|
||||
),
|
||||
),
|
||||
@@ -493,9 +448,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
bookmarkDisplayTitle,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
@@ -602,16 +555,14 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
Icon(
|
||||
MihIcons.mihLogo,
|
||||
size: 125,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Let's Get Started",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -620,8 +571,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
Text(
|
||||
"Ready to dive in to the world of MIH?\nSign in or create a free MIH account to unlock all the powerful features of the MIH app. It's quick and easy!",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
@@ -634,16 +584,13 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
||||
extra: true,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Sign In/ Create Account",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_location_services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -54,16 +52,13 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
? Icon(
|
||||
MihIcons.mihRing,
|
||||
size: profilePictureWidth,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: widget.imageFile == null
|
||||
? Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: profilePictureWidth,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: MihCircleAvatar(
|
||||
imageFile: widget.imageFile,
|
||||
@@ -72,12 +67,8 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
editable: false,
|
||||
fileNameController: TextEditingController(),
|
||||
userSelectedfile: null,
|
||||
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: () {},
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihButton extends StatelessWidget {
|
||||
final void Function()? onPressed;
|
||||
final void Function()? onLongPressed;
|
||||
final Color buttonColor;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final double? borderRadius;
|
||||
final double? elevation; // 0 = flat, higher = more shadow
|
||||
final Widget child;
|
||||
|
||||
const MihButton({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
this.onLongPressed,
|
||||
required this.buttonColor,
|
||||
this.width,
|
||||
this.height,
|
||||
this.borderRadius,
|
||||
this.elevation,
|
||||
required this.child,
|
||||
});
|
||||
Color _darkerColor(Color color, [double amount = .1]) {
|
||||
final hsl = HSLColor.fromColor(color);
|
||||
final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0));
|
||||
return hslDark.toColor();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Color effectiveButtonColor = onPressed == null
|
||||
? buttonColor.withValues(alpha: 0.6) // Example disabled color
|
||||
: buttonColor;
|
||||
final Color rippleColor = _darkerColor(effectiveButtonColor, 0.1);
|
||||
final double radius = borderRadius ?? 25.0;
|
||||
final double effectiveElevation =
|
||||
onPressed == null ? 0.0 : (elevation ?? 4.0);
|
||||
return MouseRegion(
|
||||
cursor: onPressed == null
|
||||
? SystemMouseCursors.basic
|
||||
: SystemMouseCursors.click,
|
||||
child: Material(
|
||||
color: effectiveButtonColor,
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
elevation: effectiveElevation,
|
||||
shadowColor: Colors.black,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
splashColor: rippleColor,
|
||||
highlightColor: rippleColor.withValues(alpha: 0.2),
|
||||
hoverColor: rippleColor.withValues(alpha: 0.3),
|
||||
onTap: onPressed,
|
||||
onLongPress: onLongPressed,
|
||||
child: Container(
|
||||
width: width,
|
||||
height: height,
|
||||
padding: (width == null || height == null)
|
||||
? const EdgeInsets.symmetric(horizontal: 24, vertical: 12)
|
||||
: null,
|
||||
alignment: Alignment.center,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:table_calendar/table_calendar.dart';
|
||||
|
||||
@@ -54,8 +53,7 @@ class _MIHCalendarState extends State<MIHCalendar> {
|
||||
formatButtonDecoration: BoxDecoration(
|
||||
border: Border.fromBorderSide(
|
||||
BorderSide(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
borderRadius: const BorderRadius.all(
|
||||
@@ -79,36 +77,29 @@ class _MIHCalendarState extends State<MIHCalendar> {
|
||||
calendarStyle: CalendarStyle(
|
||||
outsideDaysVisible: false,
|
||||
todayTextStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
todayDecoration: BoxDecoration(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.green(),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
selectedTextStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
selectedDecoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
weekendTextStyle: TextStyle(
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.grey(),
|
||||
),
|
||||
),
|
||||
daysOfWeekStyle: DaysOfWeekStyle(
|
||||
weekdayStyle: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
weekendStyle: TextStyle(
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.grey(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -4,10 +4,8 @@ import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.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_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
|
||||
class MihCircleAvatar extends StatefulWidget {
|
||||
final ImageProvider<Object>? imageFile;
|
||||
@@ -126,9 +124,7 @@ class _MihCircleAvatarState extends State<MihCircleAvatar> {
|
||||
child: IconButton.filled(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
MihColors.green(),
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihDateField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String labelText;
|
||||
final bool required;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final double? borderRadius;
|
||||
final double? elevation;
|
||||
final FormFieldValidator<String>? validator;
|
||||
const MihDateField({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.labelText,
|
||||
required this.required,
|
||||
this.width,
|
||||
this.height,
|
||||
this.borderRadius,
|
||||
this.elevation,
|
||||
this.validator,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihDateField> createState() => _MihDateFieldState();
|
||||
}
|
||||
|
||||
class _MihDateFieldState extends State<MihDateField> {
|
||||
FormFieldState<String>? _formFieldState;
|
||||
|
||||
Future<void> _selectDate(BuildContext context) async {
|
||||
DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: widget.controller.text.isNotEmpty
|
||||
? DateTime.tryParse(widget.controller.text) ?? DateTime.now()
|
||||
: DateTime.now(),
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime(2100),
|
||||
);
|
||||
if (picked != null) {
|
||||
widget.controller.text = picked.toString().split(" ")[0];
|
||||
_formFieldState?.didChange(widget.controller.text);
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
widget.labelText,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
if (!widget.required)
|
||||
Text(
|
||||
"(Optional)",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
FormField<String>(
|
||||
initialValue: widget.controller.text,
|
||||
validator: widget.validator,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
builder: (field) {
|
||||
_formFieldState = field;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Material(
|
||||
elevation: widget.elevation ?? 4.0,
|
||||
borderRadius:
|
||||
BorderRadius.circular(widget.borderRadius ?? 8.0),
|
||||
child: TextFormField(
|
||||
controller: widget.controller,
|
||||
readOnly: true,
|
||||
onTap: () => _selectDate(context),
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: Icon(
|
||||
Icons.calendar_today,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
errorStyle: const TextStyle(height: 0, fontSize: 0),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0, vertical: 8.0),
|
||||
filled: true,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: field.hasError
|
||||
? BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 2.0,
|
||||
)
|
||||
: BorderSide.none,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: field.hasError
|
||||
? MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")
|
||||
: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
onChanged: (value) {
|
||||
field.didChange(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
if (field.hasError)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 4.0),
|
||||
child: Text(
|
||||
field.errorText ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,295 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihDropdownField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String hintText;
|
||||
final bool requiredText;
|
||||
final List<String> dropdownOptions;
|
||||
final bool editable;
|
||||
final bool enableSearch;
|
||||
final FormFieldValidator<String>? validator;
|
||||
final Function(String?)? onSelected;
|
||||
|
||||
const MihDropdownField({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.hintText,
|
||||
required this.dropdownOptions,
|
||||
required this.requiredText,
|
||||
required this.editable,
|
||||
required this.enableSearch,
|
||||
this.validator,
|
||||
this.onSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihDropdownField> createState() => _MihDropdownFieldState();
|
||||
}
|
||||
|
||||
class _MihDropdownFieldState extends State<MihDropdownField> {
|
||||
late List<DropdownMenuEntry<String>> menu;
|
||||
|
||||
List<DropdownMenuEntry<String>> buildMenuOptions(List<String> options) {
|
||||
List<DropdownMenuEntry<String>> menuList = [];
|
||||
for (final i in options) {
|
||||
menuList.add(DropdownMenuEntry(
|
||||
value: i,
|
||||
label: i,
|
||||
style: ButtonStyle(
|
||||
foregroundColor: WidgetStatePropertyAll(MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")),
|
||||
),
|
||||
));
|
||||
}
|
||||
return menuList;
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
menu = buildMenuOptions(widget.dropdownOptions);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
menu = widget.dropdownOptions
|
||||
.map((e) => DropdownMenuEntry(value: e, label: e))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
widget.hintText,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
if (!widget.requiredText)
|
||||
Text(
|
||||
"(Optional)",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
FormField<String>(
|
||||
validator: widget.validator,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
initialValue: widget.controller.text,
|
||||
builder: (field) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
scrollbarTheme: ScrollbarThemeData(
|
||||
thumbColor: WidgetStatePropertyAll(
|
||||
MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")),
|
||||
thickness: const WidgetStatePropertyAll(6),
|
||||
radius: const Radius.circular(10),
|
||||
thumbVisibility: const WidgetStatePropertyAll(
|
||||
true), // Always show when scrolling
|
||||
),
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
cursorColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
selectionColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")
|
||||
.withValues(alpha: 0.3),
|
||||
selectionHandleColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
child: DropdownMenu(
|
||||
controller: widget.controller,
|
||||
dropdownMenuEntries: menu,
|
||||
enableSearch: widget.enableSearch,
|
||||
enableFilter: widget.enableSearch,
|
||||
enabled: widget.editable,
|
||||
textInputAction: widget.enableSearch
|
||||
? TextInputAction.search
|
||||
: TextInputAction.none,
|
||||
requestFocusOnTap: widget.enableSearch,
|
||||
menuHeight: 400,
|
||||
expandedInsets: EdgeInsets.zero,
|
||||
textStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
trailingIcon: Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
selectedTrailingIcon: Icon(
|
||||
Icons.arrow_drop_up,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
// leadingIcon:
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// widget.controller.clear();
|
||||
// field.didChange('');
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.delete_outline_rounded,
|
||||
// color: MihColors.getPrimaryColor(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
// "Dark"),
|
||||
// ),
|
||||
// ),
|
||||
onSelected: (String? selectedValue) {
|
||||
field.didChange(selectedValue);
|
||||
widget.onSelected?.call(selectedValue);
|
||||
},
|
||||
menuStyle: MenuStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")),
|
||||
side: WidgetStatePropertyAll(
|
||||
BorderSide(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 1.0),
|
||||
),
|
||||
shape: WidgetStatePropertyAll(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
10), // Increase for more roundness
|
||||
),
|
||||
),
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
errorStyle: const TextStyle(height: 0, fontSize: 0),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0, vertical: 8.0),
|
||||
filled: true,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color: field.hasError
|
||||
? MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")
|
||||
: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
widget.controller.clear();
|
||||
field.didChange('');
|
||||
},
|
||||
child: Icon(
|
||||
size: 35,
|
||||
Icons.delete_rounded,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (field.hasError)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 4.0),
|
||||
child: Text(
|
||||
field.errorText ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihFloatingMenu extends StatefulWidget {
|
||||
final IconData? icon;
|
||||
final double? iconSize;
|
||||
final AnimatedIconData? animatedIcon;
|
||||
final SpeedDialDirection? direction;
|
||||
final List<SpeedDialChild> children;
|
||||
const MihFloatingMenu({
|
||||
super.key,
|
||||
this.icon,
|
||||
this.iconSize,
|
||||
this.animatedIcon,
|
||||
this.direction,
|
||||
required this.children,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihFloatingMenu> createState() => _MihFloatingMenuState();
|
||||
}
|
||||
|
||||
class _MihFloatingMenuState extends State<MihFloatingMenu> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SpeedDial(
|
||||
key: GlobalKey(),
|
||||
icon: widget.icon,
|
||||
buttonSize: Size(widget.iconSize ?? 56.0, widget.iconSize ?? 56.0),
|
||||
animatedIcon: widget.animatedIcon,
|
||||
direction: widget.direction ?? SpeedDialDirection.up,
|
||||
activeIcon: Icons.close,
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
activeBackgroundColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
foregroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
overlayColor: Colors.black,
|
||||
overlayOpacity: 0.5,
|
||||
children: widget.children,
|
||||
onOpen: () => debugPrint('OPENING DIAL'),
|
||||
onClose: () => debugPrint('DIAL CLOSED'),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihForm extends StatefulWidget {
|
||||
final GlobalKey<FormState> formKey;
|
||||
final List<Widget> formFields;
|
||||
const MihForm({
|
||||
super.key,
|
||||
required this.formKey,
|
||||
required this.formFields,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihForm> createState() => _MihFormState();
|
||||
}
|
||||
|
||||
class _MihFormState extends State<MihForm> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Form(
|
||||
key: widget.formKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: widget.formFields,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import 'package:flutter/widgets.dart'; // You need this import for IconData
|
||||
|
||||
class MihIcons {
|
||||
MihIcons._(); // This makes the class non-instantiable (good practice for utility classes)
|
||||
|
||||
// This MUST match the 'family' name you specify in pubspec.yaml
|
||||
static const _mihFontFam = 'MihIcons';
|
||||
// Set to your package name ONLY if this font is part of a separate package you created
|
||||
static const String? _mihFontPkg = null;
|
||||
|
||||
// IconData constants based on your style.css file
|
||||
// Note: We convert the hex code from CSS (\eXXX) to an integer (0xeXXX)
|
||||
|
||||
static const IconData mineSweeper =
|
||||
IconData(0xe900, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mzansiDirectory =
|
||||
IconData(0xe901, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData personalProfile =
|
||||
IconData(0xe902, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData aboutMih =
|
||||
IconData(0xe903, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData accessControl =
|
||||
IconData(0xe904, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData businessProfile =
|
||||
IconData(0xe905, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData businessSetup =
|
||||
IconData(0xe906, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData calculator =
|
||||
IconData(0xe907, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData calendar =
|
||||
IconData(0xe908, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData iDontKnow =
|
||||
IconData(0xe909, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mihLogo =
|
||||
IconData(0xe90a, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mihRing =
|
||||
IconData(0xe90b, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mzansiAi =
|
||||
IconData(0xe90c, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mzansiWallet =
|
||||
IconData(0xe90d, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData notifications =
|
||||
IconData(0xe90e, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData patientManager =
|
||||
IconData(0xe90f, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData patientProfile =
|
||||
IconData(0xe910, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData profileSetup =
|
||||
IconData(0xe911, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
}
|
||||
@@ -3,8 +3,8 @@ import 'dart:io';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.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_config/mih_colors.dart';
|
||||
|
||||
class MihImageDisplay extends StatefulWidget {
|
||||
final ImageProvider<Object>? imageFile;
|
||||
@@ -67,9 +67,7 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
||||
// width: widget.width,
|
||||
height: widget.height,
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
||||
),
|
||||
child: Image(image: imagePreview!),
|
||||
@@ -79,15 +77,13 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.image_not_supported_rounded,
|
||||
size: widget.width * 0.3,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
@@ -97,11 +93,9 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
||||
right: 5,
|
||||
child: IconButton.filled(
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.green(),
|
||||
),
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
onPressed: () async {
|
||||
try {
|
||||
FilePickerResult? result =
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import '../main.dart';
|
||||
|
||||
class Mihloadingcircle extends StatefulWidget {
|
||||
final String? message;
|
||||
const Mihloadingcircle({
|
||||
super.key,
|
||||
this.message,
|
||||
});
|
||||
|
||||
@override
|
||||
State<Mihloadingcircle> createState() => _MihloadingcircleState();
|
||||
}
|
||||
|
||||
class _MihloadingcircleState extends State<Mihloadingcircle>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
late Animation<double> _animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
duration: const Duration(
|
||||
milliseconds: 500), // Duration for one pulse (grow and shrink)
|
||||
vsync: this,
|
||||
);
|
||||
_animation = Tween<double>(
|
||||
begin: 200,
|
||||
end: 200 * 0.5, // Pulse to 50% of the initial size
|
||||
).animate(CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: Curves.easeInOut, // Smooth start and end of the pulse
|
||||
));
|
||||
_controller.repeat(reverse: true);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
child: IntrinsicWidth(
|
||||
child: IntrinsicHeight(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(15),
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 5.0),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
height: 200,
|
||||
child: AnimatedBuilder(
|
||||
animation: _animation,
|
||||
builder: (context, child) {
|
||||
return Icon(
|
||||
MihIcons.mihLogo,
|
||||
size: _animation
|
||||
.value, // The size changes based on the animation value
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
if (widget.message != null)
|
||||
Text(
|
||||
widget.message!,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/notification.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
@@ -69,15 +68,13 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
title: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
subtitle,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
@@ -94,8 +91,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.circle_notifications,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
@@ -104,8 +100,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -119,8 +114,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -132,8 +126,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
subtitle: Text(
|
||||
subtitle,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
@@ -156,8 +149,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.notifications.length,
|
||||
@@ -196,15 +188,14 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Drawer(
|
||||
//backgroundColor: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
//backgroundColor: MihColors.primary(),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@@ -214,9 +205,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
child: Text(
|
||||
"Notifications",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
),
|
||||
@@ -231,7 +220,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
||||
// physics: const NeverScrollableScrollPhysics(),
|
||||
// separatorBuilder: (BuildContext context, index) {
|
||||
// return Divider(
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// );
|
||||
// },
|
||||
// itemCount: widget.notifications.length,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import '../main.dart';
|
||||
import '../mih_objects/arguments.dart';
|
||||
|
||||
@@ -131,10 +131,8 @@ class _MIHNotificationMessageState extends State<MIHNotificationMessage>
|
||||
void initState() {
|
||||
super.initState();
|
||||
setState(() {
|
||||
primary = MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
secondary = MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
primary = MihColors.primary();
|
||||
secondary = MihColors.red();
|
||||
});
|
||||
_animationController = AnimationController(
|
||||
vsync: this,
|
||||
|
||||
@@ -1,238 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_text_form_field.dart';
|
||||
|
||||
class MihNumericStepper extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final Color fillColor;
|
||||
final Color inputColor;
|
||||
final String hintText;
|
||||
final bool requiredText;
|
||||
final double? width;
|
||||
final int? minValue;
|
||||
final int? maxValue;
|
||||
final bool validationOn;
|
||||
const MihNumericStepper({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.fillColor,
|
||||
required this.inputColor,
|
||||
required this.hintText,
|
||||
required this.requiredText,
|
||||
this.width,
|
||||
this.minValue,
|
||||
this.maxValue,
|
||||
required this.validationOn,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihNumericStepper> createState() => _MihNumericStepperState();
|
||||
}
|
||||
|
||||
class _MihNumericStepperState extends State<MihNumericStepper> {
|
||||
late int _currentValue;
|
||||
late bool error;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
widget.controller.removeListener(_syncCurrentValue);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_currentValue =
|
||||
int.tryParse(widget.controller.text) ?? widget.minValue ?? 0;
|
||||
widget.controller.text = _currentValue.toString();
|
||||
int.tryParse(widget.controller.text) ?? widget.minValue ?? 0;
|
||||
widget.controller.addListener(_syncCurrentValue);
|
||||
// print("Current Value: $_currentValue");
|
||||
}
|
||||
|
||||
void _syncCurrentValue() {
|
||||
final newValue =
|
||||
int.tryParse(widget.controller.text) ?? widget.minValue ?? 0;
|
||||
if (newValue != _currentValue) {
|
||||
setState(() {
|
||||
_currentValue = newValue;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.hintText,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.fillColor,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
25), // Optional: rounds the corners
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(60, 0, 0,
|
||||
0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
spreadRadius: -2,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 2.0,
|
||||
left: 5.0,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 40,
|
||||
child: IconButton.filled(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark")),
|
||||
),
|
||||
color: widget.inputColor,
|
||||
iconSize: 20,
|
||||
onPressed: () {
|
||||
print("Current Value: $_currentValue");
|
||||
if (_currentValue >= (widget.minValue ?? 0)) {
|
||||
setState(() {
|
||||
widget.controller.text =
|
||||
(_currentValue - 1).toString();
|
||||
_currentValue =
|
||||
int.tryParse(widget.controller.text)!;
|
||||
});
|
||||
}
|
||||
print("New Current Value: $_currentValue");
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.remove,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: _currentValue < (widget.minValue ?? 0) ||
|
||||
(widget.maxValue != null &&
|
||||
_currentValue > widget.maxValue!),
|
||||
child: const SizedBox(
|
||||
height: 21,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Expanded(
|
||||
child: MihTextFormField(
|
||||
width: widget.width,
|
||||
fillColor: widget.fillColor,
|
||||
inputColor: widget.inputColor,
|
||||
controller: widget.controller,
|
||||
hintText: null,
|
||||
requiredText: widget.requiredText,
|
||||
readOnly: true,
|
||||
numberMode: true,
|
||||
textIputAlignment: TextAlign.center,
|
||||
validator: (value) {
|
||||
if (widget.validationOn) {
|
||||
return MihValidationServices().validateNumber(
|
||||
value, widget.minValue, widget.maxValue);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
25), // Optional: rounds the corners
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(60, 0, 0,
|
||||
0), // 0.2 opacity = 51 in alpha (255 * 0.2)
|
||||
spreadRadius: -2,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 2.0,
|
||||
left: 5.0,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 40,
|
||||
child: IconButton.filled(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark")),
|
||||
),
|
||||
color: widget.inputColor,
|
||||
iconSize: 20,
|
||||
onPressed: () {
|
||||
print("Current Value: $_currentValue");
|
||||
if (widget.maxValue == null ||
|
||||
_currentValue <= widget.maxValue!) {
|
||||
setState(() {
|
||||
widget.controller.text =
|
||||
(_currentValue + 1).toString();
|
||||
_currentValue =
|
||||
int.tryParse(widget.controller.text)!;
|
||||
});
|
||||
}
|
||||
print("New Current Value: $_currentValue");
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.add,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: _currentValue < (widget.minValue ?? 0) ||
|
||||
(widget.maxValue != null &&
|
||||
_currentValue > widget.maxValue!),
|
||||
child: const SizedBox(
|
||||
height: 21,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,219 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_scack_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_app_drawer.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihPackage extends StatefulWidget {
|
||||
final Widget appActionButton;
|
||||
final MihPackageTools appTools;
|
||||
final List<Widget> appBody;
|
||||
final List<String> appToolTitles;
|
||||
final MIHAppDrawer? actionDrawer;
|
||||
final int selectedbodyIndex;
|
||||
final Function(int) onIndexChange;
|
||||
const MihPackage({
|
||||
super.key,
|
||||
required this.appActionButton,
|
||||
required this.appTools,
|
||||
required this.appBody,
|
||||
required this.appToolTitles,
|
||||
this.actionDrawer,
|
||||
required this.selectedbodyIndex,
|
||||
required this.onIndexChange,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackage> createState() => _MihPackageState();
|
||||
}
|
||||
|
||||
class _MihPackageState extends State<MihPackage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late int _currentIndex;
|
||||
late PageController _pageController;
|
||||
late AnimationController _animationController;
|
||||
DateTime? lastPressedAt;
|
||||
|
||||
void unfocusAll() {
|
||||
FocusScope.of(context).unfocus();
|
||||
}
|
||||
|
||||
Future<void> _peakAnimation() async {
|
||||
int currentPage = _currentIndex;
|
||||
double peakOffset = _pageController.position.viewportDimension * 0.075;
|
||||
double currentOffset =
|
||||
_pageController.page! * _pageController.position.viewportDimension;
|
||||
int nextPage =
|
||||
currentPage + 1 < widget.appBody.length ? currentPage + 1 : currentPage;
|
||||
if (nextPage != currentPage) {
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
await _pageController.animateTo(
|
||||
currentOffset + peakOffset,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeOut,
|
||||
);
|
||||
// await Future.delayed(const Duration(milliseconds: 100));
|
||||
await _pageController.animateTo(
|
||||
currentPage * _pageController.position.viewportDimension,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeIn,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_pageController.dispose();
|
||||
_animationController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant MihPackage oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.selectedbodyIndex != widget.selectedbodyIndex &&
|
||||
_currentIndex != widget.selectedbodyIndex) {
|
||||
_currentIndex = widget.selectedbodyIndex;
|
||||
_pageController.animateToPage(
|
||||
widget.selectedbodyIndex,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_currentIndex = widget.selectedbodyIndex;
|
||||
_pageController = PageController(initialPage: widget.selectedbodyIndex);
|
||||
_animationController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 400),
|
||||
);
|
||||
// if (!MzansiInnovationHub.of(context)!.theme.kIsWeb) {
|
||||
// // Trigger the peak animation on start (or call this elsewhere)
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// _peakAnimation();
|
||||
// });
|
||||
// }
|
||||
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
|
||||
// Trigger the peak animation only AFTER the route transition is complete
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final ModalRoute? currentRoute = ModalRoute.of(context);
|
||||
if (currentRoute != null) {
|
||||
currentRoute.animation?.addStatusListener((status) {
|
||||
if (status == AnimationStatus.completed && mounted) {
|
||||
// Ensure the widget is still mounted and the animation is completed
|
||||
_peakAnimation();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Size screenSize = MediaQuery.of(context).size;
|
||||
return GestureDetector(
|
||||
onTap: unfocusAll,
|
||||
child: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
if (GoRouterState.of(context).name == 'mihHome' ||
|
||||
GoRouterState.of(context).name == 'mihAuthentication') {
|
||||
if (lastPressedAt == null ||
|
||||
DateTime.now().difference(lastPressedAt!) >
|
||||
const Duration(seconds: 2)) {
|
||||
// First press: show a message and update the timestamp.
|
||||
lastPressedAt = DateTime.now();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
MihSnackBar(
|
||||
child: Text("Press back again to exit"),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Second press within 2 seconds: exit the app.
|
||||
KenLogger.warning('Exiting app...'); // Your custom logger
|
||||
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
|
||||
}
|
||||
} else {
|
||||
context.goNamed(
|
||||
'mihHome',
|
||||
extra: true,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
drawer: widget.actionDrawer,
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
minimum: EdgeInsets.only(bottom: 0),
|
||||
child: Container(
|
||||
width: screenSize.width,
|
||||
height: screenSize.height,
|
||||
//color: Colors.black,
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
widget.appActionButton,
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
// alignment: Alignment.center,
|
||||
// alignment: Alignment.centerRight,
|
||||
alignment: Alignment.centerLeft,
|
||||
// color: Colors.black,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
widget.appToolTitles[_currentIndex],
|
||||
style: const TextStyle(
|
||||
fontSize: 23,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
widget.appTools,
|
||||
const SizedBox(width: 5),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Expanded(
|
||||
child: PageView.builder(
|
||||
controller: _pageController,
|
||||
itemCount: widget.appBody.length,
|
||||
itemBuilder: (context, index) {
|
||||
return widget.appBody[index];
|
||||
},
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
widget.onIndexChange(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihPackageAction extends StatefulWidget {
|
||||
final void Function()? onTap;
|
||||
final double iconSize;
|
||||
final Widget icon;
|
||||
const MihPackageAction({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.iconSize,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackageAction> createState() => _MihPackageActionState();
|
||||
}
|
||||
|
||||
class _MihPackageActionState extends State<MihPackageAction> {
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
iconSize: widget.iconSize,
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: widget.onTap,
|
||||
icon: widget.icon,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,214 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:app_settings/app_settings.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_yt_video_player.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
|
||||
class MihPackageTile extends StatefulWidget {
|
||||
final String appName;
|
||||
final String? ytVideoID;
|
||||
final Widget appIcon;
|
||||
final void Function() onTap;
|
||||
final double iconSize;
|
||||
final Color textColor;
|
||||
final bool? authenticateUser;
|
||||
const MihPackageTile({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.appName,
|
||||
this.ytVideoID,
|
||||
required this.appIcon,
|
||||
required this.iconSize,
|
||||
required this.textColor,
|
||||
this.authenticateUser,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackageTile> createState() => _MihPackageTileState();
|
||||
}
|
||||
|
||||
class _MihPackageTileState extends State<MihPackageTile> {
|
||||
final LocalAuthentication _auth = LocalAuthentication();
|
||||
|
||||
void displayHint() {
|
||||
if (widget.ytVideoID != null) {
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: widget.appName,
|
||||
// windowTools: const [],
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: MIHYTVideoPlayer(
|
||||
videoYTLink: widget.ytVideoID!,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> isUserAuthenticated() async {
|
||||
final bool canAuthWithBio = await _auth.canCheckBiometrics;
|
||||
final bool canAuthenticate =
|
||||
canAuthWithBio || await _auth.isDeviceSupported();
|
||||
print("Auth Available: $canAuthenticate");
|
||||
if (canAuthenticate) {
|
||||
try {
|
||||
final bool didBioAuth = await _auth.authenticate(
|
||||
localizedReason: "Authenticate to access ${widget.appName}",
|
||||
options: const AuthenticationOptions(
|
||||
biometricOnly: false,
|
||||
),
|
||||
);
|
||||
if (didBioAuth) {
|
||||
return true;
|
||||
} else {
|
||||
authErrorPopUp();
|
||||
}
|
||||
// print("Authenticated: $didBioAuth");
|
||||
} catch (error) {
|
||||
print("Auth Error: $error");
|
||||
authErrorPopUp();
|
||||
}
|
||||
} else {
|
||||
print("Auth Error: No Biometrics Available");
|
||||
authErrorPopUp();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void authErrorPopUp() {
|
||||
MihAlertServices().errorAdvancedAlert(
|
||||
"Biometric Authentication Required",
|
||||
"Hi there! To jump into the ${widget.appName} Package, you'll need to authenticate yourself with your devices biometrics, please set up biometric authentication (like fingerprint, face ID, pattern or pin) on your device first.\n\nIf you have already set up biometric authentication, press \"Authenticate now\" to try again or press \"Set Up Authentication\" to go to your device settings.",
|
||||
[
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
AppSettings.openAppSettings(
|
||||
type: AppSettingsType.security,
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Set Up Authentication",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
authenticateUser();
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Authenticate Now",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
context,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> authenticateUser() async {
|
||||
if (widget.authenticateUser != null &&
|
||||
widget.authenticateUser! &&
|
||||
!kIsWeb &&
|
||||
!Platform.isLinux) {
|
||||
if (await isUserAuthenticated()) {
|
||||
widget.onTap();
|
||||
}
|
||||
} else {
|
||||
widget.onTap();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
alignment: Alignment.topCenter,
|
||||
// color: Colors.black,
|
||||
width: widget.iconSize,
|
||||
height: widget.iconSize,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
authenticateUser();
|
||||
},
|
||||
onLongPress: null, // Do this later
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.contain,
|
||||
alignment: Alignment.center,
|
||||
child: widget.appIcon,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Padding(
|
||||
// Add a little padding for better visual spacing
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4.0),
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
widget.appName,
|
||||
textAlign: TextAlign.center, // This centers the text content
|
||||
maxLines: 1, // Allow up to 2 lines to prevent clipping
|
||||
style: TextStyle(
|
||||
color: widget.textColor,
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihPackageToolBody extends StatefulWidget {
|
||||
final bool borderOn;
|
||||
final Widget bodyItem;
|
||||
final double? innerHorizontalPadding;
|
||||
const MihPackageToolBody({
|
||||
super.key,
|
||||
required this.borderOn,
|
||||
required this.bodyItem,
|
||||
this.innerHorizontalPadding,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackageToolBody> createState() => _MihPackageToolBodyState();
|
||||
}
|
||||
|
||||
class _MihPackageToolBodyState extends State<MihPackageToolBody> {
|
||||
late double _innerBodyPadding;
|
||||
double getHorizontalPaddingSize(Size screenSize) {
|
||||
if (MzansiInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
if (widget.borderOn) {
|
||||
return widget.innerHorizontalPadding ?? 10;
|
||||
} else {
|
||||
return widget.innerHorizontalPadding ?? 0;
|
||||
}
|
||||
} else {
|
||||
// mobile
|
||||
if (widget.borderOn) {
|
||||
return widget.innerHorizontalPadding ?? 10;
|
||||
} else {
|
||||
return widget.innerHorizontalPadding ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double getVerticalPaddingSize(Size screenSize) {
|
||||
// mobile
|
||||
if (widget.borderOn) {
|
||||
return 10;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Decoration? getBoader() {
|
||||
if (widget.borderOn) {
|
||||
_innerBodyPadding = 10.0;
|
||||
return BoxDecoration(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 3.0),
|
||||
);
|
||||
} else {
|
||||
_innerBodyPadding = 0.0;
|
||||
return BoxDecoration(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 3.0),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Size screenSize = MediaQuery.sizeOf(context);
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: getHorizontalPaddingSize(screenSize),
|
||||
right: getHorizontalPaddingSize(screenSize),
|
||||
bottom: getVerticalPaddingSize(screenSize),
|
||||
top: 0,
|
||||
),
|
||||
child: Container(
|
||||
height: screenSize.height,
|
||||
decoration: getBoader(),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(_innerBodyPadding),
|
||||
child: widget.bodyItem,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class MihPackageTools extends StatefulWidget {
|
||||
final Map<Widget, void Function()?> tools;
|
||||
int selcetedIndex;
|
||||
MihPackageTools({
|
||||
super.key,
|
||||
required this.tools,
|
||||
required this.selcetedIndex,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackageTools> createState() => _MihPackageToolsState();
|
||||
}
|
||||
|
||||
class _MihPackageToolsState extends State<MihPackageTools> {
|
||||
List<Widget> getTools() {
|
||||
List<Widget> temp = [];
|
||||
int index = 0;
|
||||
widget.tools.forEach((icon, onTap) {
|
||||
temp.add(
|
||||
Visibility(
|
||||
visible: widget.selcetedIndex != index,
|
||||
child: IconButton(
|
||||
onPressed: onTap,
|
||||
icon: icon,
|
||||
),
|
||||
),
|
||||
);
|
||||
temp.add(
|
||||
Visibility(
|
||||
visible: widget.selcetedIndex == index,
|
||||
child: IconButton.filled(
|
||||
onPressed: onTap,
|
||||
icon: icon,
|
||||
),
|
||||
),
|
||||
);
|
||||
index += 1;
|
||||
});
|
||||
return temp;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: getTools(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,221 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihPackageWindow extends StatefulWidget {
|
||||
final String? windowTitle;
|
||||
final Widget windowBody;
|
||||
final List<SpeedDialChild>? menuOptions;
|
||||
final void Function()? onWindowTapClose;
|
||||
final Color? backgroundColor;
|
||||
final Color? foregroundColor;
|
||||
final bool? borderOn;
|
||||
final bool fullscreen;
|
||||
final bool? scrollbarOn;
|
||||
const MihPackageWindow({
|
||||
super.key,
|
||||
required this.fullscreen,
|
||||
required this.windowTitle,
|
||||
this.menuOptions,
|
||||
required this.onWindowTapClose,
|
||||
required this.windowBody,
|
||||
this.borderOn,
|
||||
this.scrollbarOn,
|
||||
this.backgroundColor,
|
||||
this.foregroundColor,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihPackageWindow> createState() => _MihPackageWindowState();
|
||||
}
|
||||
|
||||
class _MihPackageWindowState extends State<MihPackageWindow> {
|
||||
late double windowTitleSize;
|
||||
late double horizontralWindowPadding;
|
||||
late double vertticalWindowPadding;
|
||||
late double windowWidth;
|
||||
late double windowHeight;
|
||||
late double width;
|
||||
late double height;
|
||||
|
||||
void checkScreenSize() {
|
||||
// print("screen width: $width");
|
||||
// print("screen height: $height");
|
||||
if (MzansiInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
setState(() {
|
||||
windowTitleSize = 25;
|
||||
horizontralWindowPadding = width / 7;
|
||||
vertticalWindowPadding = 10;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
windowTitleSize = 20;
|
||||
horizontralWindowPadding = 10;
|
||||
vertticalWindowPadding = 10;
|
||||
windowWidth = width;
|
||||
windowHeight = height;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Widget getHeader() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
if (widget.onWindowTapClose != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 5.0,
|
||||
left: 5.0,
|
||||
),
|
||||
child: MihButton(
|
||||
width: 40,
|
||||
height: 40,
|
||||
elevation: 10,
|
||||
onPressed: widget.onWindowTapClose,
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.windowTitle != null)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
widget.windowTitle!,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: windowTitleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.foregroundColor ??
|
||||
MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.menuOptions != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 5.0,
|
||||
right: 5.0,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 40,
|
||||
child: MihFloatingMenu(
|
||||
iconSize: 40,
|
||||
animatedIcon: AnimatedIcons.menu_close,
|
||||
direction: SpeedDialDirection.down,
|
||||
children: widget.menuOptions != null ? widget.menuOptions! : [],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var size = MediaQuery.of(context).size;
|
||||
setState(() {
|
||||
width = size.width;
|
||||
height = size.height;
|
||||
});
|
||||
checkScreenSize();
|
||||
return Dialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: horizontralWindowPadding,
|
||||
vertical: vertticalWindowPadding,
|
||||
),
|
||||
insetAnimationCurve: Easing.emphasizedDecelerate,
|
||||
insetAnimationDuration: Durations.short1,
|
||||
child: Material(
|
||||
elevation: 10,
|
||||
shadowColor: Colors.black,
|
||||
color: widget.backgroundColor ??
|
||||
MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: widget.borderOn == null || !widget.borderOn!
|
||||
? null
|
||||
: Border.all(
|
||||
color: widget.foregroundColor ??
|
||||
MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
width: 5.0),
|
||||
),
|
||||
child: widget.fullscreen
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
getHeader(),
|
||||
const SizedBox(height: 5),
|
||||
Expanded(
|
||||
child: widget.scrollbarOn != null || !widget.scrollbarOn!
|
||||
? widget.windowBody
|
||||
: MihSingleChildScroll(
|
||||
scrollbarOn: true,
|
||||
child: widget.windowBody,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
getHeader(),
|
||||
const SizedBox(height: 5),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25,
|
||||
right: 25,
|
||||
bottom: vertticalWindowPadding,
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: windowHeight * 0.85,
|
||||
maxWidth: windowWidth * 0.85,
|
||||
),
|
||||
child: MihSingleChildScroll(
|
||||
scrollbarOn: true,
|
||||
child: widget.windowBody,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
|
||||
class MihPersonalProfilePreview extends StatefulWidget {
|
||||
final AppUser user;
|
||||
@@ -36,15 +34,13 @@ class _MihPersonalProfilePreviewState extends State<MihPersonalProfilePreview> {
|
||||
? Icon(
|
||||
MihIcons.mihRing,
|
||||
size: profilePictureWidth,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: widget.imageFile == null
|
||||
? Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: profilePictureWidth,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: MihCircleAvatar(
|
||||
imageFile: widget.imageFile,
|
||||
@@ -53,10 +49,8 @@ class _MihPersonalProfilePreviewState extends State<MihPersonalProfilePreview> {
|
||||
editable: false,
|
||||
fileNameController: TextEditingController(),
|
||||
userSelectedfile: null,
|
||||
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: () {},
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -77,8 +76,7 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
||||
break;
|
||||
default:
|
||||
iconData = FontAwesomeIcons.link;
|
||||
btnColor = MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
btnColor = MihColors.primary();
|
||||
}
|
||||
return MihButton(
|
||||
width: 80,
|
||||
@@ -97,15 +95,15 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
||||
// onTap: () {
|
||||
// launchSocialUrl(Uri.parse(link.web_link));
|
||||
// },
|
||||
// appName: link.destination,
|
||||
// appIcon: Icon(
|
||||
// packageName: link.destination,
|
||||
// packageIcon: Icon(
|
||||
// iconData,
|
||||
// color: btnColor,
|
||||
// ),
|
||||
// iconSize: 200,
|
||||
// textColor: Colors.black,
|
||||
// // MihColors.getPrimaryColor(
|
||||
// // MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// // MihColors.primary(
|
||||
// // ),
|
||||
// );
|
||||
}
|
||||
|
||||
@@ -136,9 +134,7 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihRadioOptions extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String hintText;
|
||||
final Color fillColor;
|
||||
final Color secondaryFillColor;
|
||||
final bool requiredText;
|
||||
final List<String> radioOptions;
|
||||
const MihRadioOptions({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.hintText,
|
||||
required this.fillColor,
|
||||
required this.secondaryFillColor,
|
||||
required this.requiredText,
|
||||
required this.radioOptions,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihRadioOptions> createState() => _MihRadioOptionsState();
|
||||
}
|
||||
|
||||
class _MihRadioOptionsState extends State<MihRadioOptions> {
|
||||
// late String _currentSelection;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.controller.text.isEmpty && widget.radioOptions.isNotEmpty) {
|
||||
widget.controller.text = widget.radioOptions[0];
|
||||
}
|
||||
// else{
|
||||
// int index = widget.radioOptions
|
||||
// .indexWhere((element) => element == option);
|
||||
// _currentSelection = widget.radioOptions[index];
|
||||
// widget.controller.text = option;
|
||||
|
||||
// }
|
||||
// _currentSelection = widget.radioOptions[0];
|
||||
}
|
||||
|
||||
// The method to handle a change in selection.
|
||||
void _onChanged(String? value) {
|
||||
if (value != null) {
|
||||
widget.controller.text = value;
|
||||
}
|
||||
}
|
||||
|
||||
Widget displayRadioOptions(String selection) {
|
||||
return Material(
|
||||
elevation: 4.0,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.fillColor,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: Column(
|
||||
children: widget.radioOptions.map((option) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
_onChanged(option);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
option,
|
||||
style: TextStyle(
|
||||
color: widget.secondaryFillColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
Radio<String>(
|
||||
value: option,
|
||||
groupValue: selection,
|
||||
onChanged: _onChanged,
|
||||
activeColor: widget.secondaryFillColor,
|
||||
fillColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(Set<WidgetState> states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return widget.secondaryFillColor; // Color when selected
|
||||
}
|
||||
return widget.secondaryFillColor;
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnimatedBuilder(
|
||||
animation: widget.controller,
|
||||
builder: (context, child) {
|
||||
final currentSelection = widget.controller.text;
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
widget.hintText,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: widget.fillColor,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !widget.requiredText,
|
||||
child: Text(
|
||||
"(Optional)",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: widget.fillColor,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
displayRadioOptions(currentSelection),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
SnackBar MihSnackBar({
|
||||
required Widget child,
|
||||
}) {
|
||||
return SnackBar(
|
||||
content: child,
|
||||
shape: StadiumBorder(),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
duration: Duration(seconds: 2),
|
||||
width: null,
|
||||
action: SnackBarAction(
|
||||
label: "Dismiss",
|
||||
onPressed: () {},
|
||||
),
|
||||
// elevation: 30,
|
||||
);
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihSearchBar extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String hintText;
|
||||
final IconData prefixIcon;
|
||||
final IconData? prefixAltIcon;
|
||||
final List<Widget>? suffixTools;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final Color fillColor;
|
||||
final Color hintColor;
|
||||
final void Function()? onPrefixIconTap;
|
||||
final void Function()? onClearIconTap;
|
||||
final double? elevation;
|
||||
final FocusNode searchFocusNode;
|
||||
|
||||
const MihSearchBar({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
required this.hintText,
|
||||
required this.prefixIcon,
|
||||
this.prefixAltIcon,
|
||||
this.suffixTools,
|
||||
this.width,
|
||||
this.height,
|
||||
required this.fillColor,
|
||||
required this.hintColor,
|
||||
required this.onPrefixIconTap,
|
||||
this.onClearIconTap,
|
||||
this.elevation,
|
||||
required this.searchFocusNode,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MihSearchBar> createState() => _MihSearchBarState();
|
||||
}
|
||||
|
||||
class _MihSearchBarState extends State<MihSearchBar> {
|
||||
bool _showClearIcon = false;
|
||||
|
||||
Widget getPrefixIcon() {
|
||||
if (_showClearIcon) {
|
||||
// If the clear icon is shown and an alternative prefix icon is provided, use it
|
||||
return widget.prefixAltIcon != null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Icon(
|
||||
widget.prefixAltIcon,
|
||||
color: widget.hintColor,
|
||||
size: 35,
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
color: widget.hintColor,
|
||||
size: 35,
|
||||
),
|
||||
); // Default to search icon if no alt icon
|
||||
} else {
|
||||
// Return the primary prefix icon or the alternative if provided
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
color: widget.hintColor,
|
||||
size: 35,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// 1. Add the listener to the controller
|
||||
widget.controller.addListener(_updateClearIconVisibility);
|
||||
// 2. Initialize the clear icon visibility based on the current text
|
||||
_updateClearIconVisibility();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
widget.controller.removeListener(_updateClearIconVisibility);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _updateClearIconVisibility() {
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
final bool shouldShow = widget.controller.text.isNotEmpty;
|
||||
// Only call setState if the visibility state actually changes
|
||||
if (_showClearIcon != shouldShow) {
|
||||
setState(() {
|
||||
_showClearIcon = shouldShow;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
elevation: widget.elevation ?? 4.0, // Use provided elevation or default
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
color: widget.fillColor,
|
||||
child: AnimatedContainer(
|
||||
// Keep AnimatedContainer for width/height transitions
|
||||
alignment: Alignment.centerLeft,
|
||||
width: widget.width,
|
||||
height: widget.height ?? 50,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
),
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
selectionColor: widget.hintColor.withValues(alpha: 0.3),
|
||||
selectionHandleColor: widget.hintColor,
|
||||
),
|
||||
),
|
||||
child: TextField(
|
||||
textAlignVertical: TextAlignVertical.center,
|
||||
controller: widget.controller, // Assign the controller
|
||||
focusNode: widget.searchFocusNode,
|
||||
autocorrect: true,
|
||||
spellCheckConfiguration:
|
||||
!kIsWeb && (Platform.isAndroid || Platform.isIOS)
|
||||
? SpellCheckConfiguration()
|
||||
: null,
|
||||
onSubmitted: (value) {
|
||||
widget.onPrefixIconTap
|
||||
?.call(); // Call the prefix icon tap handler
|
||||
},
|
||||
style: TextStyle(
|
||||
color: widget.hintColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
),
|
||||
cursorColor: widget.hintColor,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
hintText: widget.hintText,
|
||||
hintStyle: TextStyle(
|
||||
color: widget.hintColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 10.0, vertical: 15.0),
|
||||
prefixIcon: GestureDetector(
|
||||
onTap: widget.onPrefixIconTap,
|
||||
child: getPrefixIcon(),
|
||||
),
|
||||
suffixIcon: Row(
|
||||
// Use a Row for multiple suffix icons
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
// Optional suffix tools
|
||||
if (widget.suffixTools != null) ...widget.suffixTools!,
|
||||
// Clear Icon (conditionally visible)
|
||||
if (_showClearIcon) // Only show if input is not empty
|
||||
IconButton(
|
||||
iconSize: 35,
|
||||
icon: Icon(Icons.clear,
|
||||
color: widget.hintColor), // Clear icon
|
||||
onPressed: widget.onClearIconTap ??
|
||||
() {
|
||||
widget.controller.clear();
|
||||
// No need for setState here, _updateClearIconVisibility will handle it
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihSingleChildScroll extends StatefulWidget {
|
||||
final Widget child;
|
||||
final bool? scrollbarOn;
|
||||
const MihSingleChildScroll({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.scrollbarOn,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihSingleChildScroll> createState() => _MihSingleChildScrollState();
|
||||
}
|
||||
|
||||
class _MihSingleChildScrollState extends State<MihSingleChildScroll> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
bottom: false,
|
||||
minimum: EdgeInsets.only(bottom: 5),
|
||||
child: ScrollConfiguration(
|
||||
behavior: ScrollConfiguration.of(context)
|
||||
.copyWith(scrollbars: widget.scrollbarOn ?? false),
|
||||
child: SingleChildScrollView(
|
||||
child: widget.child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,318 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihTextFormField extends StatefulWidget {
|
||||
final double? width;
|
||||
final double? height;
|
||||
final Color fillColor;
|
||||
final Color inputColor;
|
||||
final TextEditingController controller;
|
||||
final bool? hasError;
|
||||
final String? hintText;
|
||||
final double? borderRadius;
|
||||
final bool? multiLineInput;
|
||||
final bool? readOnly;
|
||||
final bool? passwordMode;
|
||||
final bool? numberMode;
|
||||
final bool requiredText;
|
||||
final FormFieldValidator<String>? validator;
|
||||
final List<String>? autofillHints;
|
||||
final double? elevation;
|
||||
final TextAlign? textIputAlignment;
|
||||
|
||||
const MihTextFormField({
|
||||
Key? key,
|
||||
this.width,
|
||||
this.height,
|
||||
required this.fillColor,
|
||||
required this.inputColor,
|
||||
required this.controller,
|
||||
this.hasError,
|
||||
required this.hintText,
|
||||
required this.requiredText,
|
||||
this.borderRadius,
|
||||
this.multiLineInput,
|
||||
this.readOnly,
|
||||
this.passwordMode,
|
||||
this.numberMode,
|
||||
this.validator,
|
||||
this.autofillHints,
|
||||
this.elevation,
|
||||
this.textIputAlignment,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MihTextFormField> createState() => _MihTextFormFieldState();
|
||||
}
|
||||
|
||||
class _MihTextFormFieldState extends State<MihTextFormField> {
|
||||
late bool _obscureText;
|
||||
FormFieldState<String>? _formFieldState;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_obscureText = widget.passwordMode ?? false;
|
||||
widget.controller.addListener(_onControllerTextChanged);
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant MihTextFormField oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
// If the controller itself changes, remove listener from old and add to new
|
||||
if (widget.controller != oldWidget.controller) {
|
||||
oldWidget.controller.removeListener(_onControllerTextChanged);
|
||||
widget.controller.addListener(_onControllerTextChanged);
|
||||
// Immediately update form field state if controller changed and has value
|
||||
_formFieldState?.didChange(widget.controller.text);
|
||||
}
|
||||
}
|
||||
|
||||
void _onControllerTextChanged() {
|
||||
// Only update the FormField's value if it's not already the same
|
||||
// and if the formFieldState is available.
|
||||
if (_formFieldState != null &&
|
||||
_formFieldState!.value != widget.controller.text) {
|
||||
_formFieldState!.didChange(widget.controller.text);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
widget.controller.removeListener(_onControllerTextChanged);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isMultiline = widget.multiLineInput == true;
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: widget.width,
|
||||
// height: widget.height,
|
||||
height: isMultiline ? null : widget.height,
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
selectionColor: widget.inputColor.withValues(alpha: 0.3),
|
||||
selectionHandleColor: widget.inputColor,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Visibility(
|
||||
visible: widget.hintText != null,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
widget.hintText ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: widget.fillColor,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !widget.requiredText,
|
||||
child: Text(
|
||||
"(Optional)",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: widget.fillColor,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
FormField<String>(
|
||||
initialValue: widget.controller.text,
|
||||
validator: widget.validator,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
builder: (field) {
|
||||
_formFieldState = field;
|
||||
return Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start, // <-- Add this line
|
||||
children: [
|
||||
Material(
|
||||
elevation: widget.elevation ?? 4.0,
|
||||
borderRadius:
|
||||
BorderRadius.circular(widget.borderRadius ?? 8.0),
|
||||
child: SizedBox(
|
||||
height: widget.height != null
|
||||
? widget.height! - 30
|
||||
: null,
|
||||
child: TextFormField(
|
||||
controller: widget.controller,
|
||||
cursorColor: widget.inputColor,
|
||||
autofillHints: widget.autofillHints,
|
||||
autocorrect: true,
|
||||
// spellCheckConfiguration: (kIsWeb ||
|
||||
// widget.passwordMode == true ||
|
||||
// widget.numberMode == true)
|
||||
// ? null
|
||||
// : SpellCheckConfiguration(),
|
||||
spellCheckConfiguration: !kIsWeb &&
|
||||
(Platform.isAndroid || Platform.isIOS)
|
||||
? SpellCheckConfiguration()
|
||||
: null,
|
||||
textAlign:
|
||||
widget.textIputAlignment ?? TextAlign.start,
|
||||
textAlignVertical: widget.multiLineInput == true
|
||||
? TextAlignVertical.top
|
||||
: TextAlignVertical.center,
|
||||
obscureText: widget.passwordMode == true
|
||||
? _obscureText
|
||||
: false,
|
||||
expands: widget.passwordMode == true
|
||||
? false
|
||||
: (widget.multiLineInput ?? false),
|
||||
maxLines: widget.passwordMode == true ? 1 : null,
|
||||
readOnly: widget.readOnly ?? false,
|
||||
keyboardType: widget.numberMode == true
|
||||
? const TextInputType.numberWithOptions(
|
||||
decimal: true)
|
||||
: null,
|
||||
inputFormatters: widget.numberMode == true
|
||||
? [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'^\d*\.?\d*'))
|
||||
]
|
||||
: null,
|
||||
style: TextStyle(
|
||||
color: widget.inputColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: widget.passwordMode == true
|
||||
? FocusScope(
|
||||
canRequestFocus: false,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
_obscureText
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: widget.inputColor,
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscureText = !_obscureText;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
: null,
|
||||
errorStyle: const TextStyle(
|
||||
height: 0, fontSize: 0), // <-- Add this line
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0, vertical: 8.0),
|
||||
filled: true,
|
||||
fillColor: widget.fillColor,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: field.hasError
|
||||
? BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 2.0,
|
||||
)
|
||||
: BorderSide.none,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: field.hasError
|
||||
? MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")
|
||||
: widget.inputColor,
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
onChanged: (value) {
|
||||
field.didChange(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
if (field.hasError)
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 8.0, top: 4.0),
|
||||
child: Text(
|
||||
field.errorText ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihTimeField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String labelText;
|
||||
final bool required;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final double? borderRadius;
|
||||
final double? elevation;
|
||||
final FormFieldValidator<String>? validator;
|
||||
|
||||
const MihTimeField({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.labelText,
|
||||
required this.required,
|
||||
this.width,
|
||||
this.height,
|
||||
this.borderRadius,
|
||||
this.elevation,
|
||||
this.validator,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihTimeField> createState() => _MihTimeFieldState();
|
||||
}
|
||||
|
||||
class _MihTimeFieldState extends State<MihTimeField> {
|
||||
FormFieldState<String>? _formFieldState;
|
||||
|
||||
Future<void> _selectTime(BuildContext context) async {
|
||||
TimeOfDay? picked = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: widget.controller.text.isNotEmpty
|
||||
? TimeOfDay(
|
||||
hour: int.tryParse(widget.controller.text.split(":")[0]) ?? 0,
|
||||
minute: int.tryParse(widget.controller.text.split(":")[1]) ?? 0,
|
||||
)
|
||||
: TimeOfDay.now(),
|
||||
builder: (context, child) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true),
|
||||
child: child as Widget,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (picked != null) {
|
||||
final hours = picked.hour.toString().padLeft(2, '0');
|
||||
final minutes = picked.minute.toString().padLeft(2, '0');
|
||||
widget.controller.text = "$hours:$minutes";
|
||||
_formFieldState?.didChange(widget.controller.text);
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
widget.labelText,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
if (!widget.required)
|
||||
Text(
|
||||
"(Optional)",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
FormField<String>(
|
||||
initialValue: widget.controller.text,
|
||||
validator: widget.validator,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
builder: (field) {
|
||||
_formFieldState = field;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Material(
|
||||
elevation: widget.elevation ?? 4.0,
|
||||
borderRadius:
|
||||
BorderRadius.circular(widget.borderRadius ?? 8.0),
|
||||
child: TextFormField(
|
||||
controller: widget.controller,
|
||||
readOnly: true,
|
||||
onTap: () => _selectTime(context),
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: Icon(
|
||||
Icons.access_time,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
errorStyle: const TextStyle(height: 0, fontSize: 0),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0, vertical: 8.0),
|
||||
filled: true,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: field.hasError
|
||||
? BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 2.0,
|
||||
)
|
||||
: BorderSide.none,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: field.hasError
|
||||
? MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")
|
||||
: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.borderRadius ?? 8.0),
|
||||
borderSide: BorderSide(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
width: 3.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
onChanged: (value) {
|
||||
field.didChange(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
if (field.hasError)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 4.0),
|
||||
child: Text(
|
||||
field.errorText ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihToggle extends StatefulWidget {
|
||||
final String hintText;
|
||||
final bool initialPostion;
|
||||
final Color fillColor;
|
||||
final Color secondaryFillColor;
|
||||
final bool? readOnly;
|
||||
final double? elevation;
|
||||
final void Function(bool) onChange;
|
||||
const MihToggle({
|
||||
super.key,
|
||||
required this.hintText,
|
||||
required this.initialPostion,
|
||||
required this.fillColor,
|
||||
required this.secondaryFillColor,
|
||||
this.readOnly,
|
||||
this.elevation,
|
||||
required this.onChange,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MihToggle> createState() => _MihToggleState();
|
||||
}
|
||||
|
||||
class _MihToggleState extends State<MihToggle> {
|
||||
late bool togglePosition;
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant MihToggle oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.initialPostion != oldWidget.initialPostion) {
|
||||
setState(() {
|
||||
togglePosition = widget.initialPostion;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
togglePosition = widget.initialPostion;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.hintText,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.fillColor,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
// Material(
|
||||
// elevation: widget.elevation ?? 0.01,
|
||||
// shadowColor: widget.secondaryFillColor.withOpacity(0.5),
|
||||
// color: Colors.transparent,
|
||||
// shape: StadiumBorder(),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(
|
||||
30), // Adjust the border radius to match the toggle
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
offset: Offset(
|
||||
0, widget.elevation ?? 10), // Adjust the vertical offset
|
||||
blurRadius: widget.elevation ?? 10,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Switch(
|
||||
value: togglePosition,
|
||||
trackOutlineColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) {
|
||||
if (widget.readOnly == true) {
|
||||
return Colors.grey;
|
||||
}
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"); // Outline color when active
|
||||
}
|
||||
return MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"); // Outline color when active
|
||||
},
|
||||
),
|
||||
activeColor: widget.readOnly == true
|
||||
? Colors.grey
|
||||
: widget.secondaryFillColor,
|
||||
activeTrackColor: widget.readOnly == true
|
||||
? Colors.grey.shade400
|
||||
: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
inactiveThumbColor: widget.readOnly == true
|
||||
? Colors.grey
|
||||
: widget.secondaryFillColor,
|
||||
inactiveTrackColor: widget.readOnly == true
|
||||
? Colors.grey.shade400
|
||||
: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// activeColor: widget.secondaryFillColor,
|
||||
// activeTrackColor: widget.fillColor,
|
||||
// inactiveThumbColor: widget.fillColor,
|
||||
// inactiveTrackColor: widget.secondaryFillColor,
|
||||
// onChanged: widget.readOnly != true ? widget.onChange : null,
|
||||
onChanged: widget.readOnly != true
|
||||
? (newValue) {
|
||||
setState(() {
|
||||
togglePosition = newValue; // Update internal state
|
||||
});
|
||||
widget.onChange(newValue); // Call the parent's onChange
|
||||
}
|
||||
: null,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:go_router/go_router.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_%20attributes.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_info.dart';
|
||||
@@ -37,11 +35,11 @@ class _AboutMihState extends State<AboutMih> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
context.read<AboutMihProvider>().setToolIndex(newIndex);
|
||||
},
|
||||
@@ -51,6 +49,7 @@ class _AboutMihState extends State<AboutMih> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -77,7 +76,7 @@ class _AboutMihState extends State<AboutMih> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||
selectedIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.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 PolicyAndTermsText {
|
||||
List<Widget> getPrivacyPolicyText(BuildContext context, bool english) {
|
||||
@@ -40,8 +38,7 @@ class PolicyAndTermsText {
|
||||
child: FittedBox(
|
||||
child: Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -452,8 +449,7 @@ class PolicyAndTermsText {
|
||||
child: FittedBox(
|
||||
child: Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class AboutMihTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -29,16 +26,14 @@ class _AboutMihTileState extends State<AboutMihTile> {
|
||||
// arguments: 0,
|
||||
// );
|
||||
},
|
||||
appName: "About MIH",
|
||||
appIcon: Icon(
|
||||
packageName: "About MIH",
|
||||
packageIcon: Icon(
|
||||
MihIcons.aboutMih,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
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';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class MihAttributes extends StatefulWidget {
|
||||
@@ -33,8 +29,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
||||
children: [
|
||||
Icon(
|
||||
resource,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 100,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
@@ -50,6 +45,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
@@ -71,8 +67,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
||||
children: [
|
||||
Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 165,
|
||||
),
|
||||
const SizedBox(
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_install_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_package_tool_body.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.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_services/mih_user_services.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
@@ -52,8 +46,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4.0),
|
||||
child: CircleAvatar(
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.primary(),
|
||||
backgroundImage: const AssetImage(
|
||||
"lib/mih_package_components/assets/images/founder.jpg"),
|
||||
//'https://media.licdn.com/dms/image/D4D03AQGd1-QhjtWWpA/profile-displayphoto-shrink_400_400/0/1671698053061?e=2147483647&v=beta&t=a3dJI5yxs5-KeXjj10LcNCFuC9IOfa8nNn3k_Qyr0CA'),
|
||||
@@ -63,8 +56,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
Icon(
|
||||
MihIcons.mihRing,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -208,15 +200,13 @@ class _MihInfoState extends State<MihInfo> {
|
||||
children: [
|
||||
FaIcon(
|
||||
platformIcon,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
btnText,
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -267,9 +257,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
redact: isLoading,
|
||||
configuration: RedactedConfiguration(
|
||||
defaultBorderRadius: BorderRadius.circular(5),
|
||||
redactedColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
redactedColor: MihColors.secondary(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -322,9 +310,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
redact: isLoading,
|
||||
configuration: RedactedConfiguration(
|
||||
defaultBorderRadius: BorderRadius.circular(5),
|
||||
redactedColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
redactedColor: MihColors.secondary(),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -350,8 +336,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.grey(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -364,8 +349,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
child: FittedBox(
|
||||
child: Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -450,11 +434,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
Text(
|
||||
"Please select the platform you want to install/ Update MIH from",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -468,29 +448,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.googlePlay,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Play Store",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -509,29 +479,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
Icons.store,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"App Gallery",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -548,8 +508,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
MihInstallServices().installMihTrigger(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: getInstallButtonText(),
|
||||
),
|
||||
@@ -561,24 +520,20 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.youtube,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"MIH Beginners Guide",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -594,24 +549,20 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.patreon,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Support Our Journey",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -664,25 +615,20 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.tiktok,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"@womenforchange.sa",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -698,25 +644,20 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FaIcon(
|
||||
Icons.edit,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Sign Petition",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -890,6 +831,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
@@ -925,19 +867,15 @@ class _MihInfoState extends State<MihInfo> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.android,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Android",
|
||||
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: () {
|
||||
shareMIHLink(
|
||||
context,
|
||||
@@ -949,19 +887,15 @@ class _MihInfoState extends State<MihInfo> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.apple,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "iOS",
|
||||
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: () {
|
||||
shareMIHLink(
|
||||
context,
|
||||
@@ -973,19 +907,15 @@ class _MihInfoState extends State<MihInfo> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.store,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Huawei",
|
||||
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: () {
|
||||
shareMIHLink(
|
||||
context,
|
||||
@@ -997,19 +927,15 @@ class _MihInfoState extends State<MihInfo> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.vpn_lock,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Web",
|
||||
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: () {
|
||||
shareMIHLink(
|
||||
context,
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.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_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -18,6 +14,7 @@ class _MihPrivacyPolicyState extends State<MihPrivacyPolicy> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(context),
|
||||
);
|
||||
@@ -34,14 +31,12 @@ class _MihPrivacyPolicyState extends State<MihPrivacyPolicy> {
|
||||
englishOn = !englishOn;
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
englishOn ? "Simplified Chinese" : "English",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.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_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -18,6 +14,7 @@ class _MIHTermsOfServiceState extends State<MIHTermsOfService> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(context),
|
||||
);
|
||||
@@ -34,14 +31,12 @@ class _MIHTermsOfServiceState extends State<MIHTermsOfService> {
|
||||
englishOn = !englishOn;
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
englishOn ? "Simplified Chinese" : "English",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/access_request.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
@@ -103,30 +101,20 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
TextSpan accessWithColour;
|
||||
if (access == "APPROVED") {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
text: "$access\n", style: TextStyle(color: MihColors.green()));
|
||||
} else if (access == "PENDING") {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
text: "$access\n", style: TextStyle(color: MihColors.grey()));
|
||||
} else {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
accessWithColour =
|
||||
TextSpan(text: "$access\n", style: TextStyle(color: MihColors.red()));
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
title: Text(
|
||||
line1,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
subtitle: RichText(
|
||||
@@ -142,7 +130,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
// Text(
|
||||
// subtitle,
|
||||
// style: TextStyle(
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
// ),
|
||||
onTap: () {
|
||||
@@ -158,7 +146,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
},
|
||||
// trailing: Icon(
|
||||
// Icons.arrow_forward,
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
);
|
||||
}
|
||||
@@ -213,8 +201,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -231,15 +218,12 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
onPressed: () {
|
||||
updateAccessAPICall(index, "declined");
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Decline",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -249,15 +233,12 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
onPressed: () {
|
||||
updateAccessAPICall(index, "approved");
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Approve",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -294,8 +275,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.accessRequests.length,
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.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/patient_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_access_controls_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -58,30 +56,20 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
TextSpan accessWithColour;
|
||||
if (access == "APPROVED") {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
text: "$access\n", style: TextStyle(color: MihColors.green()));
|
||||
} else if (access == "PENDING") {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
text: "$access\n", style: TextStyle(color: MihColors.grey()));
|
||||
} else {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
accessWithColour =
|
||||
TextSpan(text: "$access\n", style: TextStyle(color: MihColors.red()));
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
title: Text(
|
||||
line1,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
subtitle: RichText(
|
||||
@@ -96,7 +84,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
// Text(
|
||||
// subtitle,
|
||||
// style: TextStyle(
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
// ),
|
||||
onTap: () {
|
||||
@@ -104,7 +92,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
},
|
||||
// trailing: Icon(
|
||||
// Icons.arrow_forward,
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
);
|
||||
}
|
||||
@@ -173,8 +161,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -191,18 +178,14 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"Important Notice: Approving Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -211,9 +194,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -223,9 +204,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -235,9 +214,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -245,9 +222,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"By pressing the \"Approve\" button you accept the above terms.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -263,18 +238,14 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"Important Notice: Approved Profile Access",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"You have accepted access to your patient's profile. Please be aware of the following important points:",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -283,9 +254,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"1. Permanent Access: This access is permanent.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -295,9 +264,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -307,9 +274,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -355,16 +320,12 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
MihAlertServices().internetConnectionAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Decline",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -396,16 +357,12 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
MihAlertServices().internetConnectionAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Approve",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -438,15 +395,13 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
widget.onSuccessUpate!();
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -488,8 +443,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: filterAccessList(accessProvider.accessList!).length,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'package:go_router/go_router.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/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tools/mih_access_requests.dart';
|
||||
@@ -59,11 +56,11 @@ class _MihAccessState extends State<MihAccess> {
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: accessProvider.toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: accessProvider.toolIndex,
|
||||
onIndexChange: (newValue) {
|
||||
accessProvider.setToolIndex(newValue);
|
||||
},
|
||||
@@ -75,6 +72,7 @@ class _MihAccessState extends State<MihAccess> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -92,7 +90,7 @@ class _MihAccessState extends State<MihAccess> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihAccessControllsProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihAccessControllsProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
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_package_components/mih_icons.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihAccessTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -31,16 +28,14 @@ class _MihAccessTileState extends State<MihAccessTile> {
|
||||
// arguments: widget.signedInUser,
|
||||
// );
|
||||
},
|
||||
appName: "Access Controls",
|
||||
appIcon: Icon(
|
||||
packageName: "Access Controls",
|
||||
packageIcon: Icon(
|
||||
MihIcons.accessControl,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/patient_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/builder/build_business_access_list.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_access_controls_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -178,6 +176,7 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
innerHorizontalPadding: 10,
|
||||
bodyItem: getBody(),
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:go_router/go_router.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calculator_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tools/currency_exchange_rate.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tools/simple_calc.dart';
|
||||
@@ -42,11 +40,11 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
context.read<MihCalculatorProvider>().setToolIndex(newIndex);
|
||||
},
|
||||
@@ -56,6 +54,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -79,7 +78,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihCalculatorTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -26,16 +23,14 @@ class _MihCalculatorTileState extends State<MihCalculatorTile> {
|
||||
"mihCalculator",
|
||||
);
|
||||
},
|
||||
appName: "Calculator",
|
||||
appIcon: Icon(
|
||||
packageName: "Calculator",
|
||||
packageIcon: Icon(
|
||||
MihIcons.calculator,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,10 @@ import 'dart:io';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.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_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_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_text_form_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calculator_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_currency_exchange_rate_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
@@ -76,8 +69,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
Icon(
|
||||
Icons.currency_exchange,
|
||||
size: 150,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
FittedBox(
|
||||
@@ -87,8 +79,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -103,9 +94,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -117,9 +106,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -136,9 +123,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -150,9 +135,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -194,8 +177,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -215,8 +197,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
'$companyName makes no representations or warranties of any kind, express or implied, as to the accuracy, completeness, reliability, or suitability of the information and calculations generated by the Tool. All exchange rates and results are estimates and are subject to change without notice.',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
@@ -227,8 +208,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
'The information provided by the Tool should not be construed as financial, investment, trading, or any other form of advice. You should not make any financial decisions based solely on the output of this Tool. We expressly recommend that you seek independent professional advice and verify all data with a qualified financial advisor and/or through alternative, reliable market data sources before executing any foreign exchange transactions.',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
@@ -239,8 +219,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
'By using the Tool, you agree that $companyName, its affiliates, directors, and employees shall not be held liable for any direct, indirect, incidental, special, consequential, or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data, or other intangible losses, resulting from: (i) the use or the inability to use the Tool; (ii) any inaccuracies, errors, or omissions in the Tool\'s calculations or data; or (iii) any reliance placed by you on the information provided by the Tool.',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
@@ -255,8 +234,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
children: <TextSpan>[
|
||||
@@ -287,6 +265,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
innerHorizontalPadding: 10,
|
||||
bodyItem: getBody(screenWidth),
|
||||
@@ -309,12 +288,8 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
formKey: _formKey,
|
||||
formFields: <Widget>[
|
||||
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: _fromAmountController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -354,9 +329,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
),
|
||||
children: [
|
||||
const TextSpan(
|
||||
@@ -365,9 +338,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
text: "Diclaimer",
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
@@ -398,18 +369,12 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Calculate",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -419,18 +384,12 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
|
||||
onPressed: () {
|
||||
clearInput();
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Clear",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.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_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:math_expressions/math_expressions.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class SimpleCalc extends StatefulWidget {
|
||||
const SimpleCalc({super.key});
|
||||
@@ -73,6 +70,7 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
innerHorizontalPadding: 10,
|
||||
bodyItem: getBody(),
|
||||
@@ -109,8 +107,7 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
userInput,
|
||||
style: TextStyle(
|
||||
fontSize: 40,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -124,8 +121,7 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
answer,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
@@ -160,18 +156,14 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
answer = '0';
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.purple(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Text(
|
||||
buttons[index],
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -190,18 +182,14 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
userInput += buttons[index];
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.grey(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Text(
|
||||
buttons[index],
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -219,18 +207,14 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
userInput += buttons[index];
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.grey(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Text(
|
||||
buttons[index],
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -259,18 +243,14 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
});
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.grey(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Text(
|
||||
buttons[index],
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -299,17 +279,13 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
equalPressed();
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Icon(
|
||||
Icons.backspace,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -325,18 +301,14 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
userInput = answer;
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Text(
|
||||
buttons[index],
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -355,18 +327,14 @@ class _SimpleCalcState extends State<SimpleCalc> {
|
||||
equalPressed();
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 5,
|
||||
child: Text(
|
||||
buttons[index],
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_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_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_text_form_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:math_expressions/math_expressions.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_toggle.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class TipCalc extends StatefulWidget {
|
||||
@@ -111,8 +103,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.coins,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
@@ -122,8 +113,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -134,8 +124,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
@@ -145,8 +134,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.moneyBills,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
@@ -156,8 +144,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -168,8 +155,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -178,8 +164,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
if (splitBillController.text == "Yes") const Divider(),
|
||||
@@ -190,8 +175,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
children: [
|
||||
FaIcon(
|
||||
FontAwesomeIcons.peopleGroup,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 35,
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
@@ -201,9 +185,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -215,8 +197,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
if (splitBillController.text == "Yes")
|
||||
@@ -226,8 +207,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
@@ -258,6 +238,7 @@ class _TipCalcState extends State<TipCalc> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
innerHorizontalPadding: 10,
|
||||
bodyItem: getBody(screenWidth),
|
||||
@@ -278,10 +259,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
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: billAmountController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -293,10 +272,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
),
|
||||
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: tipPercentageController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -310,10 +287,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
MihToggle(
|
||||
hintText: "Split Bill",
|
||||
initialPostion: splitPosition,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
secondaryFillColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fillColor: MihColors.secondary(),
|
||||
secondaryFillColor: MihColors.primary(),
|
||||
onChange: (value) {
|
||||
setState(() {
|
||||
splitBillController.text = value ? "Yes" : "No";
|
||||
@@ -350,12 +325,8 @@ class _TipCalcState extends State<TipCalc> {
|
||||
children: [
|
||||
MihNumericStepper(
|
||||
controller: noPeopleController,
|
||||
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: "No. People",
|
||||
requiredText: temp == "Yes",
|
||||
minValue: 2,
|
||||
@@ -406,16 +377,12 @@ class _TipCalcState extends State<TipCalc> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Calculate",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -425,16 +392,12 @@ class _TipCalcState extends State<TipCalc> {
|
||||
onPressed: () {
|
||||
clearInput();
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Clear",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/access_request.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
@@ -103,30 +101,20 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
TextSpan accessWithColour;
|
||||
if (access == "APPROVED") {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
text: "$access\n", style: TextStyle(color: MihColors.green()));
|
||||
} else if (access == "PENDING") {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
text: "$access\n", style: TextStyle(color: MihColors.grey()));
|
||||
} else {
|
||||
accessWithColour = TextSpan(
|
||||
text: "$access\n",
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
||||
accessWithColour =
|
||||
TextSpan(text: "$access\n", style: TextStyle(color: MihColors.red()));
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
title: Text(
|
||||
line1,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
subtitle: RichText(
|
||||
@@ -142,7 +130,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
// Text(
|
||||
// subtitle,
|
||||
// style: TextStyle(
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
// ),
|
||||
onTap: () {
|
||||
@@ -158,7 +146,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
},
|
||||
// trailing: Icon(
|
||||
// Icons.arrow_forward,
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
);
|
||||
}
|
||||
@@ -213,8 +201,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
subtitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: popUpBodySize,
|
||||
//fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -231,15 +218,12 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
onPressed: () {
|
||||
updateAccessAPICall(index, "declined");
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.red(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Decline",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -249,15 +233,12 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
onPressed: () {
|
||||
updateAccessAPICall(index, "approved");
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Approve",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -294,8 +275,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.accessRequests.length,
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:go_router/go_router.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/appointment.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_calendar_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.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_form.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.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_config/mih_env.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -106,20 +100,16 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
|
||||
int appointHour = int.parse(timePart.split(':')[0]);
|
||||
|
||||
Color appointmentColor = MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
Color appointmentColor = MihColors.secondary();
|
||||
|
||||
if (currentDate == datePart) {
|
||||
if (appointHour < hourNow) {
|
||||
appointmentColor = MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
appointmentColor = MihColors.grey();
|
||||
} else if (appointHour == hourNow) {
|
||||
appointmentColor = MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
appointmentColor = MihColors.green();
|
||||
}
|
||||
} else if (DateTime.parse(datePart).isBefore(DateTime.parse(currentDate))) {
|
||||
appointmentColor = MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
appointmentColor = MihColors.grey();
|
||||
}
|
||||
|
||||
return Container(
|
||||
@@ -179,19 +169,15 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Edit Appointment",
|
||||
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: () {
|
||||
appointmentUpdateWindow(mzansiProfileProvider,
|
||||
mihCalendarProvider, index, bodyWidth);
|
||||
@@ -200,19 +186,15 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Delete Appointment",
|
||||
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: () {
|
||||
deleteAppointmentConfirmationWindow(
|
||||
mzansiProfileProvider, mihCalendarProvider, index);
|
||||
@@ -232,10 +214,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
children: [
|
||||
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: widget.titleController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -244,10 +224,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.dateController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -256,10 +234,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.timeController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -268,10 +244,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.descriptionIDController,
|
||||
multiLineInput: true,
|
||||
height: 250,
|
||||
@@ -304,19 +278,15 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Edit Appointment",
|
||||
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: () {
|
||||
appointmentUpdateWindow(mzansiProfileProvider,
|
||||
mihCalendarProvider, index, bodyWidth);
|
||||
@@ -325,19 +295,15 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Delete Appointment",
|
||||
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: () {
|
||||
deleteAppointmentConfirmationWindow(
|
||||
mzansiProfileProvider, mihCalendarProvider, index);
|
||||
@@ -357,10 +323,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
children: [
|
||||
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: widget.titleController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -369,10 +333,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.dateController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -381,10 +343,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.timeController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -393,10 +353,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.descriptionIDController,
|
||||
multiLineInput: true,
|
||||
height: 250,
|
||||
@@ -460,12 +418,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
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: widget.titleController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -494,12 +448,8 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
),
|
||||
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: widget.descriptionIDController,
|
||||
multiLineInput: true,
|
||||
height: 250,
|
||||
@@ -527,18 +477,12 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Update",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -681,15 +625,13 @@ class _BuildAppointmentListState extends State<BuildAppointmentList> {
|
||||
clearControllers();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/patient_queue.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
|
||||
class BuildQueueList extends StatefulWidget {
|
||||
@@ -43,8 +42,7 @@ class _BuildQueueListState extends State<BuildQueueList> {
|
||||
title: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
subtitle: RichText(
|
||||
@@ -85,8 +83,7 @@ class _BuildQueueListState extends State<BuildQueueList> {
|
||||
shrinkWrap: true,
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientQueue.length,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'package:go_router/go_router.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/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calendar/package_tools/appointments.dart';
|
||||
@@ -59,11 +56,11 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: calendarProvider.toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: calendarProvider.toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
calendarProvider.setToolIndex(newIndex);
|
||||
},
|
||||
@@ -75,6 +72,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.read<MihCalendarProvider>().resetSelectedDay();
|
||||
@@ -94,7 +92,7 @@ class _MzansiCalendarState extends State<MzansiCalendar> {
|
||||
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihCalendarProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihCalendarProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
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_package_components/mih_icons.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MzansiCalendarTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -30,16 +27,14 @@ class _MzansiCalendarTileState extends State<MzansiCalendarTile> {
|
||||
// arguments: widget.arguments,
|
||||
// );
|
||||
},
|
||||
appName: "Calendar",
|
||||
appIcon: Icon(
|
||||
packageName: "Calendar",
|
||||
packageIcon: Icon(
|
||||
MihIcons.calendar,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_calendar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_calendar_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.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_form.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.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_objects/appointment.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calendar/builder/build_appointment_list.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -75,8 +65,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
Icon(
|
||||
MihIcons.calendar,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -86,9 +75,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -99,9 +86,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -110,9 +95,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
child: Icon(
|
||||
Icons.menu,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
@@ -155,12 +138,8 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
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: _appointmentTitleController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -189,12 +168,8 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
),
|
||||
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: _appointmentDescriptionIDController,
|
||||
multiLineInput: true,
|
||||
height: 250,
|
||||
@@ -215,16 +190,12 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Add",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -324,15 +295,13 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
_appointmentDescriptionIDController.clear();
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -383,7 +352,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
});
|
||||
}),
|
||||
// Divider(
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
displayAppointmentList(
|
||||
mzansiProfileProvider,
|
||||
@@ -401,21 +370,15 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Add Appointment",
|
||||
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: () {
|
||||
addAppointmentWindow(
|
||||
mzansiProfileProvider, mihCalendarProvider, width);
|
||||
@@ -477,6 +440,7 @@ class _PatientAccessRequestState extends State<Appointments> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(screenWidth),
|
||||
);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/package_tools/mih_forgot_password.dart';
|
||||
|
||||
class MihAuthForgotPassword extends StatefulWidget {
|
||||
@@ -13,7 +11,7 @@ class MihAuthForgotPassword extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihAuthForgotPasswordState extends State<MihAuthForgotPassword> {
|
||||
int _selcetedIndex = 0;
|
||||
int _selectedIndex = 0;
|
||||
late final MihForgotPassword _forgotPassword;
|
||||
|
||||
@override
|
||||
@@ -25,14 +23,14 @@ class _MihAuthForgotPasswordState extends State<MihAuthForgotPassword> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appToolTitles: ["Forgot Password"],
|
||||
appBody: getToolBody(),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolTitles: ["Forgot Password"],
|
||||
packageToolBodies: getToolBody(),
|
||||
selectedBodyIndex: _selectedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
_selectedIndex = newValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -41,6 +39,7 @@ class _MihAuthForgotPasswordState extends State<MihAuthForgotPassword> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -56,12 +55,12 @@ class _MihAuthForgotPasswordState extends State<MihAuthForgotPassword> {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.question_mark_rounded)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
selectedIndex: _selectedIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/package_tools/mih_reset_password.dart';
|
||||
|
||||
class MihAuthPasswordReset extends StatefulWidget {
|
||||
@@ -18,7 +15,7 @@ class MihAuthPasswordReset extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihAuthPasswordResetState extends State<MihAuthPasswordReset> {
|
||||
int _selcetedIndex = 0;
|
||||
int _selectedIndex = 0;
|
||||
late final MihResetPassword _resetPassword;
|
||||
|
||||
@override
|
||||
@@ -30,14 +27,14 @@ class _MihAuthPasswordResetState extends State<MihAuthPasswordReset> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: ["Reset Password"],
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: ["Reset Password"],
|
||||
selectedBodyIndex: _selectedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
_selectedIndex = newValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -48,6 +45,7 @@ class _MihAuthPasswordResetState extends State<MihAuthPasswordReset> {
|
||||
padding: const EdgeInsets.only(left: 5.0),
|
||||
child: MihPackageAction(
|
||||
icon: const Icon(MihIcons.mihLogo),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 45,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -64,12 +62,12 @@ class _MihAuthPasswordResetState extends State<MihAuthPasswordReset> {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.password_rounded)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
selectedIndex: _selectedIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_authentication_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/package_tools/mih_register.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/package_tools/mih_sign_in.dart';
|
||||
@@ -30,11 +27,11 @@ class _MihAuthenticationState extends State<MihAuthentication> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: context.watch<MihAuthenticationProvider>().toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: context.watch<MihAuthenticationProvider>().toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
context.read<MihAuthenticationProvider>().setToolIndex(newIndex);
|
||||
},
|
||||
@@ -66,7 +63,7 @@ class _MihAuthenticationState extends State<MihAuthentication> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihAuthenticationProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihAuthenticationProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -75,6 +72,7 @@ class _MihAuthenticationState extends State<MihAuthentication> {
|
||||
padding: const EdgeInsets.only(left: 5.0),
|
||||
child: MihPackageAction(
|
||||
icon: const Icon(MihIcons.mihLogo),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 45,
|
||||
onTap: () {
|
||||
context.goNamed("aboutMih", extra: true);
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.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_package_components/mih_text_form_field.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_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_authentication_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
@@ -61,14 +55,12 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
context.pop();
|
||||
validateInput();
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Continue",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -91,14 +83,12 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
extra: true,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -125,6 +115,7 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(screenWidth),
|
||||
);
|
||||
@@ -156,8 +147,7 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
@@ -167,8 +157,7 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -176,10 +165,8 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
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: emailController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -200,16 +187,12 @@ class _MihForgotPasswordState extends State<MihForgotPassword> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Reset Password",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -3,16 +3,10 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.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_package_components/mih_text_form_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_authentication_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_user_services.dart';
|
||||
@@ -163,14 +157,12 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 200,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -185,6 +177,7 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(screenWidth),
|
||||
);
|
||||
@@ -218,8 +211,7 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
@@ -229,8 +221,7 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -240,10 +231,8 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
formFields: [
|
||||
//email input
|
||||
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: emailController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -257,10 +246,8 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
const SizedBox(height: 10),
|
||||
//password input
|
||||
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: passwordController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -274,10 +261,8 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
//spacer
|
||||
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: confirmPasswordController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -306,16 +291,12 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Create New Account",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -327,16 +308,12 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
.read<MihAuthenticationProvider>()
|
||||
.setToolIndex(0);
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"I have an account",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.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_package_components/mih_text_form_field.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_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_authentication_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
@@ -63,15 +57,13 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
extra: true,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -86,6 +78,7 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(screenWidth),
|
||||
);
|
||||
@@ -120,8 +113,7 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
@@ -131,8 +123,7 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -141,10 +132,8 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
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: passwordController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -158,10 +147,8 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
//spacer
|
||||
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: confirmPasswordController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -184,16 +171,12 @@ class _MihResetPasswordState extends State<MihResetPassword> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Reset Password",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tile.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_package_components/mih_text_form_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_authentication_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_authentication_services.dart';
|
||||
@@ -80,15 +74,15 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
appName: "Patient",
|
||||
appIcon: Icon(
|
||||
packageName: "Patient",
|
||||
packageIcon: Icon(
|
||||
Icons.perm_identity_rounded,
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
iconSize: 200,
|
||||
textColor: getPrim(),
|
||||
authenticateUser: false,
|
||||
// authenticateUser: false,
|
||||
));
|
||||
tileList.add(MihPackageTile(
|
||||
onTap: () {
|
||||
@@ -102,15 +96,15 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
appName: "Doctor",
|
||||
appIcon: Icon(
|
||||
packageName: "Doctor",
|
||||
packageIcon: Icon(
|
||||
Icons.medical_services,
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
iconSize: 200,
|
||||
textColor: getPrim(),
|
||||
authenticateUser: false,
|
||||
// authenticateUser: false,
|
||||
));
|
||||
//if (AppEnviroment.getEnv() == "Dev") {
|
||||
tileList.add(MihPackageTile(
|
||||
@@ -125,15 +119,15 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
appName: "Business",
|
||||
appIcon: Icon(
|
||||
packageName: "Business",
|
||||
packageIcon: Icon(
|
||||
Icons.business,
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
iconSize: 200,
|
||||
textColor: getPrim(),
|
||||
authenticateUser: false,
|
||||
// authenticateUser: false,
|
||||
));
|
||||
tileList.add(MihPackageTile(
|
||||
onTap: () {
|
||||
@@ -147,27 +141,25 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
appName: "Test",
|
||||
appIcon: Icon(
|
||||
packageName: "Test",
|
||||
packageIcon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
iconSize: 200,
|
||||
textColor: getPrim(),
|
||||
authenticateUser: false,
|
||||
// authenticateUser: false,
|
||||
));
|
||||
//}
|
||||
}
|
||||
|
||||
Color getPrim() {
|
||||
return MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.secondary();
|
||||
}
|
||||
|
||||
Color getSec() {
|
||||
return MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.primary();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -182,6 +174,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(screenWidth),
|
||||
);
|
||||
@@ -228,16 +221,12 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
onPressed: () {
|
||||
MihInstallServices().installMihTrigger(context);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 150,
|
||||
child: Text(
|
||||
"Install MIH",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -251,8 +240,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
Icon(
|
||||
Icons.lock,
|
||||
size: 100,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
//spacer
|
||||
const SizedBox(height: 10),
|
||||
@@ -262,8 +250,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
//spacer
|
||||
@@ -272,12 +259,8 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
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: emailController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -291,12 +274,8 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
const SizedBox(height: 10),
|
||||
//password input
|
||||
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: passwordController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
@@ -328,11 +307,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
'Forgot Password?',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -359,18 +334,12 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Sign In",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -382,18 +351,12 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
.read<MihAuthenticationProvider>()
|
||||
.setToolIndex(1);
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Create New Account",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -430,11 +393,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark")),
|
||||
color: MihColors.secondary()),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@@ -481,11 +440,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_action.dart';
|
||||
import 'package:pdf/pdf.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
import '../../../mih_package_components/mih_loading_circle.dart';
|
||||
|
||||
class MIHPrintPreview extends StatefulWidget {
|
||||
final PrintPreviewArguments arguments;
|
||||
@@ -22,6 +21,7 @@ class _MIHPrintPreviewState extends State<MIHPrintPreview> {
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_file_viewer_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_file_viewer/package_tools/mih_expanded_file_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -21,11 +19,11 @@ class _MihFleViewerState extends State<MihFleViewer> {
|
||||
builder: (BuildContext context, MihFileViewerProvider fileViewerProvider,
|
||||
Widget? child) {
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: fileViewerProvider.toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: fileViewerProvider.toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
fileViewerProvider.setToolIndex(newIndex);
|
||||
},
|
||||
@@ -37,6 +35,7 @@ class _MihFleViewerState extends State<MihFleViewer> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.fullscreen_exit),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.pop();
|
||||
@@ -59,7 +58,7 @@ class _MihFleViewerState extends State<MihFleViewer> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihFileViewerProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihFileViewerProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,8 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_file_viewer_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:syncfusion_flutter_core/theme.dart';
|
||||
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
|
||||
@@ -56,6 +53,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
double width = size.width;
|
||||
double height = size.height;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width, height),
|
||||
);
|
||||
@@ -75,9 +73,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
height: height - 70,
|
||||
child: SfPdfViewerTheme(
|
||||
data: SfPdfViewerThemeData(
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
backgroundColor: MihColors.primary(),
|
||||
),
|
||||
child: SfPdfViewer.network(
|
||||
fileViewerProvider.fileLink,
|
||||
@@ -111,8 +107,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
child: Material(
|
||||
elevation: 10,
|
||||
shadowColor: Colors.black,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -138,9 +133,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.arrow_back,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
if (isPDF)
|
||||
@@ -149,9 +142,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
if (isPDF)
|
||||
@@ -169,9 +160,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.arrow_forward,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
if (isPDF)
|
||||
@@ -194,9 +183,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.zoom_in,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
if (isPDF)
|
||||
@@ -221,9 +208,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.zoom_out,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
// IconButton(
|
||||
@@ -234,7 +219,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.print,
|
||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.secondary(),
|
||||
// ),
|
||||
// ),
|
||||
IconButton(
|
||||
@@ -252,9 +237,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.download,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_authentication_provider.dart';
|
||||
@@ -14,9 +14,7 @@ import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.da
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_wallet_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/patient_manager_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../main.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
class MIHAppDrawer extends StatefulWidget {
|
||||
@@ -83,10 +81,8 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
fileNameController: proPicController,
|
||||
onChange: (_) {},
|
||||
userSelectedfile: null,
|
||||
frameColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
frameColor: MihColors.primary(),
|
||||
backgroundColor: MihColors.secondary(),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -111,7 +107,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
MzansiProfileProvider mzansiProfileProvider, Widget? child) {
|
||||
return SafeArea(
|
||||
child: Drawer(
|
||||
//backgroundColor: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
//backgroundColor: MihColors.primary(),
|
||||
child: LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
return Stack(
|
||||
@@ -124,9 +120,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
children: [
|
||||
DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
child: SizedBox(
|
||||
// height: 300,
|
||||
@@ -143,11 +137,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
"Setup Business",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -157,11 +147,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
"${mzansiProfileProvider.user!.fname} ${mzansiProfileProvider.user!.lname}",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -172,11 +158,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -187,11 +169,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -201,11 +179,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -219,7 +193,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
// Icon(
|
||||
// Icons.home_outlined,
|
||||
// color:
|
||||
// MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// MihColors.secondary(),
|
||||
// ),
|
||||
// const SizedBox(width: 25.0),
|
||||
// Text(
|
||||
@@ -249,22 +223,14 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.policy,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Privacy Policy",
|
||||
style: TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -288,22 +254,14 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.design_services_rounded,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Terms of Service",
|
||||
style: TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -327,22 +285,14 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.logout,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Sign Out",
|
||||
style: TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -395,9 +345,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
},
|
||||
child: Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
// IconButton(
|
||||
@@ -417,7 +365,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
|
||||
// },
|
||||
// icon: Icon(
|
||||
// Icons.light_mode,
|
||||
// color: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.primary(),
|
||||
// size: 35,
|
||||
// ),
|
||||
// ),
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/user_consent.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.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/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_scack_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_app_drawer.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/package_tools/mih_business_home.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/package_tools/mih_personal_home.dart';
|
||||
@@ -143,18 +135,14 @@ class _MihHomeState extends State<MihHome> {
|
||||
Icon(
|
||||
Icons.policy,
|
||||
size: 150,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Welcome to the MIH App",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -164,9 +152,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
"To keep using the MIH app, please take a moment to review and accept our Policies. Our agreements helps us keep things running smoothly and securely.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
@@ -189,17 +175,13 @@ class _MihHomeState extends State<MihHome> {
|
||||
context.goNamed("aboutMih",
|
||||
extra: mzansiProfileProvider.personalHome);
|
||||
},
|
||||
buttonColor: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.orange(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Privacy Policy",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -214,17 +196,13 @@ class _MihHomeState extends State<MihHome> {
|
||||
context.goNamed("aboutMih",
|
||||
extra: mzansiProfileProvider.personalHome);
|
||||
},
|
||||
buttonColor: MihColors.getYellowColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.yellow(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Terms of Service",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -236,17 +214,13 @@ class _MihHomeState extends State<MihHome> {
|
||||
KenLogger.success("Date Time Now: $now");
|
||||
createOrUpdateAccpetance(mzansiProfileProvider);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Accept",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -308,13 +282,13 @@ class _MihHomeState extends State<MihHome> {
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(mzansiProfileProvider,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(mzansiProfileProvider,
|
||||
mzansiProfileProvider.user!.type != "personal"),
|
||||
appBody: getToolBody(mzansiProfileProvider),
|
||||
appToolTitles: getToolTitle(),
|
||||
packageToolBodies: getToolBody(mzansiProfileProvider),
|
||||
packageToolTitles: getToolTitle(),
|
||||
actionDrawer: getActionDrawer(),
|
||||
selectedbodyIndex:
|
||||
selectedBodyIndex:
|
||||
mzansiProfileProvider.personalHome ? 0 : 1,
|
||||
onIndexChange: (newValue) {
|
||||
mzansiProfileProvider.setPersonalHome(newValue == 0);
|
||||
@@ -347,6 +321,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
'business_${mzansiProfileProvider.businessProfilePicUrl}';
|
||||
}
|
||||
return MihPackageAction(
|
||||
iconColor: MihColors.secondary(),
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.only(left: 5.0),
|
||||
child: MihCircleAvatar(
|
||||
@@ -358,10 +333,8 @@ class _MihHomeState extends State<MihHome> {
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
// frameColor: frameColor,
|
||||
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: (_) {},
|
||||
),
|
||||
),
|
||||
@@ -395,7 +368,7 @@ class _MihHomeState extends State<MihHome> {
|
||||
}
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: mzansiProfileProvider.personalHome ? 0 : 1,
|
||||
selectedIndex: mzansiProfileProvider.personalHome ? 0 : 1,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +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_button.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_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class MihHomeError extends StatefulWidget {
|
||||
final String errorMessage;
|
||||
@@ -20,21 +14,21 @@ class MihHomeError extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihHomeErrorState extends State<MihHomeError> {
|
||||
int _selcetedIndex = 0;
|
||||
int _selectedIndex = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getErrorAction(),
|
||||
appTools: getErrorTools(),
|
||||
appToolTitles: ["Connection Error"],
|
||||
appBody: getErrorToolBody(widget.errorMessage),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
packageActionButton: getErrorAction(),
|
||||
packageTools: getErrorTools(),
|
||||
packageToolTitles: ["Connection Error"],
|
||||
packageToolBodies: getErrorToolBody(widget.errorMessage),
|
||||
selectedBodyIndex: _selectedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
_selectedIndex = newValue;
|
||||
});
|
||||
//print("Index: $_selcetedIndex");
|
||||
//print("Index: $_selectedIndex");
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -42,6 +36,7 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
MihPackageAction getErrorAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.refresh),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -56,18 +51,19 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.power_off_outlined)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
selectedIndex: _selectedIndex,
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> getErrorToolBody(String error) {
|
||||
List<Widget> toolBodies = [
|
||||
MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: true,
|
||||
bodyItem: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -76,8 +72,7 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
"Connection Error",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 35,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -85,8 +80,7 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
Icon(
|
||||
Icons.power_off_outlined,
|
||||
size: 150,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
@@ -94,8 +88,7 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
"Looks like we ran into an issue getting your data.\nPlease check you internet connection and try again.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -109,14 +102,12 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
extra: true,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Refresh",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -132,9 +123,7 @@ class _MihHomeErrorState extends State<MihHomeError> {
|
||||
"Error: $error",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,13 +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_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.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_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class MihRouteError extends StatefulWidget {
|
||||
const MihRouteError({
|
||||
@@ -19,21 +12,21 @@ class MihRouteError extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihRouteErrorState extends State<MihRouteError> {
|
||||
int _selcetedIndex = 0;
|
||||
int _selectedIndex = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
appActionButton: getErrorAction(),
|
||||
appTools: getErrorTools(),
|
||||
appToolTitles: ["Invalid Path"],
|
||||
appBody: getErrorToolBody(),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
packageActionButton: getErrorAction(),
|
||||
packageTools: getErrorTools(),
|
||||
packageToolTitles: ["Invalid Path"],
|
||||
packageToolBodies: getErrorToolBody(),
|
||||
selectedBodyIndex: _selectedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
_selectedIndex = newValue;
|
||||
});
|
||||
//print("Index: $_selcetedIndex");
|
||||
//print("Index: $_selectedIndex");
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -41,6 +34,7 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
MihPackageAction getErrorAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(MihIcons.mihLogo),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
@@ -55,18 +49,19 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.link_off_rounded)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
selectedIndex: _selectedIndex,
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> getErrorToolBody() {
|
||||
List<Widget> toolBodies = [
|
||||
MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: true,
|
||||
bodyItem: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -75,8 +70,7 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
"Oops! Wrong Turn.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 35,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -84,8 +78,7 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
Icon(
|
||||
Icons.link_off_rounded,
|
||||
size: 150,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
SizedBox(
|
||||
width: 700,
|
||||
@@ -93,8 +86,7 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
"It looks like you've taken a wrong turn and ended up on a package that doesn't exist within the MIH App.\n\nDon't worry, getting back is easy. Just click the button below or the MIH Logo to return to the correct path.",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -108,14 +100,12 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
extra: true,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Back to MIH",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -131,7 +121,7 @@ class _MihRouteErrorState extends State<MihRouteError> {
|
||||
// "Error: $error",
|
||||
// textAlign: TextAlign.left,
|
||||
// style: TextStyle(
|
||||
// color: MihColors.getRedColor(
|
||||
// color: MihColors.red(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
// "Dark"),
|
||||
// fontSize: 15,
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_search_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tile/about_mih_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tiles/mih_calculator_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calendar/package_tiles/mzansi_calendar_tile.dart';
|
||||
@@ -191,6 +188,7 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
final double width = size.width;
|
||||
final double height = size.height;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width, height),
|
||||
);
|
||||
@@ -213,10 +211,8 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
hintText: "Ask Mzansi",
|
||||
prefixIcon: Icons.search,
|
||||
prefixAltIcon: MihIcons.mzansiAi,
|
||||
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: () {
|
||||
mzansiAiProvider.ollamaProvider.resetChat();
|
||||
if (searchController.text.isNotEmpty) {
|
||||
@@ -262,9 +258,7 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
Icon(
|
||||
MihIcons.mzansiAi,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -274,9 +268,7 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tiles/test_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_search_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tile/about_mih_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tile/mih_access_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tiles/mih_calculator_tile.dart';
|
||||
@@ -213,6 +210,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
final double height = size.height;
|
||||
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width, height),
|
||||
);
|
||||
@@ -233,10 +231,8 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
hintText: "Ask Mzansi",
|
||||
prefixIcon: Icons.search,
|
||||
prefixAltIcon: MihIcons.mzansiAi,
|
||||
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: () {
|
||||
mzansiAiProvider.ollamaProvider.resetChat();
|
||||
if (searchController.text.isNotEmpty) {
|
||||
@@ -282,9 +278,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
Icon(
|
||||
MihIcons.mzansiAi,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -294,9 +288,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildMinesweeperLeaderboardList extends StatefulWidget {
|
||||
@@ -21,17 +19,13 @@ class _BuildMinesweeperLeaderboardListState
|
||||
Color getMedalColor(int index) {
|
||||
switch (index) {
|
||||
case (0):
|
||||
return MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.gold();
|
||||
case (1):
|
||||
return MihColors.getSilverColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.silver();
|
||||
case (2):
|
||||
return MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.bronze();
|
||||
default:
|
||||
return MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.secondary();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +38,7 @@ class _BuildMinesweeperLeaderboardListState
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: mineSweeperProvider.leaderboard!.length,
|
||||
@@ -84,21 +77,13 @@ class _BuildMinesweeperLeaderboardListState
|
||||
? Icon(
|
||||
MihIcons.mihRing,
|
||||
size: 80,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: imageFile == null
|
||||
? Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: 80,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
)
|
||||
: MihCircleAvatar(
|
||||
key: UniqueKey(),
|
||||
@@ -109,11 +94,7 @@ class _BuildMinesweeperLeaderboardListState
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
frameColor: getMedalColor(index),
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
backgroundColor: MihColors.primary(),
|
||||
onChange: () {},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildMyScoreBoardList extends StatefulWidget {
|
||||
@@ -18,17 +17,13 @@ class _BuildMinesweeperLeaderboardListState
|
||||
Color getMedalColor(int index) {
|
||||
switch (index) {
|
||||
case (0):
|
||||
return MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.gold();
|
||||
case (1):
|
||||
return MihColors.getSilverColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.silver();
|
||||
case (2):
|
||||
return MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.bronze();
|
||||
default:
|
||||
return MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
||||
return MihColors.secondary();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +36,7 @@ class _BuildMinesweeperLeaderboardListState
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemCount: mineSweeperProvider.myScoreboard!.length,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
|
||||
class LeaderboardUserRanking extends StatelessWidget {
|
||||
@@ -54,10 +53,8 @@ class LeaderboardUserRanking extends StatelessWidget {
|
||||
editable: false,
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
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: () {},
|
||||
),
|
||||
],
|
||||
@@ -67,16 +64,14 @@ class LeaderboardUserRanking extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
).redacted(context: context, redact: isLoading),
|
||||
subtitle: Text(
|
||||
"Score: $gameScore\nTime: $gameTime",
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
).redacted(context: context, redact: isLoading),
|
||||
);
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
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_button.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_package_window.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MihMineSweeperStartGameWindow extends StatefulWidget {
|
||||
@@ -132,9 +127,7 @@ class _MihMineSweeperStartGameWindowState
|
||||
Text(
|
||||
getModeConfig(),
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -147,16 +140,12 @@ class _MihMineSweeperStartGameWindowState
|
||||
context.pop();
|
||||
widget.onPressed?.call();
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor: MihColors.green(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Start Game",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/board_square.dart';
|
||||
|
||||
class MineTile extends StatelessWidget {
|
||||
@@ -21,9 +19,7 @@ class MineTile extends StatelessWidget {
|
||||
if (square.isFlagged) {
|
||||
return Icon(
|
||||
Icons.flag,
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
),
|
||||
color: MihColors.red(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,33 +52,23 @@ class MineTile extends StatelessWidget {
|
||||
// Choose colors based on standard Minesweeper appearance
|
||||
switch (bombsAround) {
|
||||
case 1:
|
||||
return MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.bluishPurple();
|
||||
// return Colors.blue;
|
||||
case 2:
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.green();
|
||||
// return Colors.green;
|
||||
case 3:
|
||||
return MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.red();
|
||||
// return Colors.red;
|
||||
case 4:
|
||||
return MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.purple();
|
||||
// return Colors.purple;
|
||||
case 5:
|
||||
return MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.orange();
|
||||
// return Colors.brown;
|
||||
default:
|
||||
// return MihColors.getBluishPurpleColor(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
// return MihColors.bluishPurple(
|
||||
// ,
|
||||
// );
|
||||
return Colors.black;
|
||||
}
|
||||
@@ -95,13 +81,7 @@ class MineTile extends StatelessWidget {
|
||||
child: MihButton(
|
||||
onPressed: onTap,
|
||||
onLongPressed: onLongPress,
|
||||
buttonColor: square.isOpened
|
||||
? MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
)
|
||||
: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
buttonColor: square.isOpened ? MihColors.grey() : MihColors.secondary(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
borderRadius: 3,
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:go_router/go_router.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/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_banner_ad_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
@@ -70,11 +67,11 @@ class _MihMineSweeperState extends State<MihMineSweeper> {
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appToolTitles: getToolTitle(),
|
||||
appBody: getToolBody(),
|
||||
selectedbodyIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
packageToolBodies: getToolBody(),
|
||||
selectedBodyIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
context.read<MihMineSweeperProvider>().setToolIndex(newIndex);
|
||||
},
|
||||
@@ -86,6 +83,7 @@ class _MihMineSweeperState extends State<MihMineSweeper> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
MihMineSweeperProvider mineSweeperProvider =
|
||||
@@ -116,7 +114,7 @@ class _MihMineSweeperState extends State<MihMineSweeper> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MihMineSweeperProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +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_icons.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 MihMineSweeperTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -25,16 +22,14 @@ class _MihMineSweeperTileState extends State<MihMineSweeperTile> {
|
||||
"mihMinesweeper",
|
||||
);
|
||||
},
|
||||
appName: "Minesweeper",
|
||||
appIcon: Icon(
|
||||
packageName: "Minesweeper",
|
||||
packageIcon: Icon(
|
||||
MihIcons.mineSweeper,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/builders/build_minesweeper_leaderboard_list.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_minesweeper_services.dart';
|
||||
@@ -74,6 +69,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
refreshLeaderBoard(mineSweeperProvider, filterController.text);
|
||||
},
|
||||
child: MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
),
|
||||
@@ -136,9 +132,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
Icon(
|
||||
MihIcons.mineSweeper,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -148,9 +142,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -161,11 +153,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -174,11 +162,7 @@ class _MihMineSweeperLeaderBoardState extends State<MihMineSweeperLeaderBoard> {
|
||||
child: Icon(
|
||||
FontAwesomeIcons.bomb,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(text: " and start a new game"),
|
||||
|
||||
@@ -6,18 +6,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.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_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_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/board_square.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/mih_mine_sweeper_start_game_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/components/mine_tile.dart';
|
||||
@@ -317,21 +309,13 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
String mode = mihMineSweeperProvider.difficulty;
|
||||
switch (mode) {
|
||||
case "Very Easy":
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
);
|
||||
return MihColors.green();
|
||||
case "Easy":
|
||||
return MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark",
|
||||
);
|
||||
return MihColors.green();
|
||||
case "Intermediate":
|
||||
return MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
);
|
||||
return MihColors.orange();
|
||||
case "Hard":
|
||||
return MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
);
|
||||
return MihColors.red();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -346,15 +330,13 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
fullscreen: false,
|
||||
windowTitle: null,
|
||||
onWindowTapClose: null,
|
||||
backgroundColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
backgroundColor: MihColors.red(),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Icon(
|
||||
FontAwesomeIcons.bomb,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
size: 125,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -362,8 +344,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Better Luck Next Time",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -374,8 +355,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Your lost this game of MIH Minesweeper!!!",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -387,8 +367,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -404,15 +383,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
showStartGameWindow(mihMineSweeperProvider);
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"New Game",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -422,15 +398,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"View Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -441,15 +414,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
mihMineSweeperProvider.setToolIndex(1);
|
||||
},
|
||||
buttonColor: MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.gold(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Leader Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -473,15 +443,13 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
fullscreen: false,
|
||||
windowTitle: null,
|
||||
onWindowTapClose: null,
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.green(),
|
||||
windowBody: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Icon(
|
||||
Icons.celebration,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
size: 150,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -489,8 +457,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Congratulations",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -501,8 +468,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -510,8 +476,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Time Taken: ${_formatTime().replaceAll("00:", "")}",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -519,8 +484,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
"Score: ${calculateGameScore(mihMineSweeperProvider)}",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -536,15 +500,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
showStartGameWindow(mihMineSweeperProvider);
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.primary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"New Game",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -554,15 +515,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"View Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -574,15 +532,12 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
context.pop();
|
||||
mihMineSweeperProvider.setToolIndex(1);
|
||||
},
|
||||
buttonColor: MihColors.getGoldColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
buttonColor: MihColors.gold(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Leader Board",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -612,6 +567,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
@@ -642,11 +598,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
Icon(
|
||||
MihIcons.mineSweeper,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -656,11 +608,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -671,11 +619,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -685,11 +629,7 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
child: Icon(
|
||||
Icons.menu,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
@@ -803,23 +743,15 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.rule_rounded,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Learn how to play",
|
||||
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: () {
|
||||
mihMineSweeperProvider.setToolIndex(3);
|
||||
},
|
||||
@@ -827,23 +759,15 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "Start New Game",
|
||||
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: () {
|
||||
showStartGameWindow(mihMineSweeperProvider);
|
||||
},
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.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_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class MineSweeperQuickStartGuide extends StatefulWidget {
|
||||
const MineSweeperQuickStartGuide({super.key});
|
||||
@@ -21,8 +18,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionOne() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -36,8 +32,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -48,9 +43,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'Quick Tap (or Click): This is the Dig action.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -69,9 +62,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -79,9 +70,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' To uncover a square and see a number clue.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -102,9 +91,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Risk:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -112,9 +99,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' If you click a mine, the game ends!',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -133,9 +118,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'Tap and Hold (or Long Press): This is the Flag action (🚩).',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -154,9 +137,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -164,9 +145,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' To safely mark a square that you are',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -174,9 +153,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' certain',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -184,9 +161,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' is a mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -207,9 +182,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Risk:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -218,9 +191,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Accidental placement of flags will cause confusion.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -241,9 +212,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Benefit:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -252,9 +221,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' You cannot accidentally click a square that is flagged.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -273,8 +240,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionTwo() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -288,8 +254,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -301,9 +266,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'The number tells you exactly how many mines are touching that square (including sides and corners).',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -322,9 +285,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• If you see a Blank Space (a '0'):",
|
||||
style: TextStyle(
|
||||
color: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.orange(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -332,9 +293,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: " Zero (0) ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -343,9 +302,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' mines are touching it. All surrounding squares are safe, and the game will open them for you automatically.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -366,9 +323,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• If you see a '1':",
|
||||
style: TextStyle(
|
||||
color: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.orange(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -376,9 +331,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' Only ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -386,9 +339,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'one',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -397,9 +348,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' mine is touching this square. You must find and flag that single mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -420,9 +369,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• If you see a '3':",
|
||||
style: TextStyle(
|
||||
color: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.orange(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -430,9 +377,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: " Three ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -441,9 +386,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'mines are touching this square. You must find and flag all three.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -462,8 +405,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionThree() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -477,8 +419,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -490,9 +431,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'The game is won by uncovering every single safe square and correctly flagging all the mines. Use this two-step loop to clear the board:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -507,9 +446,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'A. Find the Mines (Where to Flag 🚩)',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.purple(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -528,9 +465,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -539,9 +474,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Look for a number that only has one choice for a mine. e.g. If a \'1\' is touching only one hidden square, that hidden square',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -549,9 +482,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' must ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -559,9 +490,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'be the mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -582,9 +511,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Action:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -592,9 +519,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' Tap and Hold to place a',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -602,9 +527,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' Flag ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -612,9 +535,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'on the square you are sure is a mine.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -632,9 +553,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: 'B. Find the Safe Squares (Where to Dig)',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.purple(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: subtitleSize,
|
||||
),
|
||||
@@ -653,9 +572,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Goal:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.green(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -664,9 +581,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Look for a number that has been \'satisfied\' by your flags. e.g. You see a \'2\' and you have already placed two 🚩 flags touching it. The \'2\' is satisfied.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -687,9 +602,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: '• Action:',
|
||||
style: TextStyle(
|
||||
color: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode !=
|
||||
"Dark"),
|
||||
color: MihColors.red(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -698,9 +611,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
' Quick Tap any of the remaining hidden squares touching that \'satisfied\' number. They',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -708,9 +619,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: ' must be safe ',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -719,9 +628,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'because the mine requirement has already been met.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -740,8 +647,7 @@ class _MineSweeperQuickStartGuideState
|
||||
Widget sectionFour() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Darl"),
|
||||
color: MihColors.secondary(),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Padding(
|
||||
@@ -755,8 +661,7 @@ class _MineSweeperQuickStartGuideState
|
||||
style: TextStyle(
|
||||
fontSize: titleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -770,9 +675,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• Start on the Edges and Corners: ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.bronze(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -781,9 +684,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'Numbers on the edge or corner of the board are easier to solve because they have fewer surrounding squares to check.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -804,9 +705,7 @@ class _MineSweeperQuickStartGuideState
|
||||
TextSpan(
|
||||
text: "• Don't Guess: ",
|
||||
style: TextStyle(
|
||||
color: MihColors.getBronze(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.bronze(),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -815,9 +714,7 @@ class _MineSweeperQuickStartGuideState
|
||||
text:
|
||||
'If you are down to two squares and either one could be the mine, look somewhere else on the board for a guaranteed, safe move.',
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: pointsSize,
|
||||
),
|
||||
@@ -838,6 +735,7 @@ class _MineSweeperQuickStartGuideState
|
||||
final Size size = MediaQuery.sizeOf(context);
|
||||
final double width = size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
);
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/builders/build_my_scoreboard_list.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_minesweeper_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
@@ -64,6 +59,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
refreshLeaderBoard(mineSweeperProvider, filterController.text);
|
||||
},
|
||||
child: MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
),
|
||||
@@ -91,10 +87,8 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
editable: false,
|
||||
fileNameController: null,
|
||||
userSelectedfile: null,
|
||||
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) {},
|
||||
key: ValueKey(profileProvider.userProfilePicUrl),
|
||||
),
|
||||
@@ -142,9 +136,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
Icon(
|
||||
MihIcons.mineSweeper,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -154,9 +146,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -167,11 +157,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -180,11 +166,7 @@ class _MihMineSweeperLeaderBoardState extends State<MyScoreBoard> {
|
||||
child: Icon(
|
||||
FontAwesomeIcons.bomb,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(text: " and start a new game"),
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import 'package:go_router/go_router.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/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
@@ -58,11 +55,11 @@ class _MzansiAiState extends State<MzansiAi> {
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: context.watch<MzansiAiProvider>().toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: context.watch<MzansiAiProvider>().toolIndex,
|
||||
onIndexChange: (newValue) {
|
||||
context.read<MzansiAiProvider>().setToolIndex(newValue);
|
||||
},
|
||||
@@ -74,6 +71,7 @@ class _MzansiAiState extends State<MzansiAi> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.read<MzansiAiProvider>().setStartUpQuestion(null);
|
||||
@@ -92,7 +90,7 @@ class _MzansiAiState extends State<MzansiAi> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MzansiAiProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MzansiAiProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
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_package_components/mih_icons.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MzansiAiTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -33,16 +30,14 @@ class _MzansiAiTileState extends State<MzansiAiTile> {
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
appName: "Mzansi AI",
|
||||
appIcon: Icon(
|
||||
packageName: "Mzansi AI",
|
||||
packageIcon: Icon(
|
||||
MihIcons.mzansiAi,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,8 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:flutter_tts/flutter_tts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.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:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -40,8 +36,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
Icon(
|
||||
MihIcons.mzansiAi,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -51,8 +46,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -63,8 +57,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(
|
||||
@@ -81,8 +74,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Press "),
|
||||
@@ -91,9 +83,7 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
child: Icon(
|
||||
Icons.menu,
|
||||
size: 20,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
TextSpan(text: " to start a new chat or read last message"),
|
||||
@@ -338,13 +328,13 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
// onPressed: () {
|
||||
// saveHistory(profileProvider, aiProvider);
|
||||
// },
|
||||
// buttonColor: MihColors.getGreenColor(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// buttonColor: MihColors.green(
|
||||
// ),
|
||||
// child: Text(
|
||||
// "View History as json",
|
||||
// style: TextStyle(
|
||||
// color: MihColors.getPrimaryColor(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// color: MihColors.primary(
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
@@ -363,16 +353,11 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
stopTTS(aiProvider);
|
||||
}
|
||||
},
|
||||
buttonColor: !aiProvider.ttsOn
|
||||
? MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
||||
: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
buttonColor:
|
||||
!aiProvider.ttsOn ? MihColors.green() : MihColors.red(),
|
||||
child: Icon(
|
||||
!aiProvider.ttsOn ? Icons.volume_up : Icons.volume_off,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -385,21 +370,15 @@ class _MihAiChatState extends State<MihAiChat> with WidgetsBindingObserver {
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.refresh,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
label: "New Chat",
|
||||
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: () {
|
||||
resetChat(aiProvider);
|
||||
},
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_business_profile_preview.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildBusinessSearchResultsList extends StatefulWidget {
|
||||
@@ -33,14 +32,12 @@ class _BuildBusinessSearchResultsListState
|
||||
itemCount: widget.businessList.length,
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return Material(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
directoryProvider.setSelectedBusiness(
|
||||
@@ -50,9 +47,7 @@ class _BuildBusinessSearchResultsListState
|
||||
'businessProfileView',
|
||||
);
|
||||
},
|
||||
splashColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
||||
.withOpacity(0.2),
|
||||
splashColor: MihColors.secondary().withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsGeometry.symmetric(
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_business_profile_preview.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildFavouriteBusinessesList extends StatefulWidget {
|
||||
@@ -44,8 +43,7 @@ class _BuildFavouriteBusinessesListState
|
||||
return const SizedBox(); // Or a placeholder if a business couldn't be loaded
|
||||
}
|
||||
return Material(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
directoryProvider.setSelectedBusiness(
|
||||
@@ -55,9 +53,7 @@ class _BuildFavouriteBusinessesListState
|
||||
'businessProfileView',
|
||||
);
|
||||
},
|
||||
splashColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
||||
.withOpacity(0.2),
|
||||
splashColor: MihColors.secondary().withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_personal_profile_preview.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildUserSearchResultsList extends StatefulWidget {
|
||||
@@ -33,14 +32,12 @@ class _BuildUserSearchResultsListState
|
||||
itemCount: widget.userList.length,
|
||||
separatorBuilder: (BuildContext context, index) {
|
||||
return Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return Material(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.primary(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
directoryProvider.setSelectedUser(
|
||||
@@ -49,9 +46,7 @@ class _BuildUserSearchResultsListState
|
||||
'mzansiProfileView',
|
||||
);
|
||||
},
|
||||
splashColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
||||
.withOpacity(0.2),
|
||||
splashColor: MihColors.secondary().withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsGeometry.symmetric(
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:go_router/go_router.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/mih_loading_circle.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_directory/package_tools/mih_favourite_businesses.dart';
|
||||
@@ -74,11 +71,11 @@ class _MzansiDirectoryState extends State<MzansiDirectory> {
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: directoryProvider.toolIndex,
|
||||
packageActionButton: getAction(),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
selectedBodyIndex: directoryProvider.toolIndex,
|
||||
onIndexChange: (newValue) {
|
||||
directoryProvider.setToolIndex(newValue);
|
||||
},
|
||||
@@ -97,6 +94,7 @@ class _MzansiDirectoryState extends State<MzansiDirectory> {
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
@@ -121,7 +119,7 @@ class _MzansiDirectoryState extends State<MzansiDirectory> {
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: context.watch<MzansiDirectoryProvider>().toolIndex,
|
||||
selectedIndex: context.watch<MzansiDirectoryProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +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_icons.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 MzansiDirectoryTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
@@ -32,16 +29,14 @@ class _MzansiDirectoryTileState extends State<MzansiDirectoryTile> {
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
appName: "Mzansi Directory",
|
||||
appIcon: Icon(
|
||||
packageName: "Mzansi Directory",
|
||||
packageIcon: Icon(
|
||||
MihIcons.mzansiDirectory,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
color: MihColors.secondary(),
|
||||
// size: widget.packageSize,
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
textColor: MihColors.secondary(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_search_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class MihContacts extends StatefulWidget {
|
||||
const MihContacts({super.key});
|
||||
@@ -21,6 +17,7 @@ class _MihContactsState extends State<MihContacts> {
|
||||
final Size size = MediaQuery.sizeOf(context);
|
||||
final double width = size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
);
|
||||
@@ -37,10 +34,8 @@ class _MihContactsState extends State<MihContacts> {
|
||||
controller: contactSearchController,
|
||||
hintText: "Search Contacts",
|
||||
prefixIcon: Icons.search,
|
||||
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: () {},
|
||||
searchFocusNode: searchFocusNode,
|
||||
),
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_search_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_directory/builders/build_favourite_businesses_list.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
||||
@@ -107,6 +102,7 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
final Size size = MediaQuery.sizeOf(context);
|
||||
final double width = size.width;
|
||||
return MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
borderOn: false,
|
||||
bodyItem: getBody(width),
|
||||
);
|
||||
@@ -130,10 +126,8 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
controller: businessSearchController,
|
||||
hintText: "Search Businesses",
|
||||
prefixIcon: Icons.search,
|
||||
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: () {},
|
||||
searchFocusNode: searchFocusNode,
|
||||
),
|
||||
@@ -151,9 +145,7 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -163,9 +155,7 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -182,9 +172,7 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
Icon(
|
||||
MihIcons.businessProfile,
|
||||
size: 165,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
@@ -194,11 +182,7 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
@@ -209,11 +193,7 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!
|
||||
.theme
|
||||
.mode ==
|
||||
"Dark"),
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: "Use the mzansi search"),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user