Compare commits
4 Commits
865d9997e1
...
103dd50c0e
| Author | SHA1 | Date | |
|---|---|---|---|
| 103dd50c0e | |||
| b187065585 | |||
| 0d65e625f1 | |||
| 98e9beb1cb |
@@ -1 +1 @@
|
|||||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false}],"macos":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[],"windows":[{"name":"local_auth_windows","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"app_settings","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]}],"date_created":"2026-03-06 15:37:08.951498","version":"3.32.2","swift_package_manager_enabled":{"ios":false,"macos":false}}
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false}],"macos":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[],"windows":[{"name":"local_auth_windows","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"app_settings","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]}],"date_created":"2026-03-20 09:42:38.514309","version":"3.32.2","swift_package_manager_enabled":{"ios":false,"macos":false}}
|
||||||
@@ -2,6 +2,15 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## 0.0.2
|
||||||
|
|
||||||
|
### Initial Release
|
||||||
|
Usability and Bug Fixes
|
||||||
|
* Add support for all platforms.
|
||||||
|
* Remove ThemeDate dependancy on mih_package_toolkit widgets.
|
||||||
|
* Add Color paramaters to `MihDateField`, `MihTimeField`, `MihPackage`, `MihPackageAction`, `MihPackageToolBody`, `MihPackageTools`.
|
||||||
|
* Add Auth Check paramater to `MihPackageTile`.
|
||||||
|
|
||||||
## 0.0.1
|
## 0.0.1
|
||||||
|
|
||||||
### Initial Release
|
### Initial Release
|
||||||
|
|||||||
31
README.md
31
README.md
@@ -110,6 +110,37 @@ class _ExamplePackageState extends State<ExamplePackage> {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Android Setup & Troubleshooting
|
||||||
|
|
||||||
|
This package relies on **`local_auth`** and **`app_settings`**. Due to recent updates in these plugins, your Android project must meet specific SDK and NDK version requirements.
|
||||||
|
|
||||||
|
### 1. Official Plugin Documentation
|
||||||
|
If you encounter platform-specific issues (such as biometric permission errors), please refer to the official setup guides:
|
||||||
|
|
||||||
|
* [**local_auth (Android Integration)**](https://pub.dev/packages/local_auth#android-integration) — *Note: Requires `FlutterFragmentActivity` in your MainActivity.*
|
||||||
|
* [**app_settings (Documentation)**](https://pub.dev/packages/app_settings) — *Note: Required for opening system settings natively.*
|
||||||
|
|
||||||
|
### 2. Required Build Configuration
|
||||||
|
Update your `android/app/build.gradle.kts` (or `build.gradle`) to match the versions required by these plugins:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
android {
|
||||||
|
// Required by the latest app_settings
|
||||||
|
compileSdk = 36
|
||||||
|
|
||||||
|
// Required by local_auth & app_settings native dependencies
|
||||||
|
ndkVersion = "27.0.12077973"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
// local_auth requires a minimum of SDK 21
|
||||||
|
minSdk = 21
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Additional information
|
## Additional information
|
||||||
|
|
||||||
For more details about MIH Package Toolkit, including usage instructions and updates, please visit the [MIH Gitea repository](https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit).
|
For more details about MIH Package Toolkit, including usage instructions and updates, please visit the [MIH Gitea repository](https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit).
|
||||||
|
|||||||
29
example/ios/Podfile.lock
Normal file
29
example/ios/Podfile.lock
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
PODS:
|
||||||
|
- app_settings (6.1.2):
|
||||||
|
- Flutter
|
||||||
|
- Flutter (1.0.0)
|
||||||
|
- local_auth_darwin (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
|
|
||||||
|
DEPENDENCIES:
|
||||||
|
- app_settings (from `.symlinks/plugins/app_settings/ios`)
|
||||||
|
- Flutter (from `Flutter`)
|
||||||
|
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
|
||||||
|
|
||||||
|
EXTERNAL SOURCES:
|
||||||
|
app_settings:
|
||||||
|
:path: ".symlinks/plugins/app_settings/ios"
|
||||||
|
Flutter:
|
||||||
|
:path: Flutter
|
||||||
|
local_auth_darwin:
|
||||||
|
:path: ".symlinks/plugins/local_auth_darwin/darwin"
|
||||||
|
|
||||||
|
SPEC CHECKSUMS:
|
||||||
|
app_settings: 0341ec6daa4f0c50f5a421bf0ad7c36084db6e90
|
||||||
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
|
local_auth_darwin: d2e8c53ef0c4f43c646462e3415432c4dab3ae19
|
||||||
|
|
||||||
|
PODFILE CHECKSUM: 4305caec6b40dde0ae97be1573c53de1882a07e5
|
||||||
|
|
||||||
|
COCOAPODS: 1.16.2
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
13BE4213B36414F809A1160E /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1C8417864665030A30B848B /* Pods_RunnerTests.framework */; };
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
|
BF9AD1C63D619E72946F42B5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1415EE22816931B4FC61241E /* Pods_Runner.framework */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@@ -40,6 +42,7 @@
|
|||||||
/* End PBXCopyFilesBuildPhase section */
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
1415EE22816931B4FC61241E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
@@ -55,19 +58,44 @@
|
|||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
986ED1F7945284CCBE47FD26 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
B1C8417864665030A30B848B /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
B5A2FDFC90BC2E9FD77D3B67 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
BB242910E4BFE4FB21633CC5 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
C101B68593BFC91F1222DC62 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
DC7D27D9F017D871D9244B21 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
E51D8B28C213FB29301A14E5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
2D589B540E864F3AA91D01EC /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
13BE4213B36414F809A1160E /* Pods_RunnerTests.framework in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
BF9AD1C63D619E72946F42B5 /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
|
2C1E99200F034F54F697E756 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
1415EE22816931B4FC61241E /* Pods_Runner.framework */,
|
||||||
|
B1C8417864665030A30B848B /* Pods_RunnerTests.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -76,6 +104,20 @@
|
|||||||
path = RunnerTests;
|
path = RunnerTests;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
6342F71C04597DF5134EDDB6 /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
E51D8B28C213FB29301A14E5 /* Pods-Runner.debug.xcconfig */,
|
||||||
|
986ED1F7945284CCBE47FD26 /* Pods-Runner.release.xcconfig */,
|
||||||
|
B5A2FDFC90BC2E9FD77D3B67 /* Pods-Runner.profile.xcconfig */,
|
||||||
|
BB242910E4BFE4FB21633CC5 /* Pods-RunnerTests.debug.xcconfig */,
|
||||||
|
DC7D27D9F017D871D9244B21 /* Pods-RunnerTests.release.xcconfig */,
|
||||||
|
C101B68593BFC91F1222DC62 /* Pods-RunnerTests.profile.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
path = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -94,6 +136,8 @@
|
|||||||
97C146F01CF9000F007C117D /* Runner */,
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
97C146EF1CF9000F007C117D /* Products */,
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||||
|
6342F71C04597DF5134EDDB6 /* Pods */,
|
||||||
|
2C1E99200F034F54F697E756 /* Frameworks */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -128,8 +172,10 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
D61BC6E88D716DC7D4EBB22A /* [CP] Check Pods Manifest.lock */,
|
||||||
331C807D294A63A400263BE5 /* Sources */,
|
331C807D294A63A400263BE5 /* Sources */,
|
||||||
331C807F294A63A400263BE5 /* Resources */,
|
331C807F294A63A400263BE5 /* Resources */,
|
||||||
|
2D589B540E864F3AA91D01EC /* Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -145,12 +191,14 @@
|
|||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
|
EFF926552F4370E1F2A802AB /* [CP] Check Pods Manifest.lock */,
|
||||||
9740EEB61CF901F6004384FC /* Run Script */,
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
97C146EA1CF9000F007C117D /* Sources */,
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
2061BC29C1101ABE580CD7CA /* [CP] Embed Pods Frameworks */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -222,6 +270,23 @@
|
|||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
2061BC29C1101ABE580CD7CA /* [CP] Embed Pods Frameworks */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||||
|
);
|
||||||
|
name = "[CP] Embed Pods Frameworks";
|
||||||
|
outputFileListPaths = (
|
||||||
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
alwaysOutOfDate = 1;
|
alwaysOutOfDate = 1;
|
||||||
@@ -253,6 +318,50 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
};
|
};
|
||||||
|
D61BC6E88D716DC7D4EBB22A /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
EFF926552F4370E1F2A802AB /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@@ -379,6 +488,7 @@
|
|||||||
};
|
};
|
||||||
331C8088294A63A400263BE5 /* Debug */ = {
|
331C8088294A63A400263BE5 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = BB242910E4BFE4FB21633CC5 /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@@ -396,6 +506,7 @@
|
|||||||
};
|
};
|
||||||
331C8089294A63A400263BE5 /* Release */ = {
|
331C8089294A63A400263BE5 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = DC7D27D9F017D871D9244B21 /* Pods-RunnerTests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@@ -411,6 +522,7 @@
|
|||||||
};
|
};
|
||||||
331C808A294A63A400263BE5 /* Profile */ = {
|
331C808A294A63A400263BE5 /* Profile */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = C101B68593BFC91F1222DC62 /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
|
<FileRef
|
||||||
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
|||||||
@@ -16,24 +16,7 @@ class MyApp extends StatefulWidget {
|
|||||||
class _MyAppState extends State<MyApp> {
|
class _MyAppState extends State<MyApp> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(title: 'Flutter Demo', home: const HomePage());
|
||||||
title: 'Flutter Demo',
|
|
||||||
theme: ThemeData(
|
|
||||||
scaffoldBackgroundColor: MihColors.primary(),
|
|
||||||
colorScheme: ColorScheme(
|
|
||||||
brightness: Brightness.dark,
|
|
||||||
primary: MihColors.secondary(),
|
|
||||||
onPrimary: MihColors.primary(),
|
|
||||||
secondary: MihColors.primary(),
|
|
||||||
onSecondary: MihColors.secondary(),
|
|
||||||
error: MihColors.red(),
|
|
||||||
onError: MihColors.primary(),
|
|
||||||
surface: MihColors.primary(),
|
|
||||||
onSurface: MihColors.secondary(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
home: const HomePage(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,6 +28,7 @@ class HomePage extends StatelessWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
child: MihPackageTile(
|
child: MihPackageTile(
|
||||||
|
authenticateUser: true,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
@@ -52,9 +36,9 @@ class HomePage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
packageName: "Example Package",
|
packageName: "Example Package",
|
||||||
packageIcon: Icon(MihIcons.mihLogo, color: MihColors.secondary()),
|
packageIcon: Icon(MihIcons.mihLogo, color: MihColors.primary()),
|
||||||
iconSize: 150,
|
iconSize: 150,
|
||||||
textColor: MihColors.secondary(),
|
textColor: MihColors.primary(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ class _ExamplePackageState extends State<ExamplePackage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MihPackage(
|
return MihPackage(
|
||||||
|
backgroundColor: MihColors.primary(),
|
||||||
|
titleColor: MihColors.secondary(),
|
||||||
packageActionButton: actionButton(),
|
packageActionButton: actionButton(),
|
||||||
packageTools: tools(),
|
packageTools: tools(),
|
||||||
packageToolBodies: toolBodies(),
|
packageToolBodies: toolBodies(),
|
||||||
@@ -40,6 +42,7 @@ class _ExamplePackageState extends State<ExamplePackage> {
|
|||||||
|
|
||||||
Widget actionButton() {
|
Widget actionButton() {
|
||||||
return MihPackageAction(
|
return MihPackageAction(
|
||||||
|
iconColor: MihColors.secondary(),
|
||||||
icon: Icon(Icons.arrow_back),
|
icon: Icon(Icons.arrow_back),
|
||||||
iconSize: 35,
|
iconSize: 35,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -65,7 +68,12 @@ class _ExamplePackageState extends State<ExamplePackage> {
|
|||||||
selectedbodyIndex = 1;
|
selectedbodyIndex = 1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return MihPackageTools(tools: temp, selectedIndex: selectedbodyIndex);
|
return MihPackageTools(
|
||||||
|
toolColor: MihColors.green(),
|
||||||
|
onSelectedIconColor: MihColors.primary(),
|
||||||
|
tools: temp,
|
||||||
|
selectedIndex: selectedbodyIndex,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> toolBodies() {
|
List<Widget> toolBodies() {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class _ToolBodyOneState extends State<ToolBodyOne> {
|
|||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
backgroundColor: MihColors.primary(),
|
backgroundColor: MihColors.primary(),
|
||||||
bodyItem: MihSingleChildScroll(
|
bodyItem: MihSingleChildScroll(
|
||||||
|
scrollbarOn: true,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class _ToolBodyTwoState extends State<ToolBodyTwo> {
|
|||||||
return MihPackageToolBody(
|
return MihPackageToolBody(
|
||||||
backgroundColor: MihColors.primary(),
|
backgroundColor: MihColors.primary(),
|
||||||
bodyItem: MihSingleChildScroll(
|
bodyItem: MihSingleChildScroll(
|
||||||
|
scrollbarOn: true,
|
||||||
child: MihForm(
|
child: MihForm(
|
||||||
formKey: _formKey,
|
formKey: _formKey,
|
||||||
formFields: [
|
formFields: [
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.0.1"
|
version: "0.0.2"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ import 'package:mih_package_toolkit/src/mih_colors.dart';
|
|||||||
/// * Theme-aware styling that syncs with [MihColors].
|
/// * Theme-aware styling that syncs with [MihColors].
|
||||||
/// * Custom elevation and border radius.
|
/// * Custom elevation and border radius.
|
||||||
class MihDateField extends StatefulWidget {
|
class MihDateField extends StatefulWidget {
|
||||||
|
/// The primary color of the date picker
|
||||||
|
final Color? primaryColor;
|
||||||
|
|
||||||
|
/// The secondary color of the date picker
|
||||||
|
final Color? secondayColor;
|
||||||
|
|
||||||
/// The controller that handles the text being edited.
|
/// The controller that handles the text being edited.
|
||||||
///
|
///
|
||||||
/// The date will be stored in `YYYY-MM-DD` format.
|
/// The date will be stored in `YYYY-MM-DD` format.
|
||||||
@@ -50,6 +56,8 @@ class MihDateField extends StatefulWidget {
|
|||||||
required this.controller,
|
required this.controller,
|
||||||
required this.labelText,
|
required this.labelText,
|
||||||
required this.required,
|
required this.required,
|
||||||
|
this.primaryColor,
|
||||||
|
this.secondayColor,
|
||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
this.borderRadius,
|
this.borderRadius,
|
||||||
@@ -79,6 +87,36 @@ class _MihDateFieldState extends State<MihDateField> {
|
|||||||
: DateTime.now(),
|
: DateTime.now(),
|
||||||
firstDate: DateTime(1900),
|
firstDate: DateTime(1900),
|
||||||
lastDate: DateTime(2200),
|
lastDate: DateTime(2200),
|
||||||
|
builder: (context, child) {
|
||||||
|
return Theme(
|
||||||
|
data: Theme.of(context).copyWith(
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
seedColor: widget.primaryColor ?? MihColors.primary(),
|
||||||
|
primary: widget.secondayColor ??
|
||||||
|
MihColors.secondary(), // Header & Selected Day
|
||||||
|
onPrimary: widget.primaryColor ??
|
||||||
|
MihColors.primary(), // Text on top of primary
|
||||||
|
surface:
|
||||||
|
widget.secondayColor ?? MihColors.secondary(), // Background
|
||||||
|
onSurface:
|
||||||
|
widget.secondayColor ?? MihColors.secondary(), // Text/Dates
|
||||||
|
),
|
||||||
|
datePickerTheme: DatePickerThemeData(
|
||||||
|
backgroundColor: widget.primaryColor ?? MihColors.primary(),
|
||||||
|
headerBackgroundColor:
|
||||||
|
widget.secondayColor ?? MihColors.secondary(),
|
||||||
|
headerForegroundColor: widget.primaryColor ?? MihColors.primary(),
|
||||||
|
),
|
||||||
|
textButtonTheme: TextButtonThemeData(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: widget.secondayColor ??
|
||||||
|
MihColors.secondary(), // Action buttons (OK/Cancel)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: child!,
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
if (picked != null) {
|
if (picked != null) {
|
||||||
widget.controller.text = picked.toString().split(" ")[0];
|
widget.controller.text = picked.toString().split(" ")[0];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mih_package_toolkit/src/mih_colors.dart';
|
||||||
import 'package:mih_package_toolkit/src/mih_package_tools.dart';
|
import 'package:mih_package_toolkit/src/mih_package_tools.dart';
|
||||||
|
|
||||||
/// The core container for MIH application modules.
|
/// The core container for MIH application modules.
|
||||||
@@ -29,6 +30,12 @@ import 'package:mih_package_toolkit/src/mih_package_tools.dart';
|
|||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
class MihPackage extends StatefulWidget {
|
class MihPackage extends StatefulWidget {
|
||||||
|
/// The background color of the package
|
||||||
|
final Color? backgroundColor;
|
||||||
|
|
||||||
|
/// The title color of the package
|
||||||
|
final Color? titleColor;
|
||||||
|
|
||||||
/// The floating action button or primary action trigger for this package.
|
/// The floating action button or primary action trigger for this package.
|
||||||
final Widget packageActionButton;
|
final Widget packageActionButton;
|
||||||
|
|
||||||
@@ -41,8 +48,8 @@ class MihPackage extends StatefulWidget {
|
|||||||
/// The list of main content widgets for each "page" of the package.
|
/// The list of main content widgets for each "page" of the package.
|
||||||
final List<Widget> packageToolBodies;
|
final List<Widget> packageToolBodies;
|
||||||
|
|
||||||
/// An optional drawer for secondary actions.
|
/// An optional drawer for actions.
|
||||||
final Drawer? actionDrawer;
|
final Widget? actionDrawer;
|
||||||
|
|
||||||
/// The initial page index to display.
|
/// The initial page index to display.
|
||||||
final int selectedBodyIndex;
|
final int selectedBodyIndex;
|
||||||
@@ -51,6 +58,8 @@ class MihPackage extends StatefulWidget {
|
|||||||
final Function(int) onIndexChange;
|
final Function(int) onIndexChange;
|
||||||
const MihPackage({
|
const MihPackage({
|
||||||
super.key,
|
super.key,
|
||||||
|
this.backgroundColor,
|
||||||
|
this.titleColor,
|
||||||
required this.packageActionButton,
|
required this.packageActionButton,
|
||||||
required this.packageTools,
|
required this.packageTools,
|
||||||
required this.packageToolBodies,
|
required this.packageToolBodies,
|
||||||
@@ -155,6 +164,7 @@ class _MihPackageState extends State<MihPackage>
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: unfocusAll,
|
onTap: unfocusAll,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
backgroundColor: widget.backgroundColor ?? MihColors.primary(),
|
||||||
drawer: widget.actionDrawer,
|
drawer: widget.actionDrawer,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
bottom: false,
|
bottom: false,
|
||||||
@@ -181,7 +191,8 @@ class _MihPackageState extends State<MihPackage>
|
|||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.packageToolTitles[_currentIndex],
|
widget.packageToolTitles[_currentIndex],
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
|
color: widget.titleColor,
|
||||||
fontSize: 23,
|
fontSize: 23,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ class MihPackageAction extends StatefulWidget {
|
|||||||
/// If null, the button will be disabled and appear greyed out.
|
/// If null, the button will be disabled and appear greyed out.
|
||||||
final void Function()? onTap;
|
final void Function()? onTap;
|
||||||
|
|
||||||
|
/// The Color of the Icon
|
||||||
|
final Color iconColor;
|
||||||
|
|
||||||
/// The size of the icon inside the button.
|
/// The size of the icon inside the button.
|
||||||
final double iconSize;
|
final double iconSize;
|
||||||
|
|
||||||
@@ -32,6 +35,7 @@ class MihPackageAction extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
required this.iconSize,
|
required this.iconSize,
|
||||||
|
required this.iconColor,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,6 +61,7 @@ class _MihPackageActionState extends State<MihPackageAction> {
|
|||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
onPressed: widget.onTap,
|
onPressed: widget.onTap,
|
||||||
icon: widget.icon,
|
icon: widget.icon,
|
||||||
|
color: widget.iconColor,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import 'dart:io' show Platform;
|
||||||
import 'package:app_settings/app_settings.dart';
|
import 'package:app_settings/app_settings.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:local_auth/local_auth.dart';
|
import 'package:local_auth/local_auth.dart';
|
||||||
import 'package:mih_package_toolkit/src/mih_button.dart';
|
import 'package:mih_package_toolkit/src/mih_button.dart';
|
||||||
import 'package:mih_package_toolkit/src/mih_colors.dart';
|
import 'package:mih_package_toolkit/src/mih_colors.dart';
|
||||||
@@ -29,7 +31,9 @@ import 'package:mih_package_toolkit/src/mih_single_child_scroll.dart';
|
|||||||
class MihPackageTile extends StatefulWidget {
|
class MihPackageTile extends StatefulWidget {
|
||||||
/// The name of the package displayed below the icon.
|
/// The name of the package displayed below the icon.
|
||||||
final String packageName;
|
final String packageName;
|
||||||
|
|
||||||
// final String? ytVideoID;
|
// final String? ytVideoID;
|
||||||
|
/// The icon of the package displayed above the name.
|
||||||
final Widget packageIcon;
|
final Widget packageIcon;
|
||||||
|
|
||||||
/// The callback triggered when the tile is tapped.
|
/// The callback triggered when the tile is tapped.
|
||||||
@@ -40,7 +44,9 @@ class MihPackageTile extends StatefulWidget {
|
|||||||
|
|
||||||
/// The color of the [packageName] text.
|
/// The color of the [packageName] text.
|
||||||
final Color textColor;
|
final Color textColor;
|
||||||
// final bool? authenticateUser;
|
|
||||||
|
/// Does the package require local auth check before opennings.
|
||||||
|
final bool? authenticateUser;
|
||||||
const MihPackageTile({
|
const MihPackageTile({
|
||||||
super.key,
|
super.key,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
@@ -49,7 +55,7 @@ class MihPackageTile extends StatefulWidget {
|
|||||||
required this.packageIcon,
|
required this.packageIcon,
|
||||||
required this.iconSize,
|
required this.iconSize,
|
||||||
required this.textColor,
|
required this.textColor,
|
||||||
// this.authenticateUser,
|
this.authenticateUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -95,7 +101,6 @@ class _MihPackageTileState extends State<MihPackageTile> {
|
|||||||
} else {
|
} else {
|
||||||
authErrorPopUp();
|
authErrorPopUp();
|
||||||
}
|
}
|
||||||
// print("Authenticated: $didBioAuth");
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
authErrorPopUp();
|
authErrorPopUp();
|
||||||
}
|
}
|
||||||
@@ -212,17 +217,17 @@ class _MihPackageTileState extends State<MihPackageTile> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> authenticateUser() async {
|
Future<void> authenticateUser() async {
|
||||||
// if (widget.authenticateUser != null &&
|
if (widget.authenticateUser != null &&
|
||||||
// widget.authenticateUser! &&
|
widget.authenticateUser! &&
|
||||||
// !kIsWeb &&
|
!kIsWeb &&
|
||||||
// !Platform.isLinux) {
|
!Platform.isLinux) {
|
||||||
// if (await isUserAuthenticated()) {
|
if (await isUserAuthenticated()) {
|
||||||
// widget.onTap();
|
widget.onTap();
|
||||||
// }
|
}
|
||||||
// } else {
|
} else {
|
||||||
// widget.onTap();
|
widget.onTap();
|
||||||
// }
|
}
|
||||||
widget.onTap();
|
// widget.onTap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -95,8 +95,7 @@ class _MihPackageToolBodyState extends State<MihPackageToolBody> {
|
|||||||
color: widget.backgroundColor,
|
color: widget.backgroundColor,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color:
|
color: widget.borderColor ??
|
||||||
widget.borderColor ??
|
|
||||||
MihColors.secondary(darkMode: widget.darkMode),
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
width: 3.0,
|
width: 3.0,
|
||||||
),
|
),
|
||||||
@@ -105,7 +104,7 @@ class _MihPackageToolBodyState extends State<MihPackageToolBody> {
|
|||||||
_innerBodyPadding = 0.0;
|
_innerBodyPadding = 0.0;
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: widget.backgroundColor,
|
color: widget.backgroundColor,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(0),
|
||||||
border: Border.all(color: widget.backgroundColor, width: 3.0),
|
border: Border.all(color: widget.backgroundColor, width: 3.0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mih_package_toolkit/src/mih_colors.dart';
|
||||||
|
|
||||||
/// A horizontal toolbar used for navigation within a [MihPackage].
|
/// A horizontal toolbar used for navigation within a [MihPackage].
|
||||||
///
|
///
|
||||||
@@ -33,6 +34,12 @@ import 'package:flutter/material.dart';
|
|||||||
/// ```
|
/// ```
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class MihPackageTools extends StatefulWidget {
|
class MihPackageTools extends StatefulWidget {
|
||||||
|
/// The selected button fill color and unselected icon color
|
||||||
|
final Color? toolColor;
|
||||||
|
|
||||||
|
/// The selected button fill color and unselected icon color
|
||||||
|
final Color? onSelectedIconColor;
|
||||||
|
|
||||||
/// A map where the key is the Icon widget and the value is the
|
/// A map where the key is the Icon widget and the value is the
|
||||||
/// callback function triggered on tap.
|
/// callback function triggered on tap.
|
||||||
final Map<Widget, void Function()?> tools;
|
final Map<Widget, void Function()?> tools;
|
||||||
@@ -43,6 +50,8 @@ class MihPackageTools extends StatefulWidget {
|
|||||||
int selectedIndex;
|
int selectedIndex;
|
||||||
MihPackageTools({
|
MihPackageTools({
|
||||||
super.key,
|
super.key,
|
||||||
|
this.toolColor,
|
||||||
|
this.onSelectedIconColor,
|
||||||
required this.tools,
|
required this.tools,
|
||||||
required this.selectedIndex,
|
required this.selectedIndex,
|
||||||
});
|
});
|
||||||
@@ -63,13 +72,24 @@ class _MihPackageToolsState extends State<MihPackageTools> {
|
|||||||
temp.add(
|
temp.add(
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: widget.selectedIndex != index,
|
visible: widget.selectedIndex != index,
|
||||||
child: IconButton(onPressed: onTap, icon: icon),
|
child: IconButton(
|
||||||
|
color: widget.toolColor ?? MihColors.secondary(),
|
||||||
|
onPressed: onTap,
|
||||||
|
icon: icon,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
temp.add(
|
temp.add(
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: widget.selectedIndex == index,
|
visible: widget.selectedIndex == index,
|
||||||
child: IconButton.filled(onPressed: onTap, icon: icon),
|
child: IconButton.filled(
|
||||||
|
color: widget.onSelectedIconColor ?? MihColors.primary(),
|
||||||
|
onPressed: onTap,
|
||||||
|
icon: icon,
|
||||||
|
style: IconButton.styleFrom(
|
||||||
|
backgroundColor: widget.toolColor ?? MihColors.secondary(),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
index += 1;
|
index += 1;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mih_package_toolkit/src/mih_colors.dart';
|
||||||
|
|
||||||
/// A standardized scrollable container for the MIH Toolkit.
|
/// A standardized scrollable container for the MIH Toolkit.
|
||||||
///
|
///
|
||||||
@@ -34,10 +35,18 @@ class MihSingleChildScroll extends StatefulWidget {
|
|||||||
/// Defaults to `false` if null. When enabled, it applies a
|
/// Defaults to `false` if null. When enabled, it applies a
|
||||||
/// [ScrollConfiguration] to the child subtree.
|
/// [ScrollConfiguration] to the child subtree.
|
||||||
final bool? scrollbarOn;
|
final bool? scrollbarOn;
|
||||||
|
|
||||||
|
/// the color of scroll thumb when enabled wth [scrollbarOn]
|
||||||
|
final Color? scrollThumbColor;
|
||||||
|
|
||||||
|
/// The thinkness of scroll thumb when enabled with [scrollbarOn]
|
||||||
|
final double? scrollThumbThinkness;
|
||||||
const MihSingleChildScroll({
|
const MihSingleChildScroll({
|
||||||
super.key,
|
super.key,
|
||||||
required this.child,
|
required this.child,
|
||||||
this.scrollbarOn,
|
this.scrollbarOn,
|
||||||
|
this.scrollThumbColor,
|
||||||
|
this.scrollThumbThinkness,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -50,11 +59,22 @@ class _MihSingleChildScrollState extends State<MihSingleChildScroll> {
|
|||||||
return SafeArea(
|
return SafeArea(
|
||||||
bottom: false,
|
bottom: false,
|
||||||
minimum: EdgeInsets.only(bottom: 5),
|
minimum: EdgeInsets.only(bottom: 5),
|
||||||
child: ScrollConfiguration(
|
child: Theme(
|
||||||
behavior: ScrollConfiguration.of(
|
data: Theme.of(context).copyWith(
|
||||||
context,
|
scrollbarTheme: ScrollbarThemeData(
|
||||||
).copyWith(scrollbars: widget.scrollbarOn ?? false),
|
thumbColor: WidgetStateProperty.all(widget.scrollThumbColor ??
|
||||||
child: SingleChildScrollView(child: widget.child),
|
MihColors.secondary()), // scrollbar color
|
||||||
|
thickness:
|
||||||
|
WidgetStateProperty.all(widget.scrollThumbThinkness ?? 10.0),
|
||||||
|
radius: Radius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: ScrollConfiguration(
|
||||||
|
behavior: ScrollConfiguration.of(
|
||||||
|
context,
|
||||||
|
).copyWith(scrollbars: widget.scrollbarOn ?? false),
|
||||||
|
child: SingleChildScrollView(child: widget.child),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ import 'package:mih_package_toolkit/src/mih_colors.dart';
|
|||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
class MihTimeField extends StatefulWidget {
|
class MihTimeField extends StatefulWidget {
|
||||||
|
/// The primary color of the date picker
|
||||||
|
final Color? primaryColor;
|
||||||
|
|
||||||
|
/// The secondary color of the date picker
|
||||||
|
final Color? secondayColor;
|
||||||
|
|
||||||
/// The controller that stores and displays the selected time string (HH:mm).
|
/// The controller that stores and displays the selected time string (HH:mm).
|
||||||
final TextEditingController controller;
|
final TextEditingController controller;
|
||||||
|
|
||||||
@@ -60,6 +66,8 @@ class MihTimeField extends StatefulWidget {
|
|||||||
required this.controller,
|
required this.controller,
|
||||||
required this.labelText,
|
required this.labelText,
|
||||||
required this.required,
|
required this.required,
|
||||||
|
this.primaryColor,
|
||||||
|
this.secondayColor,
|
||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
this.borderRadius,
|
this.borderRadius,
|
||||||
@@ -84,10 +92,95 @@ class _MihTimeFieldState extends State<MihTimeField> {
|
|||||||
minute: int.tryParse(widget.controller.text.split(":")[1]) ?? 0,
|
minute: int.tryParse(widget.controller.text.split(":")[1]) ?? 0,
|
||||||
)
|
)
|
||||||
: TimeOfDay.now(),
|
: TimeOfDay.now(),
|
||||||
|
initialEntryMode: TimePickerEntryMode.dial,
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return MediaQuery(
|
return Theme(
|
||||||
data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true),
|
data: Theme.of(context).copyWith(
|
||||||
child: child as Widget,
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
seedColor: widget.primaryColor ??
|
||||||
|
MihColors.primary(darkMode: widget.darkMode),
|
||||||
|
primary: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
onPrimary: widget.primaryColor ??
|
||||||
|
MihColors.primary(darkMode: widget.darkMode),
|
||||||
|
surface: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
onSurface: widget.primaryColor ??
|
||||||
|
MihColors.primary(darkMode: widget.darkMode),
|
||||||
|
),
|
||||||
|
timePickerTheme: TimePickerThemeData(
|
||||||
|
helpTextStyle: TextStyle(
|
||||||
|
color: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: 0.8,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
// The main dialog background
|
||||||
|
backgroundColor: widget.primaryColor ??
|
||||||
|
MihColors.primary(darkMode: widget.darkMode),
|
||||||
|
// The background of the clock dial
|
||||||
|
dialBackgroundColor: widget.primaryColor ??
|
||||||
|
MihColors.primary(darkMode: widget.darkMode),
|
||||||
|
dialTextColor: WidgetStateColor.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) {
|
||||||
|
return widget.primaryColor ??
|
||||||
|
MihColors.primary(
|
||||||
|
darkMode: widget
|
||||||
|
.darkMode); // number at selected position (inside the dot)
|
||||||
|
}
|
||||||
|
return widget.secondayColor ??
|
||||||
|
MihColors.secondary(
|
||||||
|
darkMode: widget.darkMode); // all other numbers
|
||||||
|
}),
|
||||||
|
// The color of the clock hand
|
||||||
|
dialHandColor: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
// The background color of the hour/minute input boxes
|
||||||
|
hourMinuteColor: WidgetStateColor.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) {
|
||||||
|
return widget.secondayColor ??
|
||||||
|
MihColors.secondary(
|
||||||
|
darkMode: widget
|
||||||
|
.darkMode); // lighter when selected (image 2 hour box)
|
||||||
|
}
|
||||||
|
return widget.primaryColor ??
|
||||||
|
MihColors.primary(
|
||||||
|
darkMode: widget
|
||||||
|
.darkMode); // lighter when selected (image 2 hour box)
|
||||||
|
}),
|
||||||
|
// The text color inside the hour/minute input boxes
|
||||||
|
hourMinuteTextColor: WidgetStateColor.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) {
|
||||||
|
return widget.primaryColor ??
|
||||||
|
MihColors.primary(
|
||||||
|
darkMode: widget
|
||||||
|
.darkMode); // lighter when selected (image 2 hour box)
|
||||||
|
}
|
||||||
|
return widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode);
|
||||||
|
}),
|
||||||
|
// The color of the keyboard/clock toggle icon
|
||||||
|
entryModeIconColor: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
// Styles for AM/PM toggle (if not using 24h format)
|
||||||
|
dayPeriodColor: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
dayPeriodTextColor: widget.primaryColor ??
|
||||||
|
MihColors.primary(darkMode: widget.darkMode),
|
||||||
|
),
|
||||||
|
textButtonTheme: TextButtonThemeData(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: widget.secondayColor ??
|
||||||
|
MihColors.secondary(darkMode: widget.darkMode),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Wrap your MediaQuery inside the child of the Theme
|
||||||
|
child: MediaQuery(
|
||||||
|
data: MediaQuery.of(context).copyWith(alwaysUse24HourFormat: true),
|
||||||
|
child: child!,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
11
pubspec.yaml
11
pubspec.yaml
@@ -1,10 +1,18 @@
|
|||||||
name: mih_package_toolkit
|
name: mih_package_toolkit
|
||||||
description: "A comprehensive UI toolkit and utility library for building consistent MIH Packages within the MIH Project ecosystem."
|
description: "A comprehensive UI toolkit and utility library for building consistent MIH Packages within the MIH Project ecosystem."
|
||||||
version: 0.0.1
|
version: 0.0.2
|
||||||
homepage: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit
|
homepage: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit
|
||||||
repository: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit
|
repository: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit
|
||||||
issue_tracker: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit/issues
|
issue_tracker: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit/issues
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
android:
|
||||||
|
ios:
|
||||||
|
web:
|
||||||
|
linux:
|
||||||
|
macos:
|
||||||
|
windows:
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.0.0
|
sdk: ^3.0.0
|
||||||
flutter: ">=3.0.0"
|
flutter: ">=3.0.0"
|
||||||
@@ -26,4 +34,3 @@ flutter:
|
|||||||
- family: MihIcons
|
- family: MihIcons
|
||||||
fonts:
|
fonts:
|
||||||
- asset: lib/src/fonts/Mih_Icons.ttf
|
- asset: lib/src/fonts/Mih_Icons.ttf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user