Compare commits
18 Commits
dca595bf60
...
v.1.2.7
| Author | SHA1 | Date | |
|---|---|---|---|
| 26d3638d80 | |||
| 6c591172df | |||
| 0a5c4a3d20 | |||
| c0077e532c | |||
| 379633d7f5 | |||
| c855503edd | |||
| 0f6c6e51ab | |||
| e5ce03e396 | |||
| c67529dbac | |||
| 84cb6b2e83 | |||
| 6e07a55885 | |||
| 8fb31695a8 | |||
| 4fafa35888 | |||
| 0cf9634c5d | |||
| 787a8057b2 | |||
| 5f911d51f9 | |||
| 8da29792b4 | |||
| 5e003a4d71 |
@@ -19,7 +19,7 @@ if (keystorePropertiesFile.exists()) {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "za.co.mzansiinnovationhub.mih"
|
namespace = "za.co.mzansiinnovationhub.mih"
|
||||||
compileSdk = 35
|
compileSdk = 36
|
||||||
ndkVersion = "27.0.12077973"
|
ndkVersion = "27.0.12077973"
|
||||||
// ndkVersion = flutter.ndkVersion
|
// ndkVersion = flutter.ndkVersion
|
||||||
|
|
||||||
|
|||||||
@@ -489,7 +489,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_packageIcon_NAME = packageIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
@@ -672,7 +672,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_packageIcon_NAME = packageIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
@@ -699,7 +699,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_packageIcon_NAME = packageIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
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: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;
|
import "package:universal_html/html.dart" as html;
|
||||||
|
|
||||||
class MihTheme {
|
class MihTheme {
|
||||||
@@ -17,66 +17,63 @@ class MihTheme {
|
|||||||
ThemeData getData(bool bool) {
|
ThemeData getData(bool bool) {
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
fontFamily: 'Segoe UI',
|
fontFamily: 'Segoe UI',
|
||||||
scaffoldBackgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
scaffoldBackgroundColor: MihColors.primary(),
|
||||||
colorScheme: ColorScheme(
|
colorScheme: ColorScheme(
|
||||||
brightness: getBritness(),
|
brightness: getBritness(),
|
||||||
primary: MihColors.getSecondaryColor(mode == "Dark"),
|
primary: MihColors.secondary(),
|
||||||
onPrimary: MihColors.getPrimaryColor(mode == "Dark"),
|
onPrimary: MihColors.primary(),
|
||||||
secondary: MihColors.getPrimaryColor(mode == "Dark"),
|
secondary: MihColors.primary(),
|
||||||
onSecondary: MihColors.getSecondaryColor(mode == "Dark"),
|
onSecondary: MihColors.secondary(),
|
||||||
error: MihColors.getRedColor(mode == "Dark"),
|
error: MihColors.red(),
|
||||||
onError: MihColors.getPrimaryColor(mode == "Dark"),
|
onError: MihColors.primary(),
|
||||||
surface: MihColors.getPrimaryColor(mode == "Dark"),
|
surface: MihColors.primary(),
|
||||||
onSurface: MihColors.getSecondaryColor(mode == "Dark"),
|
onSurface: MihColors.secondary(),
|
||||||
),
|
),
|
||||||
datePickerTheme: DatePickerThemeData(
|
datePickerTheme: DatePickerThemeData(
|
||||||
backgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
backgroundColor: MihColors.primary(),
|
||||||
headerBackgroundColor: MihColors.getSecondaryColor(mode == "Dark"),
|
headerBackgroundColor: MihColors.secondary(),
|
||||||
headerForegroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
headerForegroundColor: MihColors.primary(),
|
||||||
),
|
),
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
color: MihColors.getSecondaryColor(mode == "Dark"),
|
color: MihColors.secondary(),
|
||||||
foregroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
foregroundColor: MihColors.primary(),
|
||||||
titleTextStyle: TextStyle(
|
titleTextStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
color: MihColors.primary(),
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||||
backgroundColor: MihColors.getSecondaryColor(mode == "Dark"),
|
backgroundColor: MihColors.secondary(),
|
||||||
foregroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
foregroundColor: MihColors.primary(),
|
||||||
extendedTextStyle:
|
extendedTextStyle: TextStyle(color: MihColors.primary()),
|
||||||
TextStyle(color: MihColors.getPrimaryColor(mode == "Dark")),
|
|
||||||
),
|
),
|
||||||
drawerTheme: DrawerThemeData(
|
drawerTheme: DrawerThemeData(
|
||||||
backgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
backgroundColor: MihColors.primary(),
|
||||||
),
|
),
|
||||||
textSelectionTheme: TextSelectionThemeData(
|
textSelectionTheme: TextSelectionThemeData(
|
||||||
cursorColor: MihColors.getPrimaryColor(mode == "Dark"),
|
cursorColor: MihColors.primary(),
|
||||||
selectionColor:
|
selectionColor: MihColors.primary().withOpacity(0.25),
|
||||||
MihColors.getPrimaryColor(mode == "Dark").withOpacity(0.25),
|
selectionHandleColor: MihColors.primary(),
|
||||||
selectionHandleColor: MihColors.getPrimaryColor(mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
tooltipTheme: TooltipThemeData(
|
tooltipTheme: TooltipThemeData(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MihColors.getSecondaryColor(mode == "Dark"),
|
color: MihColors.secondary(),
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
color: MihColors.primary(),
|
||||||
),
|
),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color:
|
color: MihColors.primary().withOpacity(0.18),
|
||||||
MihColors.getPrimaryColor(mode == "Dark").withOpacity(0.18),
|
|
||||||
blurRadius: 6,
|
blurRadius: 6,
|
||||||
offset: const Offset(0, 2),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
textStyle: TextStyle(
|
textStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
color: MihColors.primary(),
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
height: 1.2,
|
height: 1.2,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import 'package:go_router/go_router.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/Example/package_tools/package_tool_three.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/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_one.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_two.dart';
|
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_two.dart';
|
||||||
import 'package:flutter/material.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_providers/mzansi_profile_provider.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_data_helper_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_data_helper_services.dart';
|
||||||
@@ -23,7 +20,7 @@ class PackageTest extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PackageTestState extends State<PackageTest> {
|
class _PackageTestState extends State<PackageTest> {
|
||||||
int _selcetedIndex = 0;
|
int _selectedIndex = 0;
|
||||||
bool _isLoadingInitialData = true;
|
bool _isLoadingInitialData = true;
|
||||||
|
|
||||||
Future<void> _loadInitialData() async {
|
Future<void> _loadInitialData() async {
|
||||||
@@ -44,6 +41,7 @@ class _PackageTestState extends State<PackageTest> {
|
|||||||
|
|
||||||
MihPackageAction getAction() {
|
MihPackageAction getAction() {
|
||||||
return MihPackageAction(
|
return MihPackageAction(
|
||||||
|
iconColor: MihColors.secondary(),
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
iconSize: 35,
|
iconSize: 35,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -65,27 +63,27 @@ class _PackageTestState extends State<PackageTest> {
|
|||||||
Map<Widget, void Function()?> temp = Map();
|
Map<Widget, void Function()?> temp = Map();
|
||||||
temp[const Icon(Icons.link)] = () {
|
temp[const Icon(Icons.link)] = () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = 0;
|
_selectedIndex = 0;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
temp[const Icon(Icons.warning)] = () {
|
temp[const Icon(Icons.warning)] = () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = 1;
|
_selectedIndex = 1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
temp[const Icon(Icons.inbox)] = () {
|
temp[const Icon(Icons.inbox)] = () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = 2;
|
_selectedIndex = 2;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
temp[const Icon(Icons.outbond)] = () {
|
temp[const Icon(Icons.outbond)] = () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = 3;
|
_selectedIndex = 3;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return MihPackageTools(
|
return MihPackageTools(
|
||||||
tools: temp,
|
tools: temp,
|
||||||
selcetedIndex: _selcetedIndex,
|
selectedIndex: _selectedIndex,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,16 +134,16 @@ class _PackageTestState extends State<PackageTest> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return MihPackage(
|
return MihPackage(
|
||||||
appActionButton: getAction(),
|
packageActionButton: getAction(),
|
||||||
appTools: getTools(),
|
packageTools: getTools(),
|
||||||
appBody: getToolBody(),
|
packageToolBodies: getToolBody(),
|
||||||
appToolTitles: getToolTitle(),
|
packageToolTitles: getToolTitle(),
|
||||||
selectedbodyIndex: _selcetedIndex,
|
selectedBodyIndex: _selectedIndex,
|
||||||
onIndexChange: (newValue) {
|
onIndexChange: (newValue) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = newValue;
|
_selectedIndex = newValue;
|
||||||
});
|
});
|
||||||
print("Index: $_selcetedIndex");
|
print("Index: $_selectedIndex");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.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_package_tile.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
|
||||||
|
|
||||||
class TestPackageTile extends StatefulWidget {
|
class TestPackageTile extends StatefulWidget {
|
||||||
final double packageSize;
|
final double packageSize;
|
||||||
@@ -31,15 +29,13 @@ class _TestPackageTileState extends State<TestPackageTile> {
|
|||||||
// ),
|
// ),
|
||||||
// );
|
// );
|
||||||
},
|
},
|
||||||
appName: "Test",
|
packageName: "Test",
|
||||||
appIcon: Icon(
|
packageIcon: Icon(
|
||||||
Icons.warning_amber_rounded,
|
Icons.warning_amber_rounded,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
iconSize: widget.packageSize,
|
iconSize: widget.packageSize,
|
||||||
textColor: MihColors.getSecondaryColor(
|
textColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,33 +7,17 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:ken_logger/ken_logger.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/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.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_objects/business.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.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_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_alert_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_location_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_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_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_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';
|
import 'package:redacted/redacted.dart';
|
||||||
|
|
||||||
class PackageToolOne extends StatefulWidget {
|
class PackageToolOne extends StatefulWidget {
|
||||||
@@ -97,28 +81,22 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
return MihPackageWindow(
|
return MihPackageWindow(
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
borderOn: true,
|
borderOn: true,
|
||||||
foregroundColor: MihColors.getOrangeColor(
|
foregroundColor: MihColors.orange(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
backgroundColor: MihColors.bluishPurple(),
|
||||||
backgroundColor: MihColors.getBluishPurpleColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
windowTitle: "Test No Full",
|
windowTitle: "Test No Full",
|
||||||
menuOptions: [
|
menuOptions: [
|
||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "Show New Window",
|
label: "Show New Window",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// showTestWindow();
|
// showTestWindow();
|
||||||
},
|
},
|
||||||
@@ -138,6 +116,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double screenWidth = MediaQuery.of(context).size.width;
|
double screenWidth = MediaQuery.of(context).size.width;
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(screenWidth),
|
bodyItem: getBody(screenWidth),
|
||||||
);
|
);
|
||||||
@@ -184,9 +163,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -197,16 +174,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
KenLogger.success("Successfully tested");
|
KenLogger.success("Successfully tested");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Success Logger",
|
"Success Logger",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -219,16 +193,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
KenLogger.error("Successfully tested");
|
KenLogger.error("Successfully tested");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Error Logger",
|
"Error Logger",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -241,16 +212,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
KenLogger.warning("Successfully tested");
|
KenLogger.warning("Successfully tested");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getOrangeColor(
|
buttonColor: MihColors.orange(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Warning Logger",
|
"Warning Logger",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -263,16 +231,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
KenLogger.info("Successfully tested");
|
KenLogger.info("Successfully tested");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getBluishPurpleColor(
|
buttonColor: MihColors.bluishPurple(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Info Logger",
|
"Info Logger",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -288,10 +253,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
initialSelection: '+27',
|
initialSelection: '+27',
|
||||||
showDropDownButton: false,
|
showDropDownButton: false,
|
||||||
pickerStyle: PickerStyle.bottomSheet,
|
pickerStyle: PickerStyle.bottomSheet,
|
||||||
dialogBackgroundColor: MihColors.getPrimaryColor(
|
dialogBackgroundColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
barrierColor: MihColors.primary(),
|
||||||
barrierColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Center(
|
Center(
|
||||||
@@ -306,16 +269,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Show Loading",
|
"Show Loading",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -332,9 +292,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -353,9 +311,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -433,8 +389,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Divider(
|
Divider(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
thickness: 2,
|
thickness: 2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -447,9 +402,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -458,8 +411,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
MihBannerAd(),
|
MihBannerAd(),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Divider(
|
Divider(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
thickness: 2,
|
thickness: 2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -468,12 +420,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
formFields: [
|
formFields: [
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
width: 200,
|
width: 200,
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
inputColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
controller: _textFieldZeroController,
|
controller: _textFieldZeroController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: false,
|
requiredText: false,
|
||||||
@@ -484,12 +432,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
inputColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
controller: _textFieldOneController,
|
controller: _textFieldOneController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
@@ -501,12 +445,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
inputColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
controller: _textFieldTwoController,
|
controller: _textFieldTwoController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
@@ -519,12 +459,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
inputColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
controller: _textFieldThreeController,
|
controller: _textFieldThreeController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
@@ -537,12 +473,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihNumericStepper(
|
MihNumericStepper(
|
||||||
controller: _textFieldFiveController,
|
controller: _textFieldFiveController,
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
inputColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
hintText: "Number Stepper",
|
hintText: "Number Stepper",
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
@@ -553,12 +485,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
MihToggle(
|
MihToggle(
|
||||||
hintText: "Toggle",
|
hintText: "Toggle",
|
||||||
initialPostion: switchpositioin,
|
initialPostion: switchpositioin,
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
secondaryFillColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
secondaryFillColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
onChange: (value) {
|
onChange: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -571,12 +499,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
MihRadioOptions(
|
MihRadioOptions(
|
||||||
controller: _textFieldSixController,
|
controller: _textFieldSixController,
|
||||||
hintText: "Radio Options",
|
hintText: "Radio Options",
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
secondaryFillColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
secondaryFillColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
radioOptions: const ["Option 1", "Option 2"],
|
radioOptions: const ["Option 1", "Option 2"],
|
||||||
),
|
),
|
||||||
@@ -617,12 +541,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
height: 250,
|
height: 250,
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
inputColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
controller: _textFieldFourController,
|
controller: _textFieldFourController,
|
||||||
multiLineInput: true,
|
multiLineInput: true,
|
||||||
requiredText: false,
|
requiredText: false,
|
||||||
@@ -646,17 +566,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
MihAlertServices().inputErrorAlert(context);
|
MihAlertServices().inputErrorAlert(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Submit Form",
|
"Submit Form",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -667,8 +583,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Divider(
|
Divider(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
thickness: 2,
|
thickness: 2,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -679,10 +594,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
prefixIcon: Icons.search,
|
prefixIcon: Icons.search,
|
||||||
prefixAltIcon: MihIcons.mzansiAi,
|
prefixAltIcon: MihIcons.mzansiAi,
|
||||||
width: 300,
|
width: 300,
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
hintColor: MihColors.primary(),
|
||||||
hintColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onPrefixIconTap: () {
|
onPrefixIconTap: () {
|
||||||
print("Search Icon Pressed: ${_searchController.text}");
|
print("Search Icon Pressed: ${_searchController.text}");
|
||||||
},
|
},
|
||||||
@@ -693,16 +606,13 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
print("Button Pressed");
|
print("Button Pressed");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Click Me",
|
"Click Me",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -713,24 +623,19 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
print("Button Pressed");
|
print("Button Pressed");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.delete,
|
Icons.delete,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"Click Me",
|
"Click Me",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -743,15 +648,12 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
print("Button Pressed");
|
print("Button Pressed");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Click Me",
|
"Click Me",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -768,9 +670,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -782,10 +682,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
editable: false,
|
editable: false,
|
||||||
fileNameController: _fileNameController,
|
fileNameController: _fileNameController,
|
||||||
userSelectedfile: file,
|
userSelectedfile: file,
|
||||||
frameColor: MihColors.getSecondaryColor(
|
frameColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
backgroundColor: MihColors.primary(),
|
||||||
backgroundColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onChange: (selectedImage) {
|
onChange: (selectedImage) {
|
||||||
setState(() {
|
setState(() {
|
||||||
file = selectedImage;
|
file = selectedImage;
|
||||||
@@ -794,10 +692,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
inputColor: MihColors.primary(),
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
controller: _fileNameController,
|
controller: _fileNameController,
|
||||||
hintText: "Selected Avatar File",
|
hintText: "Selected Avatar File",
|
||||||
requiredText: false,
|
requiredText: false,
|
||||||
@@ -819,10 +715,8 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
fillColor: MihColors.getSecondaryColor(
|
fillColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
inputColor: MihColors.primary(),
|
||||||
inputColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
controller: _imagefileController,
|
controller: _imagefileController,
|
||||||
hintText: "Selected Image File",
|
hintText: "Selected Image File",
|
||||||
requiredText: false,
|
requiredText: false,
|
||||||
@@ -842,19 +736,15 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "Show New Window",
|
label: "Show New Window",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showTestWindow();
|
showTestWindow();
|
||||||
},
|
},
|
||||||
@@ -862,19 +752,15 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
|||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "Show New Full Window",
|
label: "Show New Full Window",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showTestFullWindow();
|
showTestFullWindow();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
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_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_profile_links.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
|
||||||
|
|
||||||
class PackageToolThree extends StatefulWidget {
|
class PackageToolThree extends StatefulWidget {
|
||||||
const PackageToolThree({super.key});
|
const PackageToolThree({super.key});
|
||||||
@@ -15,6 +14,7 @@ class _PackageToolThreeState extends State<PackageToolThree> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import 'package:custom_rating_bar/custom_rating_bar.dart';
|
import 'package:custom_rating_bar/custom_rating_bar.dart';
|
||||||
import 'package:flutter/material.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_single_child_scroll.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
|
||||||
|
|
||||||
class PackageToolTwo extends StatefulWidget {
|
class PackageToolTwo extends StatefulWidget {
|
||||||
const PackageToolTwo({super.key});
|
const PackageToolTwo({super.key});
|
||||||
@@ -17,6 +13,7 @@ class _PackageToolTwoState extends State<PackageToolTwo> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
@@ -35,8 +32,7 @@ class _PackageToolTwoState extends State<PackageToolTwo> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
@@ -58,8 +54,7 @@ class _PackageToolTwoState extends State<PackageToolTwo> {
|
|||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.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_config/mih_colors.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||||
|
|
||||||
class PackageToolZero extends StatefulWidget {
|
class PackageToolZero extends StatefulWidget {
|
||||||
@@ -18,6 +14,7 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
@@ -35,8 +32,7 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
@@ -49,13 +45,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Basic Success Alert",
|
"Basic Success Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -73,16 +67,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getPrimaryColor(
|
buttonColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Okay",
|
"Okay",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -92,16 +83,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Dismiss",
|
"Dismiss",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -111,13 +99,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Advanced Success Alert",
|
"Advanced Success Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -130,13 +116,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
MihAlertServices().warningAlert(
|
MihAlertServices().warningAlert(
|
||||||
"Warning Alert!", "This is a friendly warning mee", context);
|
"Warning Alert!", "This is a friendly warning mee", context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Warning Alert",
|
"Warning Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -154,16 +138,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getPrimaryColor(
|
buttonColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Okay",
|
"Okay",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -173,16 +154,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Dismiss",
|
"Dismiss",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -192,13 +170,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Advanced Warning Alert",
|
"Advanced Warning Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -214,13 +190,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Basic Error Alert",
|
"Basic Error Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -238,16 +212,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getPrimaryColor(
|
buttonColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Okay",
|
"Okay",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -257,16 +228,13 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pop();
|
context.pop();
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getSecondaryColor(
|
buttonColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Dismiss",
|
"Dismiss",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -276,13 +244,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Advanced Error Alert",
|
"Advanced Error Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -300,13 +266,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Delete Confirmation Alert",
|
"Delete Confirmation Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -318,13 +282,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().internetConnectionAlert(context);
|
MihAlertServices().internetConnectionAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Internet Connection Alert",
|
"Internet Connection Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -336,13 +298,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().locationPermissionAlert(context);
|
MihAlertServices().locationPermissionAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Location Permission Alert",
|
"Location Permission Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -354,13 +314,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().inputErrorAlert(context);
|
MihAlertServices().inputErrorAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Input Error Alert",
|
"Input Error Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -372,14 +330,12 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().passwordRequirementAlert(context);
|
MihAlertServices().passwordRequirementAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Password Requirement Alert",
|
"Password Requirement Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -392,13 +348,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().passwordMatchAlert(context);
|
MihAlertServices().passwordMatchAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Password Match Alert",
|
"Password Match Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -410,13 +364,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().loginErrorAlert(context);
|
MihAlertServices().loginErrorAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Login Error Alert",
|
"Login Error Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -428,13 +380,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().emailExistsAlert(context);
|
MihAlertServices().emailExistsAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Email Exists Alert",
|
"Email Exists Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -446,13 +396,11 @@ class _PackageToolZeroState extends State<PackageToolZero> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
MihAlertServices().invalidEmailAlert(context);
|
MihAlertServices().invalidEmailAlert(context);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"Invalid Email Alert",
|
"Invalid Email Alert",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
|
|||||||
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
@@ -1,14 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.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/bookmarked_business.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/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_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_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_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_delete_bookmark_alert.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_review_business_window.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() {
|
RedactedConfiguration getRedactedConfiguration() {
|
||||||
return RedactedConfiguration(
|
return RedactedConfiguration(
|
||||||
// redactedColor: Colors.pink,
|
// redactedColor: Colors.pink,
|
||||||
redactedColor: MihColors.getPrimaryColor(
|
redactedColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,13 +154,10 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
Function()? ontap,
|
Function()? ontap,
|
||||||
) {
|
) {
|
||||||
return Material(
|
return Material(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: ontap,
|
onTap: ontap,
|
||||||
splashColor: MihColors.getPrimaryColor(
|
splashColor: MihColors.primary().withOpacity(0.2),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
|
||||||
.withOpacity(0.2),
|
|
||||||
borderRadius: BorderRadius.circular(15),
|
borderRadius: BorderRadius.circular(15),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsetsGeometry.symmetric(
|
padding: EdgeInsetsGeometry.symmetric(
|
||||||
@@ -186,8 +178,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
child: Icon(
|
child: Icon(
|
||||||
icon,
|
icon,
|
||||||
// size: 35,
|
// size: 35,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).redacted(
|
).redacted(
|
||||||
@@ -207,9 +198,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
height: 1.0,
|
height: 1.0,
|
||||||
),
|
),
|
||||||
).redacted(
|
).redacted(
|
||||||
@@ -222,9 +211,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
).redacted(
|
).redacted(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -278,16 +265,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
builder: (BuildContext context, MzansiProfileProvider profileProvider,
|
builder: (BuildContext context, MzansiProfileProvider profileProvider,
|
||||||
MzansiDirectoryProvider directoryProvider, Widget? child) {
|
MzansiDirectoryProvider directoryProvider, Widget? child) {
|
||||||
return Material(
|
return Material(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary().withValues(alpha: 0.6),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")
|
|
||||||
.withValues(alpha: 0.6),
|
|
||||||
borderRadius: BorderRadius.circular(25),
|
borderRadius: BorderRadius.circular(25),
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
shadowColor: Colors.black,
|
shadowColor: Colors.black,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -297,8 +281,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
"Call",
|
"Call",
|
||||||
"Give us a quick call.",
|
"Give us a quick call.",
|
||||||
Icons.phone,
|
Icons.phone,
|
||||||
MihColors.getGreenColor(
|
MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
// print("Calling ${widget.cellNumber}");
|
// print("Calling ${widget.cellNumber}");
|
||||||
@@ -306,15 +289,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
Divider(
|
Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
_buildContactInfo(
|
_buildContactInfo(
|
||||||
"Email",
|
"Email",
|
||||||
"Send us an email.",
|
"Send us an email.",
|
||||||
Icons.email,
|
Icons.email,
|
||||||
MihColors.getPinkColor(
|
MihColors.pink(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
// print("Emailing ${widget.email}");
|
// print("Emailing ${widget.email}");
|
||||||
@@ -330,17 +311,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Divider(
|
Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
_buildContactInfo(
|
_buildContactInfo(
|
||||||
"Location",
|
"Location",
|
||||||
"Come visit us.",
|
"Come visit us.",
|
||||||
Icons.location_on,
|
Icons.location_on,
|
||||||
MihColors.getOrangeColor(
|
MihColors.orange(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
final latitude = double.parse(
|
final latitude = double.parse(
|
||||||
@@ -362,17 +339,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Divider(
|
Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
_buildContactInfo(
|
_buildContactInfo(
|
||||||
"Website",
|
"Website",
|
||||||
"Find out more about us.",
|
"Find out more about us.",
|
||||||
Icons.vpn_lock,
|
Icons.vpn_lock,
|
||||||
MihColors.getRedColor(
|
MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
_launchWebsite(widget.business.website);
|
_launchWebsite(widget.business.website);
|
||||||
@@ -393,9 +366,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
child: Divider(
|
child: Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@@ -403,9 +374,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
"Loading Rating",
|
"Loading Rating",
|
||||||
"Loading your rating.",
|
"Loading your rating.",
|
||||||
Icons.star_rate_rounded,
|
Icons.star_rate_rounded,
|
||||||
MihColors.getYellowColor(
|
MihColors.yellow(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
),
|
),
|
||||||
@@ -426,18 +395,14 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
child: Divider(
|
child: Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_buildContactInfo(
|
_buildContactInfo(
|
||||||
ratingDisplayTitle,
|
ratingDisplayTitle,
|
||||||
"Let us know how we are doing.",
|
"Let us know how we are doing.",
|
||||||
Icons.star_rate_rounded,
|
Icons.star_rate_rounded,
|
||||||
MihColors.getYellowColor(
|
MihColors.yellow(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
businessReviewRatingWindow(directoryProvider,
|
businessReviewRatingWindow(directoryProvider,
|
||||||
@@ -461,9 +426,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
child: Divider(
|
child: Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@@ -471,9 +434,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
"Loading Bookmark",
|
"Loading Bookmark",
|
||||||
"Loading your bookmark.",
|
"Loading your bookmark.",
|
||||||
Icons.bookmark_add_rounded,
|
Icons.bookmark_add_rounded,
|
||||||
MihColors.getBluishPurpleColor(
|
MihColors.bluishPurple(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
),
|
),
|
||||||
@@ -494,9 +455,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 10.0),
|
const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
child: Divider(
|
child: Divider(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_buildContactInfo(
|
_buildContactInfo(
|
||||||
@@ -505,9 +464,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
bookmarkBusiness == null
|
bookmarkBusiness == null
|
||||||
? Icons.bookmark_add_rounded
|
? Icons.bookmark_add_rounded
|
||||||
: Icons.bookmark_remove_rounded,
|
: Icons.bookmark_remove_rounded,
|
||||||
MihColors.getBluishPurpleColor(
|
MihColors.bluishPurple(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
// _launchWebsite(widget.website);
|
// _launchWebsite(widget.website);
|
||||||
@@ -526,14 +483,14 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
// Padding(
|
// Padding(
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
// child: Divider(
|
// child: Divider(
|
||||||
// color: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// color: MihColors.primary(),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// _buildContactInfo(
|
// _buildContactInfo(
|
||||||
// "Bookmark",
|
// "Bookmark",
|
||||||
// "Save us for later.",
|
// "Save us for later.",
|
||||||
// Icons.bookmark_add_rounded,
|
// Icons.bookmark_add_rounded,
|
||||||
// MihColors.getBluishPurpleColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// MihColors.bluishPurple(),
|
||||||
// () {
|
// () {
|
||||||
// // _launchWebsite(widget.website);
|
// // _launchWebsite(widget.website);
|
||||||
// print("Saving ${widget.business.Name} to Directory");
|
// print("Saving ${widget.business.Name} to Directory");
|
||||||
@@ -544,7 +501,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
// Padding(
|
// Padding(
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
// padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
// child: Divider(
|
// child: Divider(
|
||||||
// color: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// color: MihColors.primary(),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
],
|
],
|
||||||
@@ -646,16 +603,14 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
Icon(
|
Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
size: 125,
|
size: 125,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Let's Get Started",
|
"Let's Get Started",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -664,8 +619,7 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
Text(
|
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!",
|
"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(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -678,16 +632,13 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
|
|||||||
extra: true,
|
extra: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Sign In/ Create Account",
|
"Sign In/ Create Account",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.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/bookmarked_business.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/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_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_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_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_delete_bookmark_alert.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_review_business_window.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() {
|
RedactedConfiguration getRedactedConfiguration() {
|
||||||
return RedactedConfiguration(
|
return RedactedConfiguration(
|
||||||
// redactedColor: Colors.pink,
|
// redactedColor: Colors.pink,
|
||||||
redactedColor: MihColors.getPrimaryColor(
|
redactedColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,12 +195,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
_makePhoneCall(widget.business.contact_no);
|
_makePhoneCall(widget.business.contact_no);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.phone,
|
Icons.phone,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -215,9 +208,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
"Call",
|
"Call",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
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",
|
"Dear ${widget.business.Name},\n\nI would like to inquire about your services.\n\nBest regards,\n",
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getPinkColor(
|
buttonColor: MihColors.pink(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.email,
|
Icons.email,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -251,9 +240,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
"Email",
|
"Email",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -276,13 +263,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
longitude: longitude,
|
longitude: longitude,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getOrangeColor(
|
buttonColor: MihColors.orange(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.location_on,
|
Icons.location_on,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -292,9 +276,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
"Maps",
|
"Maps",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -311,13 +293,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
_launchWebsite(widget.business.website);
|
_launchWebsite(widget.business.website);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.language,
|
Icons.language,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -327,9 +306,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
"Website",
|
"Website",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -346,14 +323,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
buttonColor: MihColors.getGreyColor(
|
buttonColor: MihColors.grey(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.star_rate_rounded,
|
Icons.star_rate_rounded,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
).redacted(context: context, redact: true),
|
).redacted(context: context, redact: true),
|
||||||
@@ -363,9 +336,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
"Rate Us",
|
"Rate Us",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
).redacted(context: context, redact: true),
|
).redacted(context: context, redact: true),
|
||||||
@@ -389,14 +360,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
businessReviewRatingWindow(directoryProvider,
|
businessReviewRatingWindow(directoryProvider,
|
||||||
businessReview, true, widget.width);
|
businessReview, true, widget.width);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getYellowColor(
|
buttonColor: MihColors.yellow(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.star_rate_rounded,
|
Icons.star_rate_rounded,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -406,9 +373,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
ratingTitle,
|
ratingTitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -428,14 +393,10 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
width: 80,
|
width: 80,
|
||||||
height: 80,
|
height: 80,
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
buttonColor: MihColors.getGreyColor(
|
buttonColor: MihColors.grey(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.bookmark_add_rounded,
|
Icons.bookmark_add_rounded,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
).redacted(context: context, redact: true),
|
).redacted(context: context, redact: true),
|
||||||
@@ -445,9 +406,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
"bookmark",
|
"bookmark",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
).redacted(context: context, redact: true),
|
).redacted(context: context, redact: true),
|
||||||
@@ -474,16 +433,12 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
showDeleteBookmarkAlert(bookmarkBusiness);
|
showDeleteBookmarkAlert(bookmarkBusiness);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getBluishPurpleColor(
|
buttonColor: MihColors.bluishPurple(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
child: Icon(
|
child: Icon(
|
||||||
bookmarkBusiness == null
|
bookmarkBusiness == null
|
||||||
? Icons.bookmark_add_rounded
|
? Icons.bookmark_add_rounded
|
||||||
: Icons.bookmark_remove_rounded,
|
: Icons.bookmark_remove_rounded,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
size: iconSize,
|
size: iconSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -493,9 +448,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
bookmarkDisplayTitle,
|
bookmarkDisplayTitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -602,16 +555,14 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
Icon(
|
Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
size: 125,
|
size: 125,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Let's Get Started",
|
"Let's Get Started",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -620,8 +571,7 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
Text(
|
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!",
|
"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(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -634,16 +584,13 @@ class _MihBusinessCardV2State extends State<MihBusinessCardV2> {
|
|||||||
extra: true,
|
extra: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Sign In/ Create Account",
|
"Sign In/ Create Account",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import 'package:flutter/material.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_objects/business.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_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_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:mzansi_innovation_hub/mih_services/mih_location_services.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -54,16 +52,13 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
|||||||
? Icon(
|
? Icon(
|
||||||
MihIcons.mihRing,
|
MihIcons.mihRing,
|
||||||
size: profilePictureWidth,
|
size: profilePictureWidth,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
)
|
)
|
||||||
: widget.imageFile == null
|
: widget.imageFile == null
|
||||||
? Icon(
|
? Icon(
|
||||||
MihIcons.iDontKnow,
|
MihIcons.iDontKnow,
|
||||||
size: profilePictureWidth,
|
size: profilePictureWidth,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
)
|
)
|
||||||
: MihCircleAvatar(
|
: MihCircleAvatar(
|
||||||
imageFile: widget.imageFile,
|
imageFile: widget.imageFile,
|
||||||
@@ -72,12 +67,8 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
|||||||
editable: false,
|
editable: false,
|
||||||
fileNameController: TextEditingController(),
|
fileNameController: TextEditingController(),
|
||||||
userSelectedfile: null,
|
userSelectedfile: null,
|
||||||
frameColor: MihColors.getSecondaryColor(
|
frameColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
backgroundColor: MihColors.primary(),
|
||||||
"Dark"),
|
|
||||||
backgroundColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
onChange: () {},
|
onChange: () {},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 15),
|
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:flutter/material.dart';
|
||||||
import 'package:ken_logger/ken_logger.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_providers/mih_calendar_provider.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:table_calendar/table_calendar.dart';
|
import 'package:table_calendar/table_calendar.dart';
|
||||||
|
|
||||||
@@ -54,8 +53,7 @@ class _MIHCalendarState extends State<MIHCalendar> {
|
|||||||
formatButtonDecoration: BoxDecoration(
|
formatButtonDecoration: BoxDecoration(
|
||||||
border: Border.fromBorderSide(
|
border: Border.fromBorderSide(
|
||||||
BorderSide(
|
BorderSide(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
@@ -79,36 +77,29 @@ class _MIHCalendarState extends State<MIHCalendar> {
|
|||||||
calendarStyle: CalendarStyle(
|
calendarStyle: CalendarStyle(
|
||||||
outsideDaysVisible: false,
|
outsideDaysVisible: false,
|
||||||
todayTextStyle: TextStyle(
|
todayTextStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
todayDecoration: BoxDecoration(
|
todayDecoration: BoxDecoration(
|
||||||
color: MihColors.getGreenColor(
|
color: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
selectedTextStyle: TextStyle(
|
selectedTextStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
selectedDecoration: BoxDecoration(
|
selectedDecoration: BoxDecoration(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
weekendTextStyle: TextStyle(
|
weekendTextStyle: TextStyle(
|
||||||
color: MihColors.getGreyColor(
|
color: MihColors.grey(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
daysOfWeekStyle: DaysOfWeekStyle(
|
daysOfWeekStyle: DaysOfWeekStyle(
|
||||||
weekdayStyle: TextStyle(
|
weekdayStyle: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
weekendStyle: TextStyle(
|
weekendStyle: TextStyle(
|
||||||
color: MihColors.getGreyColor(
|
color: MihColors.grey(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import 'package:file_picker/file_picker.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:ken_logger/ken_logger.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/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 {
|
class MihCircleAvatar extends StatefulWidget {
|
||||||
final ImageProvider<Object>? imageFile;
|
final ImageProvider<Object>? imageFile;
|
||||||
@@ -126,9 +124,7 @@ class _MihCircleAvatarState extends State<MihCircleAvatar> {
|
|||||||
child: IconButton.filled(
|
child: IconButton.filled(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: WidgetStateProperty.all<Color>(
|
backgroundColor: WidgetStateProperty.all<Color>(
|
||||||
MihColors.getGreenColor(
|
MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
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:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:ken_logger/ken_logger.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/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
|
||||||
|
|
||||||
class MihImageDisplay extends StatefulWidget {
|
class MihImageDisplay extends StatefulWidget {
|
||||||
final ImageProvider<Object>? imageFile;
|
final ImageProvider<Object>? imageFile;
|
||||||
@@ -67,9 +67,7 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
|||||||
// width: widget.width,
|
// width: widget.width,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
||||||
),
|
),
|
||||||
child: Image(image: imagePreview!),
|
child: Image(image: imagePreview!),
|
||||||
@@ -79,15 +77,13 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
|||||||
width: widget.width,
|
width: widget.width,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.image_not_supported_rounded,
|
Icons.image_not_supported_rounded,
|
||||||
size: widget.width * 0.3,
|
size: widget.width * 0.3,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
@@ -97,11 +93,9 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
|||||||
right: 5,
|
right: 5,
|
||||||
child: IconButton.filled(
|
child: IconButton.filled(
|
||||||
style: IconButton.styleFrom(
|
style: IconButton.styleFrom(
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
FilePickerResult? result =
|
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: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/app_user.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.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_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_config/mih_env.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
@@ -69,15 +68,13 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
title: Text(
|
title: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
subtitle,
|
subtitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
@@ -94,8 +91,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.circle_notifications,
|
Icons.circle_notifications,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
@@ -104,8 +100,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -119,8 +114,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -132,8 +126,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
subtitle,
|
subtitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -156,8 +149,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
separatorBuilder: (BuildContext context, index) {
|
separatorBuilder: (BuildContext context, index) {
|
||||||
return Divider(
|
return Divider(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: widget.notifications.length,
|
itemCount: widget.notifications.length,
|
||||||
@@ -196,15 +188,14 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Drawer(
|
child: Drawer(
|
||||||
//backgroundColor: MihColors.getPrimaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
//backgroundColor: MihColors.primary(),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@@ -214,9 +205,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
"Notifications",
|
"Notifications",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
@@ -231,7 +220,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
// physics: const NeverScrollableScrollPhysics(),
|
// physics: const NeverScrollableScrollPhysics(),
|
||||||
// separatorBuilder: (BuildContext context, index) {
|
// separatorBuilder: (BuildContext context, index) {
|
||||||
// return Divider(
|
// return Divider(
|
||||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// color: MihColors.secondary(),
|
||||||
// );
|
// );
|
||||||
// },
|
// },
|
||||||
// itemCount: widget.notifications.length,
|
// itemCount: widget.notifications.length,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
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 '../main.dart';
|
||||||
import '../mih_objects/arguments.dart';
|
import '../mih_objects/arguments.dart';
|
||||||
|
|
||||||
@@ -131,10 +131,8 @@ class _MIHNotificationMessageState extends State<MIHNotificationMessage>
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
setState(() {
|
setState(() {
|
||||||
primary = MihColors.getPrimaryColor(
|
primary = MihColors.primary();
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
secondary = MihColors.red();
|
||||||
secondary = MihColors.getRedColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
|
||||||
});
|
});
|
||||||
_animationController = AnimationController(
|
_animationController = AnimationController(
|
||||||
vsync: this,
|
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: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/app_user.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.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 {
|
class MihPersonalProfilePreview extends StatefulWidget {
|
||||||
final AppUser user;
|
final AppUser user;
|
||||||
@@ -36,15 +34,13 @@ class _MihPersonalProfilePreviewState extends State<MihPersonalProfilePreview> {
|
|||||||
? Icon(
|
? Icon(
|
||||||
MihIcons.mihRing,
|
MihIcons.mihRing,
|
||||||
size: profilePictureWidth,
|
size: profilePictureWidth,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
)
|
)
|
||||||
: widget.imageFile == null
|
: widget.imageFile == null
|
||||||
? Icon(
|
? Icon(
|
||||||
MihIcons.iDontKnow,
|
MihIcons.iDontKnow,
|
||||||
size: profilePictureWidth,
|
size: profilePictureWidth,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
)
|
)
|
||||||
: MihCircleAvatar(
|
: MihCircleAvatar(
|
||||||
imageFile: widget.imageFile,
|
imageFile: widget.imageFile,
|
||||||
@@ -53,10 +49,8 @@ class _MihPersonalProfilePreviewState extends State<MihPersonalProfilePreview> {
|
|||||||
editable: false,
|
editable: false,
|
||||||
fileNameController: TextEditingController(),
|
fileNameController: TextEditingController(),
|
||||||
userSelectedfile: null,
|
userSelectedfile: null,
|
||||||
frameColor: MihColors.getSecondaryColor(
|
frameColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
backgroundColor: MihColors.primary(),
|
||||||
backgroundColor: MihColors.getPrimaryColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onChange: () {},
|
onChange: () {},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 15),
|
const SizedBox(width: 15),
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.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/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_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:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
@@ -77,8 +76,7 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
iconData = FontAwesomeIcons.link;
|
iconData = FontAwesomeIcons.link;
|
||||||
btnColor = MihColors.getPrimaryColor(
|
btnColor = MihColors.primary();
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark");
|
|
||||||
}
|
}
|
||||||
return MihButton(
|
return MihButton(
|
||||||
width: 80,
|
width: 80,
|
||||||
@@ -97,15 +95,15 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
// onTap: () {
|
// onTap: () {
|
||||||
// launchSocialUrl(Uri.parse(link.web_link));
|
// launchSocialUrl(Uri.parse(link.web_link));
|
||||||
// },
|
// },
|
||||||
// appName: link.destination,
|
// packageName: link.destination,
|
||||||
// appIcon: Icon(
|
// packageIcon: Icon(
|
||||||
// iconData,
|
// iconData,
|
||||||
// color: btnColor,
|
// color: btnColor,
|
||||||
// ),
|
// ),
|
||||||
// iconSize: 200,
|
// iconSize: 200,
|
||||||
// textColor: Colors.black,
|
// textColor: Colors.black,
|
||||||
// // MihColors.getPrimaryColor(
|
// // MihColors.primary(
|
||||||
// // MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// // ),
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,9 +134,7 @@ class _MihProfileLinksState extends State<MihProfileLinks> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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:go_router/go_router.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package.dart';
|
import 'package:mih_package_toolkit/mih_package_toolkit.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_providers/about_mih_provider.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_%20attributes.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_info.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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackage(
|
return MihPackage(
|
||||||
appActionButton: getAction(),
|
packageActionButton: getAction(),
|
||||||
appTools: getTools(),
|
packageTools: getTools(),
|
||||||
appBody: getToolBody(),
|
packageToolBodies: getToolBody(),
|
||||||
appToolTitles: getToolTitle(),
|
packageToolTitles: getToolTitle(),
|
||||||
selectedbodyIndex: context.watch<AboutMihProvider>().toolIndex,
|
selectedBodyIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||||
onIndexChange: (newIndex) {
|
onIndexChange: (newIndex) {
|
||||||
context.read<AboutMihProvider>().setToolIndex(newIndex);
|
context.read<AboutMihProvider>().setToolIndex(newIndex);
|
||||||
},
|
},
|
||||||
@@ -51,6 +49,7 @@ class _AboutMihState extends State<AboutMih> {
|
|||||||
MihPackageAction getAction() {
|
MihPackageAction getAction() {
|
||||||
return MihPackageAction(
|
return MihPackageAction(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
iconColor: MihColors.secondary(),
|
||||||
iconSize: 35,
|
iconSize: 35,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.goNamed(
|
context.goNamed(
|
||||||
@@ -77,7 +76,7 @@ class _AboutMihState extends State<AboutMih> {
|
|||||||
};
|
};
|
||||||
return MihPackageTools(
|
return MihPackageTools(
|
||||||
tools: temp,
|
tools: temp,
|
||||||
selcetedIndex: context.watch<AboutMihProvider>().toolIndex,
|
selectedIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'package:flutter/material.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_icons.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
|
||||||
|
|
||||||
class PolicyAndTermsText {
|
class PolicyAndTermsText {
|
||||||
List<Widget> getPrivacyPolicyText(BuildContext context, bool english) {
|
List<Widget> getPrivacyPolicyText(BuildContext context, bool english) {
|
||||||
@@ -40,8 +38,7 @@ class PolicyAndTermsText {
|
|||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -452,8 +449,7 @@ class PolicyAndTermsText {
|
|||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import 'package:go_router/go_router.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_package_tile.dart';
|
|
||||||
import 'package:flutter/material.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 {
|
class AboutMihTile extends StatefulWidget {
|
||||||
final double packageSize;
|
final double packageSize;
|
||||||
@@ -29,16 +26,14 @@ class _AboutMihTileState extends State<AboutMihTile> {
|
|||||||
// arguments: 0,
|
// arguments: 0,
|
||||||
// );
|
// );
|
||||||
},
|
},
|
||||||
appName: "About MIH",
|
packageName: "About MIH",
|
||||||
appIcon: Icon(
|
packageIcon: Icon(
|
||||||
MihIcons.aboutMih,
|
MihIcons.aboutMih,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
// size: widget.packageSize,
|
// size: widget.packageSize,
|
||||||
),
|
),
|
||||||
iconSize: widget.packageSize,
|
iconSize: widget.packageSize,
|
||||||
textColor: MihColors.getSecondaryColor(
|
textColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
import 'package:flutter/material.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_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:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class MihAttributes extends StatefulWidget {
|
class MihAttributes extends StatefulWidget {
|
||||||
@@ -33,8 +29,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
|||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
resource,
|
resource,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
size: 100,
|
size: 100,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
@@ -50,6 +45,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
@@ -71,8 +67,7 @@ class _MihAttributesState extends State<MihAttributes> {
|
|||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
size: 165,
|
size: 165,
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|||||||
@@ -1,20 +1,14 @@
|
|||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:go_router/go_router.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/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.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_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_business_details_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_install_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/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.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:mzansi_innovation_hub/mih_services/mih_user_services.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:redacted/redacted.dart';
|
import 'package:redacted/redacted.dart';
|
||||||
@@ -52,8 +46,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 4.0),
|
padding: const EdgeInsets.only(left: 4.0),
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
backgroundColor: MihColors.getPrimaryColor(
|
backgroundColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
backgroundImage: const AssetImage(
|
backgroundImage: const AssetImage(
|
||||||
"lib/mih_package_components/assets/images/founder.jpg"),
|
"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'),
|
//'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(
|
Icon(
|
||||||
MihIcons.mihRing,
|
MihIcons.mihRing,
|
||||||
size: 165,
|
size: 165,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -208,15 +200,13 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
platformIcon,
|
platformIcon,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
btnText,
|
btnText,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -267,9 +257,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
redact: isLoading,
|
redact: isLoading,
|
||||||
configuration: RedactedConfiguration(
|
configuration: RedactedConfiguration(
|
||||||
defaultBorderRadius: BorderRadius.circular(5),
|
defaultBorderRadius: BorderRadius.circular(5),
|
||||||
redactedColor: MihColors.getSecondaryColor(
|
redactedColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -322,9 +310,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
redact: isLoading,
|
redact: isLoading,
|
||||||
configuration: RedactedConfiguration(
|
configuration: RedactedConfiguration(
|
||||||
defaultBorderRadius: BorderRadius.circular(5),
|
defaultBorderRadius: BorderRadius.circular(5),
|
||||||
redactedColor: MihColors.getSecondaryColor(
|
redactedColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -350,8 +336,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
child: Divider(
|
child: Divider(
|
||||||
thickness: 1,
|
thickness: 1,
|
||||||
color: MihColors.getGreyColor(
|
color: MihColors.grey(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -364,8 +349,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
MihIcons.mihLogo,
|
MihIcons.mihLogo,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -450,11 +434,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
Text(
|
Text(
|
||||||
"Please select the platform you want to install/ Update MIH from",
|
"Please select the platform you want to install/ Update MIH from",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -468,29 +448,19 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
FontAwesomeIcons.googlePlay,
|
FontAwesomeIcons.googlePlay,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"Play Store",
|
"Play Store",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -509,29 +479,19 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
Icons.store,
|
Icons.store,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"App Gallery",
|
"App Gallery",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -548,8 +508,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
MihInstallServices().installMihTrigger(context);
|
MihInstallServices().installMihTrigger(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: getInstallButtonText(),
|
child: getInstallButtonText(),
|
||||||
),
|
),
|
||||||
@@ -561,24 +520,20 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
FontAwesomeIcons.youtube,
|
FontAwesomeIcons.youtube,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"MIH Beginners Guide",
|
"MIH Beginners Guide",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -594,24 +549,20 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
FontAwesomeIcons.patreon,
|
FontAwesomeIcons.patreon,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"Support Our Journey",
|
"Support Our Journey",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -664,25 +615,20 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
FontAwesomeIcons.tiktok,
|
FontAwesomeIcons.tiktok,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"@womenforchange.sa",
|
"@womenforchange.sa",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -698,25 +644,20 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
FaIcon(
|
FaIcon(
|
||||||
Icons.edit,
|
Icons.edit,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"Sign Petition",
|
"Sign Petition",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -890,6 +831,7 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
);
|
);
|
||||||
@@ -925,19 +867,15 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.android,
|
Icons.android,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "Android",
|
label: "Android",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
shareMIHLink(
|
shareMIHLink(
|
||||||
context,
|
context,
|
||||||
@@ -949,19 +887,15 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.apple,
|
Icons.apple,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "iOS",
|
label: "iOS",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
shareMIHLink(
|
shareMIHLink(
|
||||||
context,
|
context,
|
||||||
@@ -973,19 +907,15 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.store,
|
Icons.store,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "Huawei",
|
label: "Huawei",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
shareMIHLink(
|
shareMIHLink(
|
||||||
context,
|
context,
|
||||||
@@ -997,19 +927,15 @@ class _MihInfoState extends State<MihInfo> {
|
|||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.vpn_lock,
|
Icons.vpn_lock,
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
label: "Web",
|
label: "Web",
|
||||||
labelBackgroundColor: MihColors.getGreenColor(
|
labelBackgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
backgroundColor: MihColors.getGreenColor(
|
backgroundColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
shareMIHLink(
|
shareMIHLink(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
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_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:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -18,6 +14,7 @@ class _MihPrivacyPolicyState extends State<MihPrivacyPolicy> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(context),
|
bodyItem: getBody(context),
|
||||||
);
|
);
|
||||||
@@ -34,14 +31,12 @@ class _MihPrivacyPolicyState extends State<MihPrivacyPolicy> {
|
|||||||
englishOn = !englishOn;
|
englishOn = !englishOn;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
englishOn ? "Simplified Chinese" : "English",
|
englishOn ? "Simplified Chinese" : "English",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
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_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:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -18,6 +14,7 @@ class _MIHTermsOfServiceState extends State<MIHTermsOfService> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
bodyItem: getBody(context),
|
bodyItem: getBody(context),
|
||||||
);
|
);
|
||||||
@@ -34,14 +31,12 @@ class _MIHTermsOfServiceState extends State<MIHTermsOfService> {
|
|||||||
englishOn = !englishOn;
|
englishOn = !englishOn;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
englishOn ? "Simplified Chinese" : "English",
|
englishOn ? "Simplified Chinese" : "English",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.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/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_config/mih_env.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/access_request.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_objects/app_user.dart';
|
||||||
@@ -103,30 +101,20 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
TextSpan accessWithColour;
|
TextSpan accessWithColour;
|
||||||
if (access == "APPROVED") {
|
if (access == "APPROVED") {
|
||||||
accessWithColour = TextSpan(
|
accessWithColour = TextSpan(
|
||||||
text: "$access\n",
|
text: "$access\n", style: TextStyle(color: MihColors.green()));
|
||||||
style: TextStyle(
|
|
||||||
color: MihColors.getGreenColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
|
||||||
} else if (access == "PENDING") {
|
} else if (access == "PENDING") {
|
||||||
accessWithColour = TextSpan(
|
accessWithColour = TextSpan(
|
||||||
text: "$access\n",
|
text: "$access\n", style: TextStyle(color: MihColors.grey()));
|
||||||
style: TextStyle(
|
|
||||||
color: MihColors.getGreyColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
|
||||||
} else {
|
} else {
|
||||||
accessWithColour = TextSpan(
|
accessWithColour =
|
||||||
text: "$access\n",
|
TextSpan(text: "$access\n", style: TextStyle(color: MihColors.red()));
|
||||||
style: TextStyle(
|
|
||||||
color: MihColors.getRedColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
line1,
|
line1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: RichText(
|
subtitle: RichText(
|
||||||
@@ -142,7 +130,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
// Text(
|
// Text(
|
||||||
// subtitle,
|
// subtitle,
|
||||||
// style: TextStyle(
|
// style: TextStyle(
|
||||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// color: MihColors.secondary(),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -158,7 +146,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
},
|
},
|
||||||
// trailing: Icon(
|
// trailing: Icon(
|
||||||
// Icons.arrow_forward,
|
// 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,
|
subtitle,
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: popUpBodySize,
|
fontSize: popUpBodySize,
|
||||||
//fontWeight: FontWeight.bold,
|
//fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -231,15 +218,12 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
updateAccessAPICall(index, "declined");
|
updateAccessAPICall(index, "declined");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Decline",
|
"Decline",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -249,15 +233,12 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
updateAccessAPICall(index, "approved");
|
updateAccessAPICall(index, "approved");
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Approve",
|
"Approve",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -294,8 +275,7 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
separatorBuilder: (BuildContext context, index) {
|
separatorBuilder: (BuildContext context, index) {
|
||||||
return Divider(
|
return Divider(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: widget.accessRequests.length,
|
itemCount: widget.accessRequests.length,
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:ken_logger/ken_logger.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/main.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/patient_access.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/mih_access_controlls_provider.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_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_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_config/mih_env.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -58,30 +56,20 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
TextSpan accessWithColour;
|
TextSpan accessWithColour;
|
||||||
if (access == "APPROVED") {
|
if (access == "APPROVED") {
|
||||||
accessWithColour = TextSpan(
|
accessWithColour = TextSpan(
|
||||||
text: "$access\n",
|
text: "$access\n", style: TextStyle(color: MihColors.green()));
|
||||||
style: TextStyle(
|
|
||||||
color: MihColors.getGreenColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
|
||||||
} else if (access == "PENDING") {
|
} else if (access == "PENDING") {
|
||||||
accessWithColour = TextSpan(
|
accessWithColour = TextSpan(
|
||||||
text: "$access\n",
|
text: "$access\n", style: TextStyle(color: MihColors.grey()));
|
||||||
style: TextStyle(
|
|
||||||
color: MihColors.getGreyColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
|
||||||
} else {
|
} else {
|
||||||
accessWithColour = TextSpan(
|
accessWithColour =
|
||||||
text: "$access\n",
|
TextSpan(text: "$access\n", style: TextStyle(color: MihColors.red()));
|
||||||
style: TextStyle(
|
|
||||||
color: MihColors.getRedColor(
|
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark")));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
line1,
|
line1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: RichText(
|
subtitle: RichText(
|
||||||
@@ -96,7 +84,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
// Text(
|
// Text(
|
||||||
// subtitle,
|
// subtitle,
|
||||||
// style: TextStyle(
|
// style: TextStyle(
|
||||||
// color: MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
// color: MihColors.secondary(),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -104,7 +92,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
},
|
},
|
||||||
// trailing: Icon(
|
// trailing: Icon(
|
||||||
// Icons.arrow_forward,
|
// 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,
|
subtitle,
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: popUpBodySize,
|
fontSize: popUpBodySize,
|
||||||
//fontWeight: FontWeight.bold,
|
//fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -191,18 +178,14 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"Important Notice: Approving Profile Access",
|
"Important Notice: Approving Profile Access",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
|
"You are about to accept access to your patient's profile. Please be aware of the following important points:",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -211,9 +194,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
|
"1. Permanent Access: Once you accepts this access request, it will become permanent.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -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.",
|
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -235,9 +214,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
|
"3. Irreversible Access: Once granted, you cannot revoke access to your patient's profile.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -245,9 +222,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"By pressing the \"Approve\" button you accept the above terms.",
|
"By pressing the \"Approve\" button you accept the above terms.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -263,18 +238,14 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"Important Notice: Approved Profile Access",
|
"Important Notice: Approved Profile Access",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"You have accepted access to your patient's profile. Please be aware of the following important points:",
|
"You have accepted access to your patient's profile. Please be aware of the following important points:",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -283,9 +254,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"1. Permanent Access: This access is permanent.",
|
"1. Permanent Access: This access is permanent.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -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.",
|
"2. Shared Information: Any updates make to youe patient profile will be visible to all who have access to the profile.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -307,9 +274,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
|
"3. Irreversible Access: You cannot revoke this access to your patient's profile.",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: MihColors.getRedColor(
|
color: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -355,16 +320,12 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
MihAlertServices().internetConnectionAlert(context);
|
MihAlertServices().internetConnectionAlert(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getRedColor(
|
buttonColor: MihColors.red(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Decline",
|
"Decline",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -396,16 +357,12 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
MihAlertServices().internetConnectionAlert(context);
|
MihAlertServices().internetConnectionAlert(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getGreenColor(
|
buttonColor: MihColors.green(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Approve",
|
"Approve",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getPrimaryColor(
|
color: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
|
||||||
"Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -438,15 +395,13 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
widget.onSuccessUpate!();
|
widget.onSuccessUpate!();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonColor: MihColors.getPrimaryColor(
|
buttonColor: MihColors.primary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
elevation: 10,
|
elevation: 10,
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Dismiss",
|
"Dismiss",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
@@ -488,8 +443,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
|||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
separatorBuilder: (BuildContext context, index) {
|
separatorBuilder: (BuildContext context, index) {
|
||||||
return Divider(
|
return Divider(
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: filterAccessList(accessProvider.accessList!).length,
|
itemCount: filterAccessList(accessProvider.accessList!).length,
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package.dart';
|
import 'package:mih_package_toolkit/mih_package_toolkit.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:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.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_providers/mzansi_profile_provider.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tools/mih_access_requests.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tools/mih_access_requests.dart';
|
||||||
@@ -30,7 +27,7 @@ class _MihAccessState extends State<MihAccess> {
|
|||||||
MzansiProfileProvider mzansiProfileProvider =
|
MzansiProfileProvider mzansiProfileProvider =
|
||||||
context.read<MzansiProfileProvider>();
|
context.read<MzansiProfileProvider>();
|
||||||
if (mzansiProfileProvider.user == null) {
|
if (mzansiProfileProvider.user == null) {
|
||||||
await MihDataHelperServices().loadUserDataOnly(
|
await MihDataHelperServices().loadUserDataWithBusinessesData(
|
||||||
mzansiProfileProvider,
|
mzansiProfileProvider,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -59,11 +56,11 @@ class _MihAccessState extends State<MihAccess> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return MihPackage(
|
return MihPackage(
|
||||||
appActionButton: getAction(),
|
packageActionButton: getAction(),
|
||||||
appTools: getTools(),
|
packageTools: getTools(),
|
||||||
appBody: getToolBody(),
|
packageToolBodies: getToolBody(),
|
||||||
appToolTitles: getToolTitle(),
|
packageToolTitles: getToolTitle(),
|
||||||
selectedbodyIndex: accessProvider.toolIndex,
|
selectedBodyIndex: accessProvider.toolIndex,
|
||||||
onIndexChange: (newValue) {
|
onIndexChange: (newValue) {
|
||||||
accessProvider.setToolIndex(newValue);
|
accessProvider.setToolIndex(newValue);
|
||||||
},
|
},
|
||||||
@@ -75,6 +72,7 @@ class _MihAccessState extends State<MihAccess> {
|
|||||||
MihPackageAction getAction() {
|
MihPackageAction getAction() {
|
||||||
return MihPackageAction(
|
return MihPackageAction(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
iconColor: MihColors.secondary(),
|
||||||
iconSize: 35,
|
iconSize: 35,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.goNamed(
|
context.goNamed(
|
||||||
@@ -92,7 +90,7 @@ class _MihAccessState extends State<MihAccess> {
|
|||||||
};
|
};
|
||||||
return MihPackageTools(
|
return MihPackageTools(
|
||||||
tools: temp,
|
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: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_package_tile.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
|
||||||
|
|
||||||
class MihAccessTile extends StatefulWidget {
|
class MihAccessTile extends StatefulWidget {
|
||||||
final double packageSize;
|
final double packageSize;
|
||||||
@@ -31,16 +28,14 @@ class _MihAccessTileState extends State<MihAccessTile> {
|
|||||||
// arguments: widget.signedInUser,
|
// arguments: widget.signedInUser,
|
||||||
// );
|
// );
|
||||||
},
|
},
|
||||||
appName: "Access Controls",
|
packageName: "Access Controls",
|
||||||
appIcon: Icon(
|
packageIcon: Icon(
|
||||||
MihIcons.accessControl,
|
MihIcons.accessControl,
|
||||||
color: MihColors.getSecondaryColor(
|
color: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
// size: widget.packageSize,
|
// size: widget.packageSize,
|
||||||
),
|
),
|
||||||
iconSize: widget.packageSize,
|
iconSize: widget.packageSize,
|
||||||
textColor: MihColors.getSecondaryColor(
|
textColor: MihColors.secondary(),
|
||||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import 'package:ken_logger/ken_logger.dart';
|
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_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/mih_access_controlls_provider.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_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_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_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_access_controls_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_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:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -178,6 +176,7 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
borderOn: false,
|
borderOn: false,
|
||||||
innerHorizontalPadding: 10,
|
innerHorizontalPadding: 10,
|
||||||
bodyItem: getBody(),
|
bodyItem: getBody(),
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package.dart';
|
import 'package:mih_package_toolkit/mih_package_toolkit.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_providers/mih_calculator_provider.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/currency_exchange_rate.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tools/simple_calc.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/calculator/package_tools/simple_calc.dart';
|
||||||
@@ -42,11 +40,11 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackage(
|
return MihPackage(
|
||||||
appActionButton: getAction(),
|
packageActionButton: getAction(),
|
||||||
appTools: getTools(),
|
packageTools: getTools(),
|
||||||
appBody: getToolBody(),
|
packageToolBodies: getToolBody(),
|
||||||
appToolTitles: getToolTitle(),
|
packageToolTitles: getToolTitle(),
|
||||||
selectedbodyIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
selectedBodyIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
||||||
onIndexChange: (newIndex) {
|
onIndexChange: (newIndex) {
|
||||||
context.read<MihCalculatorProvider>().setToolIndex(newIndex);
|
context.read<MihCalculatorProvider>().setToolIndex(newIndex);
|
||||||
},
|
},
|
||||||
@@ -56,6 +54,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
|||||||
MihPackageAction getAction() {
|
MihPackageAction getAction() {
|
||||||
return MihPackageAction(
|
return MihPackageAction(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
iconColor: MihColors.secondary(),
|
||||||
iconSize: 35,
|
iconSize: 35,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.goNamed(
|
context.goNamed(
|
||||||
@@ -79,7 +78,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
|||||||
};
|
};
|
||||||
return MihPackageTools(
|
return MihPackageTools(
|
||||||
tools: temp,
|
tools: temp,
|
||||||
selcetedIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
selectedIndex: context.watch<MihCalculatorProvider>().toolIndex,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||