diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 32423a3..7266cd0 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_settings","path":"/home/yaso/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/yaso/.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":"/home/yaso/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/yaso/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/yaso/.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":"/home/yaso/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/yaso/.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":"/home/yaso/.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-12 12:08:37.721081","version":"3.32.4","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"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}} \ No newline at end of file diff --git a/README.md b/README.md index 559e979..43b5daa 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,37 @@ class _ExamplePackageState extends State { } ``` +--- + +## 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 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). @@ -125,4 +156,4 @@ We strive to respond to issues and pull requests in a timely manner. While this If you would like to support the MIH development team directly, please feel free to contribute to the [MIH Project via DonaHub](https://donahub.co.za/campaigns/mih-project) -Thank you for using the MIH Package Toolkit! \ No newline at end of file +Thank you for using the MIH Package Toolkit! diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock new file mode 100644 index 0000000..cc0929f --- /dev/null +++ b/example/ios/Podfile.lock @@ -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 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index b2e69f0..812f48c 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* 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 */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 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 */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 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 */ /* Begin PBXContainerItemProxy section */ @@ -40,6 +42,7 @@ /* End PBXCopyFilesBuildPhase 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 = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; @@ -55,19 +58,44 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 2D589B540E864F3AA91D01EC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 13BE4213B36414F809A1160E /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + BF9AD1C63D619E72946F42B5 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2C1E99200F034F54F697E756 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1415EE22816931B4FC61241E /* Pods_Runner.framework */, + B1C8417864665030A30B848B /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 331C8082294A63A400263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( @@ -76,6 +104,20 @@ path = RunnerTests; sourceTree = ""; }; + 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 = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -94,6 +136,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + 6342F71C04597DF5134EDDB6 /* Pods */, + 2C1E99200F034F54F697E756 /* Frameworks */, ); sourceTree = ""; }; @@ -128,8 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + D61BC6E88D716DC7D4EBB22A /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, + 2D589B540E864F3AA91D01EC /* Frameworks */, ); buildRules = ( ); @@ -145,12 +191,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + EFF926552F4370E1F2A802AB /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 2061BC29C1101ABE580CD7CA /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -222,6 +270,23 @@ /* End PBXResourcesBuildPhase 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 */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +318,50 @@ shellPath = /bin/sh; 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 */ /* Begin PBXSourcesBuildPhase section */ @@ -379,6 +488,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = BB242910E4BFE4FB21633CC5 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -396,6 +506,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = DC7D27D9F017D871D9244B21 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -411,6 +522,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C101B68593BFC91F1222DC62 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/example/lib/main.dart b/example/lib/main.dart index 074fa36..7a371c1 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -16,24 +16,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { @override Widget build(BuildContext context) { - return MaterialApp( - 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(), - ); + return MaterialApp(title: 'Flutter Demo', home: const HomePage()); } } @@ -45,6 +28,7 @@ class HomePage extends StatelessWidget { return Scaffold( body: Center( child: MihPackageTile( + authenticateUser: true, onTap: () { Navigator.push( context, @@ -52,9 +36,9 @@ class HomePage extends StatelessWidget { ); }, packageName: "Example Package", - packageIcon: Icon(MihIcons.mihLogo, color: MihColors.secondary()), + packageIcon: Icon(MihIcons.mihLogo, color: MihColors.primary()), iconSize: 150, - textColor: MihColors.secondary(), + textColor: MihColors.primary(), ), ), ); diff --git a/example/lib/package_structure/package_tools/tool_body_one.dart b/example/lib/package_structure/package_tools/tool_body_one.dart index 33ef326..3268110 100644 --- a/example/lib/package_structure/package_tools/tool_body_one.dart +++ b/example/lib/package_structure/package_tools/tool_body_one.dart @@ -14,6 +14,7 @@ class _ToolBodyOneState extends State { return MihPackageToolBody( backgroundColor: MihColors.primary(), bodyItem: MihSingleChildScroll( + scrollbarOn: true, child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ diff --git a/example/lib/package_structure/package_tools/tool_body_two.dart b/example/lib/package_structure/package_tools/tool_body_two.dart index 4ef0f95..10ab419 100644 --- a/example/lib/package_structure/package_tools/tool_body_two.dart +++ b/example/lib/package_structure/package_tools/tool_body_two.dart @@ -24,6 +24,7 @@ class _ToolBodyTwoState extends State { return MihPackageToolBody( backgroundColor: MihColors.primary(), bodyItem: MihSingleChildScroll( + scrollbarOn: true, child: MihForm( formKey: _formKey, formFields: [ diff --git a/lib/src/mih_single_child_scroll.dart b/lib/src/mih_single_child_scroll.dart index af314e8..009cb0d 100644 --- a/lib/src/mih_single_child_scroll.dart +++ b/lib/src/mih_single_child_scroll.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:mih_package_toolkit/src/mih_colors.dart'; /// 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 /// [ScrollConfiguration] to the child subtree. 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({ super.key, required this.child, this.scrollbarOn, + this.scrollThumbColor, + this.scrollThumbThinkness, }); @override @@ -50,11 +59,22 @@ class _MihSingleChildScrollState extends State { 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), + child: Theme( + data: Theme.of(context).copyWith( + scrollbarTheme: ScrollbarThemeData( + thumbColor: WidgetStateProperty.all(widget.scrollThumbColor ?? + 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), + ), ), ); } diff --git a/lib/src/mih_time_field.dart b/lib/src/mih_time_field.dart index d07698c..e43c7b2 100644 --- a/lib/src/mih_time_field.dart +++ b/lib/src/mih_time_field.dart @@ -92,6 +92,7 @@ class _MihTimeFieldState extends State { minute: int.tryParse(widget.controller.text.split(":")[1]) ?? 0, ) : TimeOfDay.now(), + initialEntryMode: TimePickerEntryMode.dial, builder: (context, child) { return Theme( data: Theme.of(context).copyWith( @@ -108,21 +109,57 @@ class _MihTimeFieldState extends State { 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.secondayColor ?? - MihColors.secondary(darkMode: widget.darkMode), + 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.primaryColor ?? - MihColors.primary(darkMode: widget.darkMode), - // The background color of the hour/minute input boxes - hourMinuteColor: widget.secondayColor ?? + 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: widget.primaryColor ?? - MihColors.primary(darkMode: widget.darkMode), + 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),