NEW: MIH Shortcuts pt2
This commit is contained in:
@@ -53,6 +53,10 @@
|
||||
android:name="flutter-deeplink"
|
||||
android:value="true"
|
||||
/>
|
||||
<!-- Shortcut Icons -->
|
||||
<meta-data
|
||||
android:name="mih_shortcut_icons"
|
||||
android:resource="@array/mih_shortcut_icons" />
|
||||
<!-- New Deep Linking -->
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/mih_icon_background" />
|
||||
<!-- <size android:width="48dp" android:height="48dp"/> -->
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:drawable="@drawable/calculator"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:gravity="center" />
|
||||
</layer-list>
|
||||
@@ -1,31 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/mih_icon_background" />
|
||||
|
||||
<padding
|
||||
android:left="0dp"
|
||||
android:top="0dp"
|
||||
android:right="0dp"
|
||||
android:bottom="0dp"/>
|
||||
<!-- <size android:width="48dp" android:height="48dp"/> -->
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:gravity="center"
|
||||
|
||||
android:drawable="@drawable/mih_logo"
|
||||
|
||||
android:width="45dp"
|
||||
android:height="45dp"
|
||||
|
||||
android:left="9dp"
|
||||
android:top="9dp"
|
||||
android:right="9dp"
|
||||
android:bottom="9dp">
|
||||
</item>
|
||||
|
||||
android:drawable="@drawable/mih_logo"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:gravity="center" />
|
||||
</layer-list>
|
||||
File diff suppressed because one or more lines are too long
9
Frontend/android/app/src/main/res/drawable/mzansi_ai.xml
Normal file
9
Frontend/android/app/src/main/res/drawable/mzansi_ai.xml
Normal file
File diff suppressed because one or more lines are too long
14
Frontend/android/app/src/main/res/drawable/mzansi_ai_sc.xml
Normal file
14
Frontend/android/app/src/main/res/drawable/mzansi_ai_sc.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/mih_icon_background" />
|
||||
<!-- <size android:width="48dp" android:height="48dp"/> -->
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:drawable="@drawable/mzansi_ai"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:gravity="center" />
|
||||
</layer-list>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,31 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/mih_icon_background" />
|
||||
|
||||
<padding
|
||||
android:left="0dp"
|
||||
android:top="0dp"
|
||||
android:right="0dp"
|
||||
android:bottom="0dp"/>
|
||||
<!-- <size android:width="48dp" android:height="48dp"/> -->
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:gravity="center"
|
||||
|
||||
android:drawable="@drawable/mzansi_wallet"
|
||||
|
||||
android:width="45dp"
|
||||
android:height="45dp"
|
||||
|
||||
android:left="9dp"
|
||||
android:top="9dp"
|
||||
android:right="9dp"
|
||||
android:bottom="9dp">
|
||||
</item>
|
||||
|
||||
android:drawable="@drawable/mzansi_wallet"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:gravity="center" />
|
||||
</layer-list>
|
||||
9
Frontend/android/app/src/main/res/values/arrays.xml
Normal file
9
Frontend/android/app/src/main/res/values/arrays.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<array name="mih_shortcut_icons">
|
||||
<item>@drawable/mih_home_sc</item>
|
||||
<item>@drawable/mzansi_wallet_sc</item>
|
||||
<item>@drawable/mzansi_ai_sc</item>
|
||||
<item>@drawable/mih_calculator_sc</item>
|
||||
</array>
|
||||
</resources>
|
||||
@@ -1,5 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#3A4454</color>
|
||||
<color name="mih_icon_background">#3A4454</color>
|
||||
<!-- Women For Change -->
|
||||
<color name="mih_icon_background">#6641b2</color>
|
||||
<color name="mih_icon_foreground">#E0D1FF</color>
|
||||
<!-- Original -->
|
||||
<!-- <color name="mih_icon_background">#3A4454</color>
|
||||
<color name="mih_icon_foreground">#bedcfe</color> -->
|
||||
</resources>
|
||||
663
Frontend/android/build/reports/problems/problems-report.html
Normal file
663
Frontend/android/build/reports/problems/problems-report.html
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_authentication_provider.dart';
|
||||
@@ -13,6 +14,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_profil
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_wallet_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/patient_manager_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:quick_actions/quick_actions.dart';
|
||||
import 'package:upgrader/upgrader.dart';
|
||||
import 'mih_config/mih_env.dart';
|
||||
import 'mih_config/mih_theme.dart';
|
||||
@@ -34,10 +36,61 @@ class MzansiInnovationHub extends StatefulWidget {
|
||||
|
||||
class _MzansiInnovationHubState extends State<MzansiInnovationHub> {
|
||||
late MihTheme theme;
|
||||
final QuickActions quickActions = QuickActions();
|
||||
String shortcut = 'no action set';
|
||||
|
||||
void _initializeQuickActions() {
|
||||
quickActions.initialize((String shortcutType) {
|
||||
setState(() {
|
||||
shortcut = shortcutType;
|
||||
});
|
||||
if (shortcutType == 'mihHome') {
|
||||
KenLogger.success("ShortCut: mihHome");
|
||||
widget.router.goNamed("mihHome");
|
||||
}
|
||||
if (shortcutType == 'mzansiWallet') {
|
||||
KenLogger.success("ShortCut: mzansiWallet");
|
||||
widget.router.goNamed("mzansiWallet");
|
||||
}
|
||||
if (shortcutType == 'mzansiAi') {
|
||||
KenLogger.success("ShortCut: mzansiAi");
|
||||
widget.router.goNamed("mzansiAi");
|
||||
}
|
||||
if (shortcutType == 'mihCalculator') {
|
||||
KenLogger.success("ShortCut: mihCalculator");
|
||||
widget.router.goNamed("mihCalculator");
|
||||
}
|
||||
});
|
||||
// Set the quick actions
|
||||
quickActions.setShortcutItems(<ShortcutItem>[
|
||||
const ShortcutItem(
|
||||
type: 'mzansiWallet',
|
||||
localizedTitle: 'Mzansi Wallet',
|
||||
icon: 'mzansi_wallet_sc',
|
||||
),
|
||||
const ShortcutItem(
|
||||
type: 'mzansiAi',
|
||||
localizedTitle: 'Mzansi AI',
|
||||
icon: 'mzansi_ai_sc',
|
||||
),
|
||||
const ShortcutItem(
|
||||
type: 'mihCalculator',
|
||||
localizedTitle: 'MIH Calc',
|
||||
icon: 'mih_calculator_sc',
|
||||
),
|
||||
]).then((void _) {
|
||||
setState(() {
|
||||
if (shortcut == 'no action set') {
|
||||
shortcut = 'mih_home_sc';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initializeQuickActions();
|
||||
theme = MihTheme();
|
||||
theme.mode = "Dark";
|
||||
theme.platform = Theme.of(context).platform;
|
||||
@@ -47,7 +100,6 @@ class _MzansiInnovationHubState extends State<MzansiInnovationHub> {
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.sizeOf(context).width;
|
||||
theme.setScreenType(width);
|
||||
precacheImage(theme.loadingImage(), context);
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
|
||||
@@ -28,7 +28,6 @@ import 'package:mzansi_innovation_hub/mih_services/mih_my_business_user_services
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_user_consent_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_user_services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:quick_actions/quick_actions.dart';
|
||||
|
||||
class MihHome extends StatefulWidget {
|
||||
const MihHome({
|
||||
@@ -43,35 +42,6 @@ class _MihHomeState extends State<MihHome> {
|
||||
DateTime latestPrivacyPolicyDate = DateTime.parse("2024-12-01");
|
||||
DateTime latestTermOfServiceDate = DateTime.parse("2024-12-01");
|
||||
bool _isLoadingInitialData = true;
|
||||
final QuickActions quickActions = QuickActions();
|
||||
String shortcut = 'no action set';
|
||||
|
||||
void _initializeQuickActions() {
|
||||
quickActions.initialize((String shortcutType) {
|
||||
setState(() {
|
||||
shortcut = shortcutType;
|
||||
});
|
||||
if (shortcutType == 'mihHome') {
|
||||
context.goNamed("mihHome");
|
||||
}
|
||||
if (shortcutType == 'mzansiWallet') {
|
||||
context.goNamed("mzansiWallet");
|
||||
}
|
||||
});
|
||||
// Set the quick actions
|
||||
quickActions.setShortcutItems(<ShortcutItem>[
|
||||
const ShortcutItem(
|
||||
type: 'mzansiWallet',
|
||||
localizedTitle: 'Mzansi Wallet',
|
||||
icon: 'mzansi_wallet_sc'),
|
||||
]).then((void _) {
|
||||
setState(() {
|
||||
if (shortcut == 'no action set') {
|
||||
shortcut = 'mihHome';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _loadInitialData() async {
|
||||
if (mounted) {
|
||||
@@ -235,7 +205,6 @@ class _MihHomeState extends State<MihHome> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadInitialData();
|
||||
_initializeQuickActions();
|
||||
}
|
||||
|
||||
List<String> getToolTitle() {
|
||||
|
||||
@@ -848,14 +848,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.5"
|
||||
gif_view:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: gif_view
|
||||
sha256: "4c7e17c134719531dabab54af121e4600d63283f56f3aff57c16db54766b67bc"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: mzansi_innovation_hub
|
||||
description: ""
|
||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.2.3+105
|
||||
version: 1.2.3+110
|
||||
# version: 1.1.1+97 #--- Updated version for upgrader package testing
|
||||
|
||||
environment:
|
||||
@@ -22,7 +22,6 @@ dependencies:
|
||||
supertokens_flutter: ^0.6.3
|
||||
http: ^1.2.1
|
||||
args: ^2.7.0
|
||||
gif_view: ^1.0.3
|
||||
intl: ^0.20.2
|
||||
flutter_native_splash: ^2.4.6
|
||||
printing: ^5.13.3
|
||||
|
||||
Reference in New Issue
Block a user