rename container folders
88
mih_ui/lib/firebase_options.dart
Normal file
@@ -0,0 +1,88 @@
|
||||
// File generated by FlutterFire CLI.
|
||||
// ignore_for_file: type=lint
|
||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
|
||||
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||
///
|
||||
/// Example:
|
||||
/// ```dart
|
||||
/// import 'firebase_options.dart';
|
||||
/// // ...
|
||||
/// await Firebase.initializeApp(
|
||||
/// options: DefaultFirebaseOptions.currentPlatform,
|
||||
/// );
|
||||
/// ```
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
if (kIsWeb) {
|
||||
return web;
|
||||
}
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
return android;
|
||||
case TargetPlatform.iOS:
|
||||
return ios;
|
||||
case TargetPlatform.macOS:
|
||||
return macos;
|
||||
case TargetPlatform.windows:
|
||||
return windows;
|
||||
case TargetPlatform.linux:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for linux - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
default:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions are not supported for this platform.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static const FirebaseOptions web = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDN-f4sJ4n_fyvrLR193_IIkTsccRVUQxw',
|
||||
appId: '1:33677883408:web:47b8021df7fcacd2223295',
|
||||
messagingSenderId: '33677883408',
|
||||
projectId: 'mzansi-innovation-hub',
|
||||
authDomain: 'mzansi-innovation-hub.firebaseapp.com',
|
||||
storageBucket: 'mzansi-innovation-hub.firebasestorage.app',
|
||||
measurementId: 'G-Y3B5E3HCJY',
|
||||
);
|
||||
|
||||
static const FirebaseOptions android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyBUkjWdu9YcgiF-e9TC5hoiEoCjPyjA5hU',
|
||||
appId: '1:33677883408:android:ebd8565991c56257223295',
|
||||
messagingSenderId: '33677883408',
|
||||
projectId: 'mzansi-innovation-hub',
|
||||
storageBucket: 'mzansi-innovation-hub.firebasestorage.app',
|
||||
);
|
||||
|
||||
static const FirebaseOptions ios = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDRqY5I5CXjEtWkUX1YUfKT8IUlln9PUuY',
|
||||
appId: '1:33677883408:ios:2048dac086428716223295',
|
||||
messagingSenderId: '33677883408',
|
||||
projectId: 'mzansi-innovation-hub',
|
||||
storageBucket: 'mzansi-innovation-hub.firebasestorage.app',
|
||||
iosBundleId: 'za.co.mzansiinnovationhub.mih',
|
||||
);
|
||||
|
||||
static const FirebaseOptions macos = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDRqY5I5CXjEtWkUX1YUfKT8IUlln9PUuY',
|
||||
appId: '1:33677883408:ios:e2db11a42fc3452e223295',
|
||||
messagingSenderId: '33677883408',
|
||||
projectId: 'mzansi-innovation-hub',
|
||||
storageBucket: 'mzansi-innovation-hub.firebasestorage.app',
|
||||
iosBundleId: 'com.example.patientManager',
|
||||
);
|
||||
|
||||
static const FirebaseOptions windows = FirebaseOptions(
|
||||
apiKey: 'AIzaSyDN-f4sJ4n_fyvrLR193_IIkTsccRVUQxw',
|
||||
appId: '1:33677883408:web:e08becaef3261c59223295',
|
||||
messagingSenderId: '33677883408',
|
||||
projectId: 'mzansi-innovation-hub',
|
||||
authDomain: 'mzansi-innovation-hub.firebaseapp.com',
|
||||
storageBucket: 'mzansi-innovation-hub.firebasestorage.app',
|
||||
measurementId: 'G-FKKENBX8TT',
|
||||
);
|
||||
}
|
||||
174
mih_ui/lib/main.dart
Normal file
@@ -0,0 +1,174 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
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_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_authentication_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_banner_ad_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calculator_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_file_viewer_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_wallet_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/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';
|
||||
|
||||
class MzansiInnovationHub extends StatefulWidget {
|
||||
final GoRouter router;
|
||||
const MzansiInnovationHub({
|
||||
super.key,
|
||||
required this.router,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MzansiInnovationHub> createState() => _MzansiInnovationHubState();
|
||||
|
||||
// ignore: library_private_types_in_public_api
|
||||
static _MzansiInnovationHubState? of(BuildContext context) =>
|
||||
context.findAncestorStateOfType<_MzansiInnovationHubState>();
|
||||
}
|
||||
|
||||
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();
|
||||
if (!kIsWeb) {
|
||||
_initializeQuickActions();
|
||||
}
|
||||
theme = MihTheme();
|
||||
theme.mode = "Dark";
|
||||
theme.platform = Theme.of(context).platform;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.sizeOf(context).width;
|
||||
theme.setScreenType(width);
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihAuthenticationProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiProfileProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiWalletProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiAiProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiDirectoryProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihBannerAdProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihCalculatorProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihAccessControllsProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihCalendarProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => AboutMihProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihMineSweeperProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => PatientManagerProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihFileViewerProvider(),
|
||||
),
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
title: AppEnviroment.getEnv() == "Dev"
|
||||
? "Dev | MIH App: Mzansi Innovation Hub"
|
||||
: "MIH App: Mzansi Innovation Hub",
|
||||
themeMode: ThemeMode.dark,
|
||||
theme: theme.getThemeData(),
|
||||
darkTheme: theme.getThemeData(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
routerConfig: widget.router,
|
||||
builder: (context, child) {
|
||||
if (child == null) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
return UpgradeAlert(
|
||||
navigatorKey: widget.router.routerDelegate.navigatorKey,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
46
mih_ui/lib/main_dev.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart'
|
||||
if (dart.library.html) 'package:flutter_web_plugins/url_strategy.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:mzansi_innovation_hub/firebase_options.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_go_router.dart';
|
||||
import 'package:pwa_install/pwa_install.dart';
|
||||
import 'mih_config/mih_env.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||
await AppEnviroment.setupEnv(Enviroment.dev);
|
||||
SuperTokens.init(
|
||||
apiDomain: AppEnviroment.baseApiUrl,
|
||||
apiBasePath: "/auth",
|
||||
);
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
if (!kIsWeb) {
|
||||
const List<String> testDeviceIds = ['733d4c68-9b54-453a-9622-2df407310f40'];
|
||||
MobileAds.instance.updateRequestConfiguration(
|
||||
RequestConfiguration(
|
||||
testDeviceIds: testDeviceIds,
|
||||
),
|
||||
);
|
||||
MobileAds.instance.initialize();
|
||||
} else {
|
||||
usePathUrlStrategy();
|
||||
}
|
||||
PWAInstall().setup(installCallback: () {
|
||||
debugPrint('APP INSTALLED!');
|
||||
});
|
||||
final GoRouter appRouter = MihGoRouter().mihRouter;
|
||||
FlutterNativeSplash.remove();
|
||||
runApp(MzansiInnovationHub(
|
||||
router: appRouter,
|
||||
));
|
||||
}
|
||||
40
mih_ui/lib/main_prod.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart'
|
||||
if (dart.library.html) 'package:flutter_web_plugins/url_strategy.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:mzansi_innovation_hub/firebase_options.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_go_router.dart';
|
||||
import 'package:pwa_install/pwa_install.dart';
|
||||
import 'mih_config/mih_env.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
||||
await AppEnviroment.setupEnv(Enviroment.prod);
|
||||
SuperTokens.init(
|
||||
apiDomain: AppEnviroment.baseApiUrl,
|
||||
apiBasePath: "/auth",
|
||||
);
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
if (!kIsWeb) {
|
||||
MobileAds.instance.initialize();
|
||||
} else {
|
||||
usePathUrlStrategy();
|
||||
}
|
||||
PWAInstall().setup(installCallback: () {
|
||||
debugPrint('APP INSTALLED!');
|
||||
});
|
||||
final GoRouter appRouter = MihGoRouter().mihRouter;
|
||||
FlutterNativeSplash.remove();
|
||||
runApp(MzansiInnovationHub(
|
||||
router: appRouter,
|
||||
));
|
||||
}
|
||||
140
mih_ui/lib/mih_config/mih_colors.dart
Normal file
@@ -0,0 +1,140 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihColors {
|
||||
bool women4Change = true;
|
||||
static Color getPrimaryColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
// return const Color(0XFF3A4454); // Original
|
||||
return const Color(0XFF6641b2); // Women4change
|
||||
} else {
|
||||
// return const Color(0XFFbedcfe); // Original
|
||||
return const Color(0xFFE0D1FF); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSecondaryColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
// return const Color(0XFFbedcfe); // Original
|
||||
return const Color(0xFFE0D1FF); // Women4change
|
||||
} else {
|
||||
// return const Color(0XFF3A4454); // Original
|
||||
return const Color(0XFF6641b2); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSecondaryInvertedColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
// return const Color(0XFF412301); // Original
|
||||
return const Color(0XFF1f2e00); // Women4change
|
||||
} else {
|
||||
// return const Color(0XFFc5bbab); // Original
|
||||
return const Color(0XFF99be4d); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getHighlightColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
// return const Color(0XFF9bc7fa);
|
||||
return const Color(0xFFC8AFFB); // Women4change
|
||||
} else {
|
||||
// return const Color(0XFF354866);
|
||||
return const Color(0XFF6641b2); // Women4change
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGreyColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0XFFc8c8c8);
|
||||
} else {
|
||||
return const Color(0XFF747474);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGreenColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xff8ae290);
|
||||
} else {
|
||||
return const Color(0xFF41B349);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getRedColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffD87E8B);
|
||||
} else {
|
||||
return const Color(0xffbb3d4f);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getPinkColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffdaa2e9);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffdaa2e9);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getOrangeColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffd69d7d);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFBD7145);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getYellowColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xfff4e467);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffd4af37);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getBluishPurpleColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xff6e7dcc);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFF5567C0);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getPurpleColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffb682e7);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFF9857D4);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGoldColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xFFD4AF37);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffFFD700);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSilverColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffC0C0C0);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFA6A6A6);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getBronze(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffB1560F);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFCD7F32);
|
||||
}
|
||||
}
|
||||
}
|
||||
89
mih_ui/lib/mih_config/mih_env.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
enum Enviroment { dev, prod }
|
||||
|
||||
//
|
||||
abstract class AppEnviroment {
|
||||
static late String baseAppUrl;
|
||||
static late String baseApiUrl;
|
||||
static late String baseAiUrl;
|
||||
static late String baseFileUrl;
|
||||
static late String bannerAdUnitId;
|
||||
static late String whatsappAccessToken;
|
||||
static late String fingerPrintPluginKey;
|
||||
static late Enviroment _enviroment;
|
||||
static Enviroment get enviroment => _enviroment;
|
||||
static setupEnv(Enviroment env) {
|
||||
_enviroment = env;
|
||||
switch (env) {
|
||||
case Enviroment.dev:
|
||||
{
|
||||
if (kIsWeb) {
|
||||
//================= Web Dev Urls =================
|
||||
baseAppUrl = "http://localhost:80";
|
||||
baseApiUrl = "http://localhost:8080";
|
||||
baseFileUrl = "http://localhost:9000";
|
||||
baseAiUrl = "http://localhost:11434";
|
||||
bannerAdUnitId = 'ca-app-pub-3940256099942544/2435281174';
|
||||
break;
|
||||
} else if (Platform.isAndroid) {
|
||||
//================= Android Dev Urls =================
|
||||
baseAppUrl = "http://10.0.2.2:80";
|
||||
baseApiUrl = "http://10.0.2.2:8080";
|
||||
baseFileUrl = "http://10.0.2.2:9000";
|
||||
baseAiUrl = "http://10.0.2.2:11434";
|
||||
bannerAdUnitId = 'ca-app-pub-3940256099942544/9214589741';
|
||||
} else {
|
||||
//================= Web & iOS Dev Urls =================
|
||||
baseAppUrl = "http://localhost:80";
|
||||
baseApiUrl = "http://localhost:8080";
|
||||
baseFileUrl = "http://localhost:9000";
|
||||
baseAiUrl = "http://localhost:11434";
|
||||
bannerAdUnitId = 'ca-app-pub-3940256099942544/2435281174';
|
||||
break;
|
||||
}
|
||||
}
|
||||
case Enviroment.prod:
|
||||
{
|
||||
baseAppUrl = "https://app.mzansi-innovation-hub.co.za";
|
||||
baseApiUrl = "https://api.mzansi-innovation-hub.co.za";
|
||||
baseFileUrl = "https://minio.mzansi-innovation-hub.co.za";
|
||||
baseAiUrl = "https://ai.mzansi-innovation-hub.co.za";
|
||||
if (kIsWeb) {
|
||||
// No banner ads on web, or use a placeholder/specific web ad unit
|
||||
bannerAdUnitId = ''; // Or a specific web ad unit ID if you have one
|
||||
} else if (Platform.isAndroid) {
|
||||
bannerAdUnitId =
|
||||
'ca-app-pub-4781880856775334/8868663088'; // Android
|
||||
} else if (Platform.isIOS) {
|
||||
// Use Platform.isIOS for clarity
|
||||
bannerAdUnitId = 'ca-app-pub-4781880856775334/6640324682'; // iOS
|
||||
} else {
|
||||
// Fallback for other platforms if necessary
|
||||
bannerAdUnitId = '';
|
||||
}
|
||||
// bannerAdUnitId = Platform.isAndroid
|
||||
// ? 'ca-app-pub-4781880856775334/8868663088' // Android
|
||||
// : 'ca-app-pub-4781880856775334/6640324682'; // iOS
|
||||
//fingerPrintPluginKey = 'h5X7a5j14iUZCobI1ZeX';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static String getEnv() {
|
||||
//_enviroment = env;
|
||||
switch (_enviroment) {
|
||||
case Enviroment.dev:
|
||||
{
|
||||
return "Dev";
|
||||
}
|
||||
case Enviroment.prod:
|
||||
{
|
||||
return "Prod";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
375
mih_ui/lib/mih_config/mih_go_router.dart
Normal file
@@ -0,0 +1,375 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_file_viewer/components/mih_print_prevew.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_test.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/about_mih.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/mih_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/mih_calculator.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calendar/mzansi_calendar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/mih_auth_forgot_password.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/mih_auth_password_reset.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/mih_authentication.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_file_viewer/mih_fle_viewer.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/mih_home.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/mih_route_error.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/mih_mine_sweeper.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_ai/mzansi_ai.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_directory/mzansi_directory.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/busines_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/mzansi_business_profile_view.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/mzansi_set_up_business_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/personal_profile/mzansi_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/personal_profile/mzansi_profile_view.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/components/mih_barcode_scanner.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/mih_wallet.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_manager/pat_manager.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/patient_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/patient_set_up.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
class MihGoRouterPaths {
|
||||
// External
|
||||
static const String resetPassword = '/auth/reset-password';
|
||||
static const String privacyPolicyExternal = '/privacy-policy';
|
||||
static const String termsOfServiceExternal = '/terms-of-service';
|
||||
|
||||
// Internal
|
||||
// static const String authCheck = '/';
|
||||
static const String mihAuthentication = '/mih-authentication';
|
||||
static const String mihHome = '/';
|
||||
static const String notifications = '/notifications';
|
||||
static const String forgotPassword = '/mih-authentication/forgot-password';
|
||||
static const String aboutMih = '/about';
|
||||
static const String mzansiProfileManage = '/mzansi-profile';
|
||||
static const String mzansiProfileView = '/mzansi-profile/view';
|
||||
static const String businessProfileSetup = '/business-profile/set-up';
|
||||
static const String businessProfileManage = '/business-profile/manage';
|
||||
static const String businessProfileView = '/business-profile/view';
|
||||
static const String patientProfile = '/patient-profile';
|
||||
static const String patientProfileSetup = '/patient-profile/set-up';
|
||||
static const String mzansiWallet = '/mzansi-wallet';
|
||||
static const String mzansiDirectory = '/mzansi-directory';
|
||||
static const String mihAccess = '/mih-access';
|
||||
static const String calendar = '/calendar';
|
||||
static const String appointments = '/appointments';
|
||||
static const String patientManager = '/patient-manager';
|
||||
static const String patientManagerPatient = '/patient-manager/patient';
|
||||
static const String fileViewer = '/file-veiwer';
|
||||
static const String printPreview = '/file-veiwer/print-preview';
|
||||
static const String barcodeScanner = '/scanner';
|
||||
static const String calculator = '/calculator';
|
||||
static const String mzansiAi = '/mzansi-ai';
|
||||
static const String mihMineSweeper = '/mih-minesweeper';
|
||||
static const String packageDevTest = '/package-dev';
|
||||
}
|
||||
|
||||
class MihGoRouter {
|
||||
final GoRouter mihRouter = GoRouter(
|
||||
initialLocation: MihGoRouterPaths.mihHome,
|
||||
redirect: (BuildContext context, GoRouterState state) async {
|
||||
final bool isUserSignedIn = await SuperTokens.doesSessionExist();
|
||||
final unauthenticatedPaths = [
|
||||
MihGoRouterPaths.mihAuthentication,
|
||||
MihGoRouterPaths.forgotPassword,
|
||||
MihGoRouterPaths.resetPassword,
|
||||
MihGoRouterPaths.aboutMih,
|
||||
MihGoRouterPaths.businessProfileView,
|
||||
];
|
||||
KenLogger.success(
|
||||
"Redirect Check: ${state.fullPath}, isUserSignedIn: $isUserSignedIn");
|
||||
if (!isUserSignedIn && !unauthenticatedPaths.contains(state.fullPath)) {
|
||||
return MihGoRouterPaths.mihAuthentication;
|
||||
}
|
||||
if (isUserSignedIn &&
|
||||
unauthenticatedPaths.contains(state.fullPath) &&
|
||||
state.fullPath != MihGoRouterPaths.aboutMih &&
|
||||
state.fullPath != MihGoRouterPaths.businessProfileView) {
|
||||
return MihGoRouterPaths.mihHome;
|
||||
}
|
||||
return null; // Stay on current route
|
||||
},
|
||||
routes: [
|
||||
// ========================== MIH Auth ==================================
|
||||
GoRoute(
|
||||
name: "mihAuthentication",
|
||||
path: MihGoRouterPaths.mihAuthentication,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihAuthentication");
|
||||
return MihAuthentication();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "forgotPassword",
|
||||
path: MihGoRouterPaths.forgotPassword,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: forgotPassword");
|
||||
return const MihAuthForgotPassword();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "resetPassword",
|
||||
path: MihGoRouterPaths.resetPassword,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: resetPassword");
|
||||
String? token = state.uri.queryParameters['token'];
|
||||
KenLogger.success("token: $token");
|
||||
if (token == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MihAuthPasswordReset(token: token);
|
||||
},
|
||||
),
|
||||
// ========================== MIH Home ==================================
|
||||
GoRoute(
|
||||
name: "mihHome",
|
||||
path: MihGoRouterPaths.mihHome,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihHome");
|
||||
return MihHome(
|
||||
key: UniqueKey(),
|
||||
);
|
||||
},
|
||||
),
|
||||
// ========================== About MIH ==================================
|
||||
GoRoute(
|
||||
name: "aboutMih",
|
||||
path: MihGoRouterPaths.aboutMih,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: aboutMih");
|
||||
return AboutMih();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Profile Personal ==================================
|
||||
GoRoute(
|
||||
name: "mzansiProfileManage",
|
||||
path: MihGoRouterPaths.mzansiProfileManage,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiProfileManage");
|
||||
return MzansiProfile();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "mzansiProfileView",
|
||||
path: MihGoRouterPaths.mzansiProfileView,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiProfileView");
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
if (directoryProvider.selectedUser == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiProfileView();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Profile Business ==================================
|
||||
GoRoute(
|
||||
name: "businessProfileManage",
|
||||
path: MihGoRouterPaths.businessProfileManage,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: businessProfileManage");
|
||||
return BusinesProfile();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "businessProfileView",
|
||||
path: MihGoRouterPaths.businessProfileView,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: businessProfileView");
|
||||
String? businessId = state.uri.queryParameters['business_id'];
|
||||
KenLogger.success("businessId: $businessId");
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
if (directoryProvider.selectedBusiness == null &&
|
||||
businessId == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiBusinessProfileView(
|
||||
businessId: businessId,
|
||||
fromMzansiDirectory: businessId == null,
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "businessProfileSetup",
|
||||
path: MihGoRouterPaths.businessProfileSetup,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: businessProfileSetup");
|
||||
return MzansiSetUpBusinessProfile();
|
||||
},
|
||||
),
|
||||
// ========================== MIH Calculator ==================================
|
||||
GoRoute(
|
||||
name: "mihCalculator",
|
||||
path: MihGoRouterPaths.calculator,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihCalculator");
|
||||
return MIHCalculator();
|
||||
},
|
||||
),
|
||||
// ========================== MIH Calculator ==================================
|
||||
GoRoute(
|
||||
name: "mihCalendar",
|
||||
path: MihGoRouterPaths.calendar,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihCalendar");
|
||||
return MzansiCalendar();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi AI ==================================
|
||||
GoRoute(
|
||||
name: "mzansiAi",
|
||||
path: MihGoRouterPaths.mzansiAi,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiAi");
|
||||
return MzansiAi();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Wallet ==================================
|
||||
GoRoute(
|
||||
name: "mzansiWallet",
|
||||
path: MihGoRouterPaths.mzansiWallet,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiWallet");
|
||||
return MihWallet();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "barcodeScanner",
|
||||
path: MihGoRouterPaths.barcodeScanner,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: barcodeScanner");
|
||||
final TextEditingController? args =
|
||||
state.extra as TextEditingController?;
|
||||
if (args == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MihBarcodeScanner(cardNumberController: args);
|
||||
},
|
||||
),
|
||||
// ========================== Test Package ==================================
|
||||
GoRoute(
|
||||
name: "testPackage",
|
||||
path: MihGoRouterPaths.packageDevTest,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: testPackage");
|
||||
return PackageTest();
|
||||
},
|
||||
),
|
||||
// ========================== MIH Access Controls ==================================
|
||||
GoRoute(
|
||||
name: "mihAccess",
|
||||
path: MihGoRouterPaths.mihAccess,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihAccess");
|
||||
return MihAccess();
|
||||
},
|
||||
),
|
||||
// ========================== Patient Profile ==================================
|
||||
GoRoute(
|
||||
name: "patientProfile",
|
||||
path: MihGoRouterPaths.patientProfile,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: patientProfile");
|
||||
return PatientProfile();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "patientProfileSetup",
|
||||
path: MihGoRouterPaths.patientProfileSetup,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: patientProfileSetup");
|
||||
return PatientSetUp();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "patientManager",
|
||||
path: MihGoRouterPaths.patientManager,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: patientManager");
|
||||
return PatManager();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "patientManagerPatient",
|
||||
path: MihGoRouterPaths.patientManagerPatient,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: patientManagerPatient");
|
||||
return PatientProfile();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Directory ==================================
|
||||
GoRoute(
|
||||
name: "mzansiDirectory",
|
||||
path: MihGoRouterPaths.mzansiDirectory,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiDirectory");
|
||||
return MzansiDirectory();
|
||||
},
|
||||
),
|
||||
// ========================== End ==================================
|
||||
GoRoute(
|
||||
name: "fileViewer",
|
||||
path: MihGoRouterPaths.fileViewer,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: fileViewer");
|
||||
return MihFleViewer();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "printPreview",
|
||||
path: MihGoRouterPaths.printPreview,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: printPreview");
|
||||
final PrintPreviewArguments? args =
|
||||
state.extra as PrintPreviewArguments?;
|
||||
if (args == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MIHPrintPreview(arguments: args);
|
||||
},
|
||||
),
|
||||
// ========================== MIH Minesweeper ==================================
|
||||
GoRoute(
|
||||
name: "mihMinesweeper",
|
||||
path: MihGoRouterPaths.mihMineSweeper,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihMineSweeper");
|
||||
return MihMineSweeper();
|
||||
},
|
||||
),
|
||||
// ========================== End ==================================
|
||||
// GoRoute(
|
||||
// name: "notifications",
|
||||
// path: MihGoRouterPaths.notifications,
|
||||
// builder: (BuildContext context, GoRouterState state) {
|
||||
// final NotificationArguments? args = state.extra as NotificationArguments?;
|
||||
// return MIHNotificationMessage(arguments: args!);
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
// 3. Error handling with `errorBuilder` and `redirect`
|
||||
errorBuilder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.error('Invalid Route');
|
||||
return const MihRouteError();
|
||||
},
|
||||
);
|
||||
}
|
||||
145
mih_ui/lib/mih_config/mih_theme.dart
Normal file
@@ -0,0 +1,145 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import "package:universal_html/html.dart" as html;
|
||||
|
||||
class MihTheme {
|
||||
late String mode;
|
||||
late String screenType;
|
||||
late AssetImage loading;
|
||||
late String loadingAssetText;
|
||||
late TargetPlatform platform;
|
||||
bool kIsWeb = const bool.fromEnvironment('dart.library.js_util');
|
||||
String latestVersion = "1.2.5";
|
||||
MihTheme() {
|
||||
mode = "Dark";
|
||||
}
|
||||
|
||||
ThemeData getData(bool bool) {
|
||||
return ThemeData(
|
||||
fontFamily: 'Segoe UI',
|
||||
scaffoldBackgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
colorScheme: ColorScheme(
|
||||
brightness: getBritness(),
|
||||
primary: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
onPrimary: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
secondary: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
onSecondary: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
error: MihColors.getRedColor(mode == "Dark"),
|
||||
onError: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
surface: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
onSurface: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
),
|
||||
datePickerTheme: DatePickerThemeData(
|
||||
backgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
headerBackgroundColor: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
headerForegroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
color: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
foregroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
titleTextStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||
backgroundColor: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
foregroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
extendedTextStyle:
|
||||
TextStyle(color: MihColors.getPrimaryColor(mode == "Dark")),
|
||||
),
|
||||
drawerTheme: DrawerThemeData(
|
||||
backgroundColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
),
|
||||
textSelectionTheme: TextSelectionThemeData(
|
||||
cursorColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
selectionColor:
|
||||
MihColors.getPrimaryColor(mode == "Dark").withOpacity(0.25),
|
||||
selectionHandleColor: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
),
|
||||
tooltipTheme: TooltipThemeData(
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(
|
||||
width: 1.0,
|
||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color:
|
||||
MihColors.getPrimaryColor(mode == "Dark").withOpacity(0.18),
|
||||
blurRadius: 6,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
textStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(mode == "Dark"),
|
||||
fontSize: 13,
|
||||
height: 1.2,
|
||||
),
|
||||
waitDuration: const Duration(milliseconds: 500),
|
||||
showDuration: const Duration(seconds: 3),
|
||||
preferBelow: true,
|
||||
verticalOffset: 24,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
triggerMode: TooltipTriggerMode.longPress,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getPlatform() {
|
||||
if (kIsWeb) {
|
||||
return "Web";
|
||||
} else if (!kIsWeb) {
|
||||
if (platform == TargetPlatform.android) {
|
||||
return "Android";
|
||||
} else if (platform == TargetPlatform.iOS) {
|
||||
return "iOS";
|
||||
}
|
||||
}
|
||||
return "Other";
|
||||
}
|
||||
|
||||
bool isPwa() {
|
||||
return html.window.matchMedia('(display-mode: standalone)').matches;
|
||||
}
|
||||
|
||||
void setMode(String m) {
|
||||
mode;
|
||||
}
|
||||
|
||||
String getLatestVersion() {
|
||||
return latestVersion;
|
||||
}
|
||||
|
||||
ThemeData getThemeData() {
|
||||
return getData(mode == "Dark");
|
||||
}
|
||||
|
||||
ThemeData darkMode() {
|
||||
return getData(mode == "Dark");
|
||||
}
|
||||
|
||||
ThemeData lightMode() {
|
||||
return getData(mode == "Dark");
|
||||
}
|
||||
|
||||
Brightness getBritness() {
|
||||
if (mode == "Dark") {
|
||||
return Brightness.dark;
|
||||
} else {
|
||||
return Brightness.light;
|
||||
}
|
||||
}
|
||||
|
||||
void setScreenType(double width) {
|
||||
if (width <= 800) {
|
||||
screenType = "mobile";
|
||||
} else {
|
||||
screenType = "desktop";
|
||||
}
|
||||
}
|
||||
}
|
||||
55
mih_ui/lib/mih_objects/access_request.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
class AccessRequest {
|
||||
final int idpatient_queue;
|
||||
final String business_id;
|
||||
final String app_id;
|
||||
final String date_time;
|
||||
final String access;
|
||||
final String revoke_date;
|
||||
final String Name;
|
||||
final String type;
|
||||
final String logo_path;
|
||||
final String contact_no;
|
||||
|
||||
const AccessRequest({
|
||||
required this.idpatient_queue,
|
||||
required this.business_id,
|
||||
required this.app_id,
|
||||
required this.date_time,
|
||||
required this.access,
|
||||
required this.revoke_date,
|
||||
required this.Name,
|
||||
required this.type,
|
||||
required this.logo_path,
|
||||
required this.contact_no,
|
||||
});
|
||||
|
||||
factory AccessRequest.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idpatient_queue": int idpatient_queue,
|
||||
'business_id': String business_id,
|
||||
'app_id': String app_id,
|
||||
'date_time': String date_time,
|
||||
'access': String access,
|
||||
'revoke_date': String revoke_date,
|
||||
'Name': String Name,
|
||||
'type': String type,
|
||||
'logo_path': String logo_path,
|
||||
'contact_no': String contact_no,
|
||||
} =>
|
||||
AccessRequest(
|
||||
idpatient_queue: idpatient_queue,
|
||||
business_id: business_id,
|
||||
app_id: app_id,
|
||||
date_time: date_time,
|
||||
access: access,
|
||||
revoke_date: revoke_date,
|
||||
Name: Name,
|
||||
type: type,
|
||||
logo_path: logo_path,
|
||||
contact_no: contact_no,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
38
mih_ui/lib/mih_objects/app_user.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
// ignore: file_names
|
||||
class AppUser {
|
||||
final int idUser;
|
||||
final String email;
|
||||
final String fname;
|
||||
final String lname;
|
||||
final String type;
|
||||
final String app_id;
|
||||
final String username;
|
||||
final String pro_pic_path;
|
||||
final String purpose;
|
||||
|
||||
const AppUser(
|
||||
this.idUser,
|
||||
this.email,
|
||||
this.fname,
|
||||
this.lname,
|
||||
this.type,
|
||||
this.app_id,
|
||||
this.username,
|
||||
this.pro_pic_path,
|
||||
this.purpose,
|
||||
);
|
||||
|
||||
factory AppUser.fromJson(dynamic json) {
|
||||
return AppUser(
|
||||
json['idUser'],
|
||||
json['email'],
|
||||
json['fname'],
|
||||
json['lname'],
|
||||
json['type'],
|
||||
json['app_id'],
|
||||
json['username'],
|
||||
json['pro_pic_path'],
|
||||
json['purpose'],
|
||||
);
|
||||
}
|
||||
}
|
||||
39
mih_ui/lib/mih_objects/appointment.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
class Appointment {
|
||||
final int idappointments;
|
||||
final String app_id;
|
||||
final String business_id;
|
||||
final String date_time;
|
||||
final String title;
|
||||
final String description;
|
||||
|
||||
const Appointment({
|
||||
required this.idappointments,
|
||||
required this.app_id,
|
||||
required this.business_id,
|
||||
required this.date_time,
|
||||
required this.title,
|
||||
required this.description,
|
||||
});
|
||||
|
||||
factory Appointment.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idappointments": int idappointments,
|
||||
'app_id': String app_id,
|
||||
'business_id': String business_id,
|
||||
'date_time': String date_time,
|
||||
'title': String title,
|
||||
'description': String description,
|
||||
} =>
|
||||
Appointment(
|
||||
idappointments: idappointments,
|
||||
app_id: app_id,
|
||||
business_id: business_id,
|
||||
date_time: date_time,
|
||||
title: title,
|
||||
description: description,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
263
mih_ui/lib/mih_objects/arguments.dart
Normal file
@@ -0,0 +1,263 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'app_user.dart';
|
||||
import 'business.dart';
|
||||
import 'business_user.dart';
|
||||
import 'notification.dart';
|
||||
import 'patients.dart';
|
||||
|
||||
class NotificationArguments {
|
||||
final String title;
|
||||
final String body;
|
||||
final void Function()? onTap;
|
||||
|
||||
NotificationArguments(
|
||||
this.title,
|
||||
this.body,
|
||||
this.onTap,
|
||||
);
|
||||
}
|
||||
|
||||
class BusinessArguments {
|
||||
final AppUser signedInUser;
|
||||
final BusinessUser? businessUser;
|
||||
final Business? business;
|
||||
|
||||
BusinessArguments(
|
||||
this.signedInUser,
|
||||
this.businessUser,
|
||||
this.business,
|
||||
);
|
||||
}
|
||||
|
||||
class BusinessViewArguments {
|
||||
final Business business;
|
||||
final String? startUpSearch;
|
||||
|
||||
BusinessViewArguments(
|
||||
this.business,
|
||||
this.startUpSearch,
|
||||
);
|
||||
}
|
||||
|
||||
class HomeArguments {
|
||||
final AppUser signedInUser;
|
||||
final BusinessUser? businessUser;
|
||||
final Business? business;
|
||||
final Patient? patient;
|
||||
final List<MIHNotification> notifi;
|
||||
final String profilePicUrl;
|
||||
|
||||
HomeArguments(
|
||||
this.signedInUser,
|
||||
this.businessUser,
|
||||
this.business,
|
||||
this.patient,
|
||||
this.notifi,
|
||||
this.profilePicUrl,
|
||||
);
|
||||
}
|
||||
|
||||
class AppProfileUpdateArguments {
|
||||
final AppUser signedInUser;
|
||||
final ImageProvider<Object>? propicFile;
|
||||
|
||||
AppProfileUpdateArguments(this.signedInUser, this.propicFile);
|
||||
}
|
||||
|
||||
class FileViewArguments {
|
||||
final String link;
|
||||
final String path;
|
||||
|
||||
FileViewArguments(
|
||||
this.link,
|
||||
this.path,
|
||||
);
|
||||
}
|
||||
|
||||
class PrintPreviewArguments {
|
||||
final Uint8List pdfData;
|
||||
final String fileName;
|
||||
|
||||
PrintPreviewArguments(
|
||||
this.pdfData,
|
||||
this.fileName,
|
||||
);
|
||||
}
|
||||
|
||||
class PatientViewArguments {
|
||||
final AppUser signedInUser;
|
||||
final Patient? selectedPatient;
|
||||
final BusinessUser? businessUser;
|
||||
final Business? business;
|
||||
final String type;
|
||||
|
||||
PatientViewArguments(
|
||||
this.signedInUser,
|
||||
this.selectedPatient,
|
||||
this.businessUser,
|
||||
this.business,
|
||||
this.type,
|
||||
);
|
||||
}
|
||||
|
||||
class PatientEditArguments {
|
||||
final AppUser signedInUser;
|
||||
final Patient selectedPatient;
|
||||
|
||||
PatientEditArguments(
|
||||
this.signedInUser,
|
||||
this.selectedPatient,
|
||||
);
|
||||
}
|
||||
|
||||
class ClaimStatementGenerationArguments {
|
||||
final String document_type;
|
||||
final String patient_app_id;
|
||||
final String patient_full_name;
|
||||
final String patient_id_no;
|
||||
final String has_med_aid;
|
||||
final String med_aid_no;
|
||||
final String med_aid_code;
|
||||
final String med_aid_name;
|
||||
final String med_aid_scheme;
|
||||
final String busName;
|
||||
final String busAddr;
|
||||
final String busNo;
|
||||
final String busEmail;
|
||||
final String provider_name;
|
||||
final String practice_no;
|
||||
final String vat_no;
|
||||
final String service_date;
|
||||
final String service_desc;
|
||||
final String service_desc_option;
|
||||
final String procedure_name;
|
||||
final String procedure_additional_info;
|
||||
final String icd10_code;
|
||||
final String amount;
|
||||
final String pre_auth_no;
|
||||
final String logo_path;
|
||||
final String sig_path;
|
||||
|
||||
ClaimStatementGenerationArguments(
|
||||
this.document_type,
|
||||
this.patient_app_id,
|
||||
this.patient_full_name,
|
||||
this.patient_id_no,
|
||||
this.has_med_aid,
|
||||
this.med_aid_no,
|
||||
this.med_aid_code,
|
||||
this.med_aid_name,
|
||||
this.med_aid_scheme,
|
||||
this.busName,
|
||||
this.busAddr,
|
||||
this.busNo,
|
||||
this.busEmail,
|
||||
this.provider_name,
|
||||
this.practice_no,
|
||||
this.vat_no,
|
||||
this.service_date,
|
||||
this.service_desc,
|
||||
this.service_desc_option,
|
||||
this.procedure_name,
|
||||
this.procedure_additional_info,
|
||||
this.icd10_code,
|
||||
this.amount,
|
||||
this.pre_auth_no,
|
||||
this.logo_path,
|
||||
this.sig_path,
|
||||
);
|
||||
}
|
||||
|
||||
class AuthArguments {
|
||||
final bool personalSelected;
|
||||
final bool firstBoot;
|
||||
|
||||
AuthArguments(
|
||||
this.personalSelected,
|
||||
this.firstBoot,
|
||||
);
|
||||
}
|
||||
|
||||
class CalendarArguments {
|
||||
final AppUser signedInUser;
|
||||
final bool personalSelected;
|
||||
final Business? business;
|
||||
final BusinessUser? businessUser;
|
||||
|
||||
CalendarArguments(
|
||||
this.signedInUser,
|
||||
this.personalSelected,
|
||||
this.business,
|
||||
this.businessUser,
|
||||
);
|
||||
}
|
||||
|
||||
class PatManagerArguments {
|
||||
final AppUser signedInUser;
|
||||
final bool personalSelected;
|
||||
final Business? business;
|
||||
final BusinessUser? businessUser;
|
||||
|
||||
PatManagerArguments(
|
||||
this.signedInUser,
|
||||
this.personalSelected,
|
||||
this.business,
|
||||
this.businessUser,
|
||||
);
|
||||
}
|
||||
|
||||
class WalletArguments {
|
||||
final AppUser signedInUser;
|
||||
final int index;
|
||||
|
||||
WalletArguments(
|
||||
this.signedInUser,
|
||||
this.index,
|
||||
);
|
||||
}
|
||||
|
||||
class MzansiAiArguments {
|
||||
final AppUser signedInUser;
|
||||
final String? startUpQuestion;
|
||||
final bool personalSelected;
|
||||
|
||||
MzansiAiArguments(
|
||||
this.signedInUser,
|
||||
this.startUpQuestion,
|
||||
this.personalSelected,
|
||||
);
|
||||
}
|
||||
|
||||
class MzansiDirectoryArguments {
|
||||
final bool personalSearch;
|
||||
final int? packageIndex;
|
||||
final String? startSearchText;
|
||||
|
||||
MzansiDirectoryArguments({
|
||||
required this.personalSearch,
|
||||
this.packageIndex,
|
||||
required this.startSearchText,
|
||||
});
|
||||
}
|
||||
|
||||
class AboutArguments {
|
||||
final bool personalSelected;
|
||||
final int? packageIndex;
|
||||
|
||||
AboutArguments(
|
||||
this.personalSelected,
|
||||
this.packageIndex,
|
||||
);
|
||||
}
|
||||
|
||||
class TestArguments {
|
||||
final AppUser user;
|
||||
final Business? business;
|
||||
|
||||
TestArguments(
|
||||
this.user,
|
||||
this.business,
|
||||
);
|
||||
}
|
||||
35
mih_ui/lib/mih_objects/bookmarked_business.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
class BookmarkedBusiness {
|
||||
final int idbookmarked_businesses;
|
||||
final String app_id;
|
||||
final String business_id;
|
||||
final String business_name;
|
||||
final String created_date;
|
||||
|
||||
BookmarkedBusiness({
|
||||
required this.idbookmarked_businesses,
|
||||
required this.app_id,
|
||||
required this.business_id,
|
||||
required this.business_name,
|
||||
required this.created_date,
|
||||
});
|
||||
factory BookmarkedBusiness.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idbookmarked_businesses": int idbookmarked_businesses,
|
||||
"app_id": String app_id,
|
||||
"business_id": String business_id,
|
||||
"business_name": String business_name,
|
||||
"created_date": String created_date,
|
||||
} =>
|
||||
BookmarkedBusiness(
|
||||
idbookmarked_businesses: idbookmarked_businesses,
|
||||
app_id: app_id,
|
||||
business_id: business_id,
|
||||
business_name: business_name,
|
||||
created_date: created_date,
|
||||
),
|
||||
_ => throw const FormatException(
|
||||
'Failed to load bookmarked business objects'),
|
||||
};
|
||||
}
|
||||
}
|
||||
56
mih_ui/lib/mih_objects/business.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
// ignore: file_names
|
||||
class Business {
|
||||
final String business_id;
|
||||
final String Name;
|
||||
final String type;
|
||||
final String registration_no;
|
||||
final String logo_name;
|
||||
final String logo_path;
|
||||
final String contact_no;
|
||||
final String bus_email;
|
||||
final String app_id;
|
||||
final String gps_location;
|
||||
final String practice_no;
|
||||
final String vat_no;
|
||||
final String website;
|
||||
final String rating;
|
||||
final String mission_vision;
|
||||
|
||||
const Business(
|
||||
this.business_id,
|
||||
this.Name,
|
||||
this.type,
|
||||
this.registration_no,
|
||||
this.logo_name,
|
||||
this.logo_path,
|
||||
this.contact_no,
|
||||
this.bus_email,
|
||||
this.app_id,
|
||||
this.gps_location,
|
||||
this.practice_no,
|
||||
this.vat_no,
|
||||
this.website,
|
||||
this.rating,
|
||||
this.mission_vision,
|
||||
);
|
||||
|
||||
factory Business.fromJson(dynamic json) {
|
||||
return Business(
|
||||
json['business_id'],
|
||||
json['Name'],
|
||||
json['type'],
|
||||
json['registration_no'],
|
||||
json['logo_name'],
|
||||
json['logo_path'],
|
||||
json['contact_no'],
|
||||
json['bus_email'],
|
||||
json['app_id'],
|
||||
json['gps_location'],
|
||||
json['practice_no'],
|
||||
json['vat_no'],
|
||||
json['website'],
|
||||
json['rating'],
|
||||
json['mission_vision'],
|
||||
);
|
||||
}
|
||||
}
|
||||
35
mih_ui/lib/mih_objects/business_employee.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
// ignore: file_names
|
||||
class BusinessEmployee {
|
||||
final String business_id;
|
||||
final String app_id;
|
||||
final String title;
|
||||
final String access;
|
||||
final String fname;
|
||||
final String lname;
|
||||
final String email;
|
||||
final String username;
|
||||
|
||||
const BusinessEmployee(
|
||||
this.business_id,
|
||||
this.app_id,
|
||||
this.title,
|
||||
this.access,
|
||||
this.fname,
|
||||
this.lname,
|
||||
this.email,
|
||||
this.username,
|
||||
);
|
||||
|
||||
factory BusinessEmployee.fromJson(dynamic json) {
|
||||
return BusinessEmployee(
|
||||
json['business_id'],
|
||||
json['app_id'],
|
||||
json['title'],
|
||||
json['access'],
|
||||
json['fname'],
|
||||
json['lname'],
|
||||
json['email'],
|
||||
json['username'],
|
||||
);
|
||||
}
|
||||
}
|
||||
47
mih_ui/lib/mih_objects/business_review.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
class BusinessReview {
|
||||
final int idbusiness_ratings;
|
||||
final String app_id;
|
||||
final String business_id;
|
||||
final String rating_title;
|
||||
final String rating_description;
|
||||
final String rating_score;
|
||||
final String date_time;
|
||||
final String reviewer;
|
||||
|
||||
BusinessReview({
|
||||
required this.idbusiness_ratings,
|
||||
required this.app_id,
|
||||
required this.business_id,
|
||||
required this.rating_title,
|
||||
required this.rating_description,
|
||||
required this.rating_score,
|
||||
required this.date_time,
|
||||
required this.reviewer,
|
||||
});
|
||||
factory BusinessReview.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idbusiness_ratings": int idbusiness_ratings,
|
||||
"app_id": String app_id,
|
||||
"business_id": String business_id,
|
||||
"rating_title": String rating_title,
|
||||
"rating_description": String rating_description,
|
||||
"rating_score": String rating_score,
|
||||
"date_time": String date_time,
|
||||
"reviewer": String reviewer,
|
||||
} =>
|
||||
BusinessReview(
|
||||
idbusiness_ratings: idbusiness_ratings,
|
||||
app_id: app_id,
|
||||
business_id: business_id,
|
||||
rating_title: rating_title,
|
||||
rating_description: rating_description,
|
||||
rating_score: rating_score,
|
||||
date_time: date_time,
|
||||
reviewer: reviewer,
|
||||
),
|
||||
_ =>
|
||||
throw const FormatException('Failed to load Business Review objects'),
|
||||
};
|
||||
}
|
||||
}
|
||||
32
mih_ui/lib/mih_objects/business_user.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
// ignore: file_names
|
||||
class BusinessUser {
|
||||
final int idbusiness_users;
|
||||
final String business_id;
|
||||
final String app_id;
|
||||
final String signature;
|
||||
final String sig_path;
|
||||
final String title;
|
||||
final String access;
|
||||
|
||||
const BusinessUser(
|
||||
this.idbusiness_users,
|
||||
this.business_id,
|
||||
this.app_id,
|
||||
this.signature,
|
||||
this.sig_path,
|
||||
this.title,
|
||||
this.access,
|
||||
);
|
||||
|
||||
factory BusinessUser.fromJson(dynamic json) {
|
||||
return BusinessUser(
|
||||
json['idbusiness_users'],
|
||||
json['business_id'],
|
||||
json['app_id'],
|
||||
json['signature'],
|
||||
json['sig_path'],
|
||||
json['title'],
|
||||
json['access'],
|
||||
);
|
||||
}
|
||||
}
|
||||
40
mih_ui/lib/mih_objects/claim_statement_file.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
class ClaimStatementFile {
|
||||
final int idclaim_statement_file;
|
||||
final String app_id;
|
||||
final String business_id;
|
||||
final String insert_date;
|
||||
final String file_path;
|
||||
final String file_name;
|
||||
|
||||
const ClaimStatementFile({
|
||||
required this.idclaim_statement_file,
|
||||
required this.app_id,
|
||||
required this.business_id,
|
||||
required this.insert_date,
|
||||
required this.file_path,
|
||||
required this.file_name,
|
||||
});
|
||||
|
||||
factory ClaimStatementFile.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idclaim_statement_file": int idclaim_statement_file,
|
||||
'app_id': String app_id,
|
||||
'business_id': String business_id,
|
||||
'insert_date': String insert_date,
|
||||
'file_path': String file_path,
|
||||
'file_name': String file_name,
|
||||
} =>
|
||||
ClaimStatementFile(
|
||||
idclaim_statement_file: idclaim_statement_file,
|
||||
app_id: app_id,
|
||||
business_id: business_id,
|
||||
insert_date: insert_date,
|
||||
file_path: file_path,
|
||||
file_name: file_name,
|
||||
),
|
||||
_ =>
|
||||
throw const FormatException('Failed to load Claim Statement Object.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
23
mih_ui/lib/mih_objects/currency.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
class Currency {
|
||||
final String code;
|
||||
final String name;
|
||||
|
||||
const Currency({
|
||||
required this.code,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory Currency.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"code": String code,
|
||||
'name': String name,
|
||||
} =>
|
||||
Currency(
|
||||
code: code,
|
||||
name: name,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load Currency object.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class EditScreenArguments {
|
||||
final String useremail;
|
||||
final String selectedPatient;
|
||||
|
||||
EditScreenArguments({required this.useremail, required this.selectedPatient});
|
||||
}
|
||||
25
mih_ui/lib/mih_objects/files.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
class PFile {
|
||||
final int idpatient_files;
|
||||
final String file_path;
|
||||
final String file_name;
|
||||
final String insert_date;
|
||||
final String app_id;
|
||||
|
||||
const PFile(
|
||||
this.idpatient_files,
|
||||
this.file_path,
|
||||
this.file_name,
|
||||
this.insert_date,
|
||||
this.app_id,
|
||||
);
|
||||
|
||||
factory PFile.fromJson(dynamic json) {
|
||||
return PFile(
|
||||
json['idpatient_files'],
|
||||
json['file_path'],
|
||||
json['file_name'],
|
||||
json['insert_date'],
|
||||
json['app_id'],
|
||||
);
|
||||
}
|
||||
}
|
||||
23
mih_ui/lib/mih_objects/icd10_code.dart.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
class ICD10Code {
|
||||
final String icd10;
|
||||
final String description;
|
||||
|
||||
const ICD10Code({
|
||||
required this.icd10,
|
||||
required this.description,
|
||||
});
|
||||
|
||||
factory ICD10Code.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"icd10": String icd10,
|
||||
'description': String description,
|
||||
} =>
|
||||
ICD10Code(
|
||||
icd10: icd10,
|
||||
description: description,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load icd10 code object.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
43
mih_ui/lib/mih_objects/loyalty_card.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
class MIHLoyaltyCard {
|
||||
final int idloyalty_cards;
|
||||
final String app_id;
|
||||
final String shop_name;
|
||||
final String card_number;
|
||||
final String favourite;
|
||||
final int priority_index;
|
||||
final String nickname;
|
||||
|
||||
const MIHLoyaltyCard({
|
||||
required this.idloyalty_cards,
|
||||
required this.app_id,
|
||||
required this.shop_name,
|
||||
required this.card_number,
|
||||
required this.favourite,
|
||||
required this.priority_index,
|
||||
required this.nickname,
|
||||
});
|
||||
|
||||
factory MIHLoyaltyCard.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idloyalty_cards": int idloyalty_cards,
|
||||
"app_id": String app_id,
|
||||
"shop_name": String shop_name,
|
||||
"card_number": String card_number,
|
||||
"favourite": String favourite,
|
||||
"priority_index": int priority_index,
|
||||
"nickname": String nickname,
|
||||
} =>
|
||||
MIHLoyaltyCard(
|
||||
idloyalty_cards: idloyalty_cards,
|
||||
app_id: app_id,
|
||||
shop_name: shop_name,
|
||||
card_number: card_number,
|
||||
favourite: favourite,
|
||||
priority_index: priority_index,
|
||||
nickname: nickname,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load loyalty card objects'),
|
||||
};
|
||||
}
|
||||
}
|
||||
19
mih_ui/lib/mih_objects/medicine.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
class Medicine {
|
||||
final String name;
|
||||
final String unit;
|
||||
final String form;
|
||||
|
||||
const Medicine(
|
||||
this.name,
|
||||
this.unit,
|
||||
this.form,
|
||||
);
|
||||
|
||||
factory Medicine.fromJson(dynamic json) {
|
||||
return Medicine(
|
||||
json['name'],
|
||||
json['unit'],
|
||||
json['dosage form'],
|
||||
);
|
||||
}
|
||||
}
|
||||
42
mih_ui/lib/mih_objects/minesweeper_player_score.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
class MinesweeperPlayerScore {
|
||||
String app_id;
|
||||
String username;
|
||||
String proPicUrl;
|
||||
String difficulty;
|
||||
String game_time;
|
||||
double game_score;
|
||||
DateTime played_date;
|
||||
|
||||
MinesweeperPlayerScore({
|
||||
required this.app_id,
|
||||
required this.username,
|
||||
required this.proPicUrl,
|
||||
required this.difficulty,
|
||||
required this.game_time,
|
||||
required this.game_score,
|
||||
required this.played_date,
|
||||
});
|
||||
|
||||
factory MinesweeperPlayerScore.fromJson(Map<String, dynamic> json) {
|
||||
return MinesweeperPlayerScore(
|
||||
app_id: json['app_id'],
|
||||
username: json['username'],
|
||||
proPicUrl: json['proPicUrl'],
|
||||
difficulty: json['difficulty'],
|
||||
game_time: json['game_time'],
|
||||
game_score: json['game_score'],
|
||||
played_date: DateTime.parse(json['played_date']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'app_id': app_id,
|
||||
'username': username,
|
||||
'proPicUrl': proPicUrl,
|
||||
'difficulty': difficulty,
|
||||
'game_time': game_score,
|
||||
'played_date': played_date.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
43
mih_ui/lib/mih_objects/notes.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
class Note {
|
||||
final int idpatient_notes;
|
||||
final String note_name;
|
||||
final String note_text;
|
||||
final String insert_date;
|
||||
final String doc_office;
|
||||
final String doctor;
|
||||
final String app_id;
|
||||
|
||||
const Note({
|
||||
required this.idpatient_notes,
|
||||
required this.note_name,
|
||||
required this.note_text,
|
||||
required this.insert_date,
|
||||
required this.doc_office,
|
||||
required this.doctor,
|
||||
required this.app_id,
|
||||
});
|
||||
|
||||
factory Note.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idpatient_notes": int idpatient_notes,
|
||||
"note_name": String note_name,
|
||||
"note_text": String note_text,
|
||||
"insert_date": String insert_date,
|
||||
"doc_office": String doc_office,
|
||||
"doctor": String doctor,
|
||||
"app_id": String app_id,
|
||||
} =>
|
||||
Note(
|
||||
idpatient_notes: idpatient_notes,
|
||||
note_name: note_name,
|
||||
note_text: note_text,
|
||||
insert_date: insert_date,
|
||||
doc_office: doc_office,
|
||||
doctor: doctor,
|
||||
app_id: app_id,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
43
mih_ui/lib/mih_objects/notification.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
class MIHNotification {
|
||||
final int idnotifications;
|
||||
final String app_id;
|
||||
final String notification_message;
|
||||
final String notification_read;
|
||||
final String action_path;
|
||||
final String insert_date;
|
||||
final String notification_type;
|
||||
|
||||
const MIHNotification({
|
||||
required this.idnotifications,
|
||||
required this.app_id,
|
||||
required this.notification_message,
|
||||
required this.notification_read,
|
||||
required this.action_path,
|
||||
required this.insert_date,
|
||||
required this.notification_type,
|
||||
});
|
||||
|
||||
factory MIHNotification.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idnotifications": int idnotifications,
|
||||
"app_id": String app_id,
|
||||
"notification_message": String notification_message,
|
||||
"notification_read": String notification_read,
|
||||
"action_path": String action_path,
|
||||
"insert_date": String insert_date,
|
||||
"notification_type": String notification_type,
|
||||
} =>
|
||||
MIHNotification(
|
||||
idnotifications: idnotifications,
|
||||
app_id: app_id,
|
||||
notification_message: notification_message,
|
||||
notification_read: notification_read,
|
||||
action_path: action_path,
|
||||
insert_date: insert_date,
|
||||
notification_type: notification_type,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load Notifications.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
63
mih_ui/lib/mih_objects/patient_access.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
class PatientAccess {
|
||||
final String business_id;
|
||||
final String business_name;
|
||||
final String app_id;
|
||||
final String fname;
|
||||
final String lname;
|
||||
final String id_no;
|
||||
final String type;
|
||||
final String status;
|
||||
final String approved_by;
|
||||
final String approved_on;
|
||||
final String requested_by;
|
||||
final String requested_on;
|
||||
|
||||
const PatientAccess({
|
||||
required this.business_id,
|
||||
required this.business_name,
|
||||
required this.app_id,
|
||||
required this.fname,
|
||||
required this.lname,
|
||||
required this.id_no,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.approved_by,
|
||||
required this.approved_on,
|
||||
required this.requested_by,
|
||||
required this.requested_on,
|
||||
});
|
||||
|
||||
factory PatientAccess.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"business_id": String business_id,
|
||||
'business_name': String business_name,
|
||||
'app_id': String app_id,
|
||||
'fname': String fname,
|
||||
'lname': String lname,
|
||||
'id_no': String id_no,
|
||||
'type': String type,
|
||||
'status': String status,
|
||||
'approved_by': String approved_by,
|
||||
'approved_on': String approved_on,
|
||||
'requested_by': String requested_by,
|
||||
'requested_on': String requested_on,
|
||||
} =>
|
||||
PatientAccess(
|
||||
business_id: business_id,
|
||||
business_name: business_name,
|
||||
app_id: app_id,
|
||||
fname: fname,
|
||||
lname: lname,
|
||||
id_no: id_no,
|
||||
type: type,
|
||||
status: status,
|
||||
approved_by: approved_by,
|
||||
approved_on: approved_on,
|
||||
requested_by: requested_by,
|
||||
requested_on: requested_on,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load Patient Access List.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
51
mih_ui/lib/mih_objects/patient_queue.dart
Normal file
@@ -0,0 +1,51 @@
|
||||
class PatientQueue {
|
||||
final int idpatient_queue;
|
||||
final String business_id;
|
||||
final String app_id;
|
||||
final String date_time;
|
||||
final String id_no;
|
||||
final String first_name;
|
||||
final String last_name;
|
||||
final String medical_aid_no;
|
||||
final String business_name;
|
||||
|
||||
const PatientQueue({
|
||||
required this.idpatient_queue,
|
||||
required this.business_id,
|
||||
required this.app_id,
|
||||
required this.date_time,
|
||||
required this.id_no,
|
||||
required this.first_name,
|
||||
required this.last_name,
|
||||
required this.medical_aid_no,
|
||||
required this.business_name,
|
||||
});
|
||||
|
||||
factory PatientQueue.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idpatient_queue": int idpatient_queue,
|
||||
'business_id': String business_id,
|
||||
'app_id': String app_id,
|
||||
'date_time': String date_time,
|
||||
'id_no': String id_no,
|
||||
'first_name': String first_name,
|
||||
'last_name': String last_name,
|
||||
'medical_aid_no': String medical_aid_no,
|
||||
'business_name': String business_name,
|
||||
} =>
|
||||
PatientQueue(
|
||||
idpatient_queue: idpatient_queue,
|
||||
business_id: business_id,
|
||||
app_id: app_id,
|
||||
date_time: date_time,
|
||||
id_no: id_no,
|
||||
first_name: first_name,
|
||||
last_name: last_name,
|
||||
medical_aid_no: medical_aid_no,
|
||||
business_name: business_name,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
75
mih_ui/lib/mih_objects/patients.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
class Patient {
|
||||
final int idpatients;
|
||||
final String id_no;
|
||||
final String first_name;
|
||||
final String last_name;
|
||||
final String email;
|
||||
final String cell_no;
|
||||
final String medical_aid;
|
||||
final String medical_aid_name;
|
||||
final String medical_aid_no;
|
||||
final String medical_aid_main_member;
|
||||
final String medical_aid_code;
|
||||
final String medical_aid_scheme;
|
||||
final String address;
|
||||
final String app_id;
|
||||
|
||||
const Patient({
|
||||
required this.idpatients,
|
||||
required this.id_no,
|
||||
required this.first_name,
|
||||
required this.last_name,
|
||||
required this.email,
|
||||
required this.cell_no,
|
||||
required this.medical_aid,
|
||||
required this.medical_aid_name,
|
||||
required this.medical_aid_no,
|
||||
required this.medical_aid_main_member,
|
||||
required this.medical_aid_code,
|
||||
required this.medical_aid_scheme,
|
||||
required this.address,
|
||||
required this.app_id,
|
||||
});
|
||||
|
||||
factory Patient.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"idpatients": int idpatients,
|
||||
'id_no': String id_no,
|
||||
'first_name': String first_name,
|
||||
'last_name': String last_name,
|
||||
'email': String email,
|
||||
'cell_no': String cell_no,
|
||||
'medical_aid': String medical_aid,
|
||||
'medical_aid_name': String medical_aid_name,
|
||||
'medical_aid_no': String medical_aid_no,
|
||||
'medical_aid_main_member': String medical_aid_main_member,
|
||||
'medical_aid_code': String medical_aid_code,
|
||||
'medical_aid_scheme': String medical_aid_scheme,
|
||||
'address': String address,
|
||||
'app_id': String app_id,
|
||||
} =>
|
||||
Patient(
|
||||
idpatients: idpatients,
|
||||
id_no: id_no,
|
||||
first_name: first_name,
|
||||
last_name: last_name,
|
||||
email: email,
|
||||
cell_no: cell_no,
|
||||
medical_aid: medical_aid,
|
||||
medical_aid_name: medical_aid_name,
|
||||
medical_aid_no: medical_aid_no,
|
||||
medical_aid_main_member: medical_aid_main_member,
|
||||
medical_aid_code: medical_aid_code,
|
||||
medical_aid_scheme: medical_aid_scheme,
|
||||
address: address,
|
||||
app_id: app_id,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
|
||||
String getIDNum() {
|
||||
return id_no;
|
||||
}
|
||||
}
|
||||
65
mih_ui/lib/mih_objects/perscription.dart
Normal file
@@ -0,0 +1,65 @@
|
||||
class Perscription {
|
||||
final String name;
|
||||
final String unit;
|
||||
final String form;
|
||||
final String fullForm;
|
||||
final String quantity;
|
||||
final String dosage;
|
||||
final String times;
|
||||
final String days;
|
||||
final String repeats;
|
||||
|
||||
const Perscription({
|
||||
required this.name,
|
||||
required this.unit,
|
||||
required this.form,
|
||||
required this.fullForm,
|
||||
required this.quantity,
|
||||
required this.dosage,
|
||||
required this.times,
|
||||
required this.days,
|
||||
required this.repeats,
|
||||
});
|
||||
|
||||
factory Perscription.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
"name": String name,
|
||||
'unit': String unit,
|
||||
'form': String form,
|
||||
'fullForm': String fullForm,
|
||||
'quantity': String quantity,
|
||||
'dosage': String dosage,
|
||||
'times': String times,
|
||||
'days': String days,
|
||||
'repeats': String repeats,
|
||||
} =>
|
||||
Perscription(
|
||||
name: name,
|
||||
unit: unit,
|
||||
form: form,
|
||||
fullForm: fullForm,
|
||||
quantity: quantity,
|
||||
dosage: dosage,
|
||||
times: times,
|
||||
days: days,
|
||||
repeats: repeats,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load album.'),
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
"name": name,
|
||||
'unit': unit,
|
||||
'form': form,
|
||||
'fullForm': fullForm,
|
||||
'quantity': quantity,
|
||||
'dosage': dosage,
|
||||
'times': times,
|
||||
'days': days,
|
||||
'repeats': repeats,
|
||||
};
|
||||
}
|
||||
}
|
||||
35
mih_ui/lib/mih_objects/profile_link.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
class ProfileLink {
|
||||
final int idprofile_links;
|
||||
final String app_id;
|
||||
final String business_id;
|
||||
final String destination;
|
||||
final String web_link;
|
||||
|
||||
const ProfileLink({
|
||||
required this.idprofile_links,
|
||||
required this.app_id,
|
||||
required this.business_id,
|
||||
required this.destination,
|
||||
required this.web_link,
|
||||
});
|
||||
|
||||
factory ProfileLink.fromJson(Map<String, dynamic> json) {
|
||||
return ProfileLink(
|
||||
idprofile_links: json['idprofile_links'],
|
||||
app_id: json['app_id'],
|
||||
business_id: json['business_id'],
|
||||
destination: json['destination'],
|
||||
web_link: json['web_link'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'idprofile_links': idprofile_links,
|
||||
'app_id': app_id,
|
||||
'business_id': business_id,
|
||||
'destination': destination,
|
||||
'web_link': web_link,
|
||||
};
|
||||
}
|
||||
}
|
||||
23
mih_ui/lib/mih_objects/session_st.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
class SessionST {
|
||||
final String status;
|
||||
final bool exists;
|
||||
|
||||
const SessionST({
|
||||
required this.status,
|
||||
required this.exists,
|
||||
});
|
||||
|
||||
factory SessionST.fromJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'status': String status,
|
||||
'exists': bool exists,
|
||||
} =>
|
||||
SessionST(
|
||||
status: status,
|
||||
exists: exists,
|
||||
),
|
||||
_ => throw const FormatException('Failed to load SessionST.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
29
mih_ui/lib/mih_objects/user_consent.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class UserConsent {
|
||||
String app_id;
|
||||
DateTime privacy_policy_accepted;
|
||||
DateTime terms_of_services_accepted;
|
||||
|
||||
UserConsent({
|
||||
required this.app_id,
|
||||
required this.privacy_policy_accepted,
|
||||
required this.terms_of_services_accepted,
|
||||
});
|
||||
|
||||
factory UserConsent.fromJson(Map<String, dynamic> json) {
|
||||
return UserConsent(
|
||||
app_id: json['app_id'],
|
||||
privacy_policy_accepted: DateTime.parse(json['privacy_policy_accepted']),
|
||||
terms_of_services_accepted:
|
||||
DateTime.parse(json['terms_of_services_accepted']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'app_id': app_id,
|
||||
'privacy_policy_accepted': privacy_policy_accepted.toIso8601String(),
|
||||
'terms_of_services_accepted':
|
||||
terms_of_services_accepted.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
154
mih_ui/lib/mih_package_components/Example/package_test.dart
Normal file
@@ -0,0 +1,154 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_three.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_zero.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_one.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_two.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_data_helper_services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PackageTest extends StatefulWidget {
|
||||
const PackageTest({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<PackageTest> createState() => _PackageTestState();
|
||||
}
|
||||
|
||||
class _PackageTestState extends State<PackageTest> {
|
||||
int _selcetedIndex = 0;
|
||||
bool _isLoadingInitialData = true;
|
||||
|
||||
Future<void> _loadInitialData() async {
|
||||
setState(() {
|
||||
_isLoadingInitialData = true;
|
||||
});
|
||||
MzansiProfileProvider mzansiProfileProvider =
|
||||
context.read<MzansiProfileProvider>();
|
||||
if (mzansiProfileProvider.user == null) {
|
||||
await MihDataHelperServices().loadUserDataWithBusinessesData(
|
||||
mzansiProfileProvider,
|
||||
);
|
||||
}
|
||||
setState(() {
|
||||
_isLoadingInitialData = false;
|
||||
});
|
||||
}
|
||||
|
||||
MihPackageAction getAction() {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
'mihHome',
|
||||
extra: true,
|
||||
);
|
||||
FocusScope.of(context).unfocus();
|
||||
// Navigator.of(context).pop();
|
||||
// Navigator.of(context).popAndPushNamed(
|
||||
// '/',
|
||||
// arguments: AuthArguments(true, false),
|
||||
// );
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = Map();
|
||||
temp[const Icon(Icons.link)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.warning)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 1;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.inbox)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 2;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.outbond)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 3;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
);
|
||||
}
|
||||
|
||||
void showAlert() {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
|
||||
List<Widget> getToolBody() {
|
||||
MzansiProfileProvider profileProvider =
|
||||
context.read<MzansiProfileProvider>();
|
||||
List<Widget> toolBodies = [
|
||||
const PackageToolThree(),
|
||||
const PackageToolZero(),
|
||||
PackageToolOne(
|
||||
user: profileProvider.user!,
|
||||
business: profileProvider.business,
|
||||
),
|
||||
const PackageToolTwo(),
|
||||
];
|
||||
return toolBodies;
|
||||
}
|
||||
|
||||
List<String> getToolTitle() {
|
||||
List<String> toolTitles = [
|
||||
"Tool Zero",
|
||||
"Tool One",
|
||||
"Tool Two",
|
||||
];
|
||||
return toolTitles;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadInitialData();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<MzansiProfileProvider>(
|
||||
builder:
|
||||
(BuildContext context, MzansiProfileProvider value, Widget? child) {
|
||||
if (_isLoadingInitialData) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Mihloadingcircle(),
|
||||
),
|
||||
);
|
||||
}
|
||||
return MihPackage(
|
||||
appActionButton: getAction(),
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
});
|
||||
print("Index: $_selcetedIndex");
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class TestPackageTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
const TestPackageTile({
|
||||
super.key,
|
||||
required this.packageSize,
|
||||
});
|
||||
|
||||
@override
|
||||
State<TestPackageTile> createState() => _TestPackageTileState();
|
||||
}
|
||||
|
||||
class _TestPackageTileState extends State<TestPackageTile> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageTile(
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
'testPackage',
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// '/package-dev',
|
||||
// arguments: TestArguments(
|
||||
// widget.signedInUser,
|
||||
// widget.business,
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
appName: "Test",
|
||||
appIcon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
iconSize: widget.packageSize,
|
||||
textColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,881 @@
|
||||
import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_banner_ad.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_business_info_card.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_location_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_date_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_dropdwn_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_numeric_stepper.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_image_display.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_radio_options.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_search_bar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_text_form_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_time_field.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_toggle.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
|
||||
class PackageToolOne extends StatefulWidget {
|
||||
final AppUser user;
|
||||
final Business? business;
|
||||
const PackageToolOne({
|
||||
super.key,
|
||||
required this.user,
|
||||
required this.business,
|
||||
});
|
||||
|
||||
@override
|
||||
State<PackageToolOne> createState() => _PackageToolOneState();
|
||||
}
|
||||
|
||||
class _PackageToolOneState extends State<PackageToolOne> {
|
||||
late ImageProvider<Object>? imagePreview;
|
||||
PlatformFile? file;
|
||||
PlatformFile? imageFile;
|
||||
TextEditingController _fileNameController = TextEditingController();
|
||||
TextEditingController _imagefileController = TextEditingController();
|
||||
TextEditingController _searchController = TextEditingController();
|
||||
TextEditingController _textFieldZeroController = TextEditingController();
|
||||
TextEditingController _textFieldOneController = TextEditingController();
|
||||
TextEditingController _textFieldTwoController = TextEditingController();
|
||||
TextEditingController _textFieldThreeController = TextEditingController();
|
||||
TextEditingController _textFieldFourController = TextEditingController();
|
||||
TextEditingController _textFieldFiveController = TextEditingController();
|
||||
TextEditingController _textFieldSixController = TextEditingController();
|
||||
TextEditingController _textFieldSevenController = TextEditingController();
|
||||
TextEditingController _textFieldEightController = TextEditingController();
|
||||
TextEditingController _textFieldNineController = TextEditingController();
|
||||
bool switchpositioin = true;
|
||||
final FocusNode searchFocusNode = FocusNode();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
late Future<Position?> myCoordinates;
|
||||
String myLocation = "";
|
||||
|
||||
void showTestFullWindow() {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihPackageWindow(
|
||||
fullscreen: true,
|
||||
windowTitle: "Test Full",
|
||||
onWindowTapClose: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
windowBody: Text("Testing Window Body"),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void showTestWindow() {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
borderOn: true,
|
||||
foregroundColor: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
windowTitle: "Test No Full",
|
||||
menuOptions: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
label: "Show New Window",
|
||||
labelBackgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
labelStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
onTap: () {
|
||||
// showTestWindow();
|
||||
},
|
||||
),
|
||||
],
|
||||
onWindowTapClose: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
windowBody: Text(
|
||||
"Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body Testing Window Body "),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double screenWidth = MediaQuery.of(context).size.width;
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(screenWidth),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_fileNameController.dispose();
|
||||
_imagefileController.dispose();
|
||||
_searchController.dispose();
|
||||
searchFocusNode.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
setState(() {
|
||||
imagePreview = null;
|
||||
});
|
||||
}
|
||||
|
||||
Widget getBody(double width) {
|
||||
return Stack(
|
||||
children: [
|
||||
MihSingleChildScroll(
|
||||
child: Padding(
|
||||
padding:
|
||||
MzansiInnovationHub.of(context)!.theme.screenType == "desktop"
|
||||
? EdgeInsets.symmetric(horizontal: width * 0.2)
|
||||
: EdgeInsets.symmetric(horizontal: width * 0.075),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Hello",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Center(
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
KenLogger.success("Successfully tested");
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Success Logger",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Center(
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
KenLogger.error("Successfully tested");
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Error Logger",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Center(
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
KenLogger.warning("Successfully tested");
|
||||
},
|
||||
buttonColor: MihColors.getOrangeColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Warning Logger",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Center(
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
KenLogger.info("Successfully tested");
|
||||
},
|
||||
buttonColor: MihColors.getBluishPurpleColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Info Logger",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
CountryCodePicker(
|
||||
padding: EdgeInsetsGeometry.all(0),
|
||||
onChanged: (selectedCode) {
|
||||
debugPrint("Selected Country Code: $selectedCode");
|
||||
},
|
||||
initialSelection: '+27',
|
||||
showDropDownButton: false,
|
||||
pickerStyle: PickerStyle.bottomSheet,
|
||||
dialogBackgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
barrierColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Center(
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const Mihloadingcircle(
|
||||
message: "Getting your profile data",
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Show Loading",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Personal Preview",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
// MihPersonalProfilePreview(
|
||||
// user: widget.user,
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Business Preview",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
FutureBuilder(
|
||||
future: MIHLocationAPI().getGPSPosition(context),
|
||||
builder: (context, asyncSnapshot) {
|
||||
// print(asyncSnapshot.connectionState);
|
||||
if (asyncSnapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
// return MihBusinessProfilePreview(
|
||||
// business: widget.business,
|
||||
// myLocation: null,
|
||||
// ).redacted(
|
||||
// context: context,
|
||||
// redact: true,
|
||||
// );
|
||||
return Container(
|
||||
width: 150,
|
||||
height: 50,
|
||||
// color: Colors.black,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
} else if (asyncSnapshot.hasError ||
|
||||
!asyncSnapshot.hasData ||
|
||||
asyncSnapshot.data == null) {
|
||||
return Container(
|
||||
width: 150,
|
||||
height: 50,
|
||||
color: Colors.red,
|
||||
child: Center(child: Text("Location unavailable")),
|
||||
);
|
||||
} else {
|
||||
// final myLocation = asyncSnapshot.data
|
||||
// .toString()
|
||||
// .replaceAll("Latitude: ", "")
|
||||
// .replaceAll("Longitude: ", "");
|
||||
// print("My Location is this: $myLocation");
|
||||
// return widget.business != null
|
||||
// ? MihBusinessProfilePreview(
|
||||
// business: widget.business!,
|
||||
// )
|
||||
return Text("NoBusiness Data");
|
||||
}
|
||||
}),
|
||||
// const SizedBox(height: 10),
|
||||
// Text("This text should be redacted").redacted(
|
||||
// context: context,
|
||||
// redact: true,
|
||||
// ),
|
||||
MihBusinessCard(
|
||||
business: Business(
|
||||
"business_id",
|
||||
"Name",
|
||||
"type",
|
||||
"registration_no",
|
||||
"logo_name",
|
||||
"logo_path",
|
||||
"+27812345679",
|
||||
"bus_email",
|
||||
"app_id",
|
||||
"gps_location",
|
||||
"practice_no",
|
||||
"vat_no",
|
||||
"website",
|
||||
"rating",
|
||||
"mission_vision",
|
||||
),
|
||||
// startUpSearch: '',
|
||||
width: 300,
|
||||
).redacted(
|
||||
context: context,
|
||||
redact: true,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
thickness: 2,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Ad Test",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
MihBannerAd(),
|
||||
const SizedBox(height: 10),
|
||||
Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
thickness: 2,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihForm(
|
||||
formKey: _formKey,
|
||||
formFields: [
|
||||
MihTextFormField(
|
||||
width: 200,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
controller: _textFieldZeroController,
|
||||
multiLineInput: false,
|
||||
requiredText: false,
|
||||
hintText: "Username",
|
||||
validator: (value) {
|
||||
return MihValidationServices().validateUsername(value);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTextFormField(
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
controller: _textFieldOneController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
hintText: "Email",
|
||||
autofillHints: [AutofillHints.email],
|
||||
validator: (value) {
|
||||
return MihValidationServices().validateEmail(value);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTextFormField(
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
controller: _textFieldTwoController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
hintText: "Password",
|
||||
passwordMode: true,
|
||||
autofillHints: [AutofillHints.password],
|
||||
validator: (value) {
|
||||
return MihValidationServices().validatePassword(value);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTextFormField(
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
controller: _textFieldThreeController,
|
||||
multiLineInput: false,
|
||||
requiredText: true,
|
||||
hintText: "Numbers Only",
|
||||
numberMode: true,
|
||||
validator: (value) => value == null || value.isEmpty
|
||||
? 'This Field is required'
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihNumericStepper(
|
||||
controller: _textFieldFiveController,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
hintText: "Number Stepper",
|
||||
requiredText: true,
|
||||
minValue: 1,
|
||||
maxValue: 5,
|
||||
validationOn: true,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihToggle(
|
||||
hintText: "Toggle",
|
||||
initialPostion: switchpositioin,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
secondaryFillColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
readOnly: false,
|
||||
onChange: (value) {
|
||||
setState(() {
|
||||
switchpositioin = value;
|
||||
});
|
||||
print("Toggle Value: $switchpositioin");
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihRadioOptions(
|
||||
controller: _textFieldSixController,
|
||||
hintText: "Radio Options",
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
secondaryFillColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
requiredText: true,
|
||||
radioOptions: const ["Option 1", "Option 2"],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihDropdownField(
|
||||
controller: _textFieldNineController,
|
||||
hintText: "Dropdown",
|
||||
dropdownOptions: const [
|
||||
"Option 1",
|
||||
"Option 2",
|
||||
"Option 3",
|
||||
],
|
||||
editable: true,
|
||||
enableSearch: true,
|
||||
validator: (value) {
|
||||
return MihValidationServices().isEmpty(value);
|
||||
},
|
||||
requiredText: true,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihDateField(
|
||||
controller: _textFieldSevenController,
|
||||
labelText: "Date Field",
|
||||
required: true,
|
||||
validator: (value) {
|
||||
return MihValidationServices().isEmpty(value);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTimeField(
|
||||
controller: _textFieldEightController,
|
||||
labelText: "Time Field",
|
||||
required: true,
|
||||
validator: (value) {
|
||||
return MihValidationServices().isEmpty(value);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTextFormField(
|
||||
height: 250,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
controller: _textFieldFourController,
|
||||
multiLineInput: true,
|
||||
requiredText: false,
|
||||
hintText: "Enter Multi Line Text",
|
||||
validator: (value) {
|
||||
return MihValidationServices()
|
||||
.validateLength(_textFieldFourController.text, 50);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
// Process data
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text("Input Valid")),
|
||||
);
|
||||
} else {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
}
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Submit Form",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Divider(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
thickness: 2,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihSearchBar(
|
||||
controller: _searchController,
|
||||
hintText: "Ask Mzansi",
|
||||
// prefixIcon: Icons.search,
|
||||
prefixIcon: Icons.search,
|
||||
prefixAltIcon: MihIcons.mzansiAi,
|
||||
width: 300,
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
hintColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
onPrefixIconTap: () {
|
||||
print("Search Icon Pressed: ${_searchController.text}");
|
||||
},
|
||||
searchFocusNode: searchFocusNode,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
print("Button Pressed");
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Click Me",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
print("Button Pressed");
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.delete,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
Text(
|
||||
"Click Me",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
print("Button Pressed");
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Click Me",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
color: Colors.black,
|
||||
width: 200,
|
||||
height: 200,
|
||||
padding: EdgeInsets.zero,
|
||||
alignment: Alignment.center,
|
||||
child: IconButton.filled(
|
||||
onPressed: () {},
|
||||
icon: Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihCircleAvatar(
|
||||
imageFile: imagePreview,
|
||||
width: 50,
|
||||
editable: false,
|
||||
fileNameController: _fileNameController,
|
||||
userSelectedfile: file,
|
||||
frameColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
onChange: (selectedImage) {
|
||||
setState(() {
|
||||
file = selectedImage;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTextFormField(
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
controller: _fileNameController,
|
||||
hintText: "Selected Avatar File",
|
||||
requiredText: false,
|
||||
readOnly: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihImageDisplay(
|
||||
imageFile: imagePreview,
|
||||
width: 300,
|
||||
height: 200,
|
||||
editable: true,
|
||||
fileNameController: _imagefileController,
|
||||
userSelectedfile: imageFile,
|
||||
onChange: (selectedFile) {
|
||||
setState(() {
|
||||
imageFile = selectedFile;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihTextFormField(
|
||||
fillColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
inputColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
controller: _imagefileController,
|
||||
hintText: "Selected Image File",
|
||||
requiredText: false,
|
||||
readOnly: false,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: MihFloatingMenu(
|
||||
animatedIcon: AnimatedIcons.menu_close,
|
||||
children: [
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
label: "Show New Window",
|
||||
labelBackgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
labelStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
onTap: () {
|
||||
showTestWindow();
|
||||
},
|
||||
),
|
||||
SpeedDialChild(
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
label: "Show New Full Window",
|
||||
labelBackgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
labelStyle: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
onTap: () {
|
||||
showTestFullWindow();
|
||||
},
|
||||
),
|
||||
]),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_profile_links.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
|
||||
class PackageToolThree extends StatefulWidget {
|
||||
const PackageToolThree({super.key});
|
||||
|
||||
@override
|
||||
State<PackageToolThree> createState() => _PackageToolThreeState();
|
||||
}
|
||||
|
||||
class _PackageToolThreeState extends State<PackageToolThree> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getBody() {
|
||||
List<ProfileLink> links = [
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Youtube",
|
||||
web_link: "https://www.youtube.com/@MzansiInnovationHub",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Threads",
|
||||
web_link: "https://www.threads.com/@mzansi.innovation.hub",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "TikTok",
|
||||
web_link: "https://www.tiktok.com/@mzansiinnovationhub",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "WhatsApp",
|
||||
web_link: "https://whatsapp.com/channel/0029Vax3INCIyPtMn8KgeM2F",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Twitch",
|
||||
web_link: "https://www.twitch.tv/mzansiinnovationhub",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Instagram",
|
||||
web_link: "https://www.instagram.com/mzansi.innovation.hub/",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "X",
|
||||
web_link: "https://x.com/mzansi_inno_hub",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "LinkedIn",
|
||||
web_link: "https://www.linkedin.com/in/yasien-meth-172352108/",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Facebook",
|
||||
web_link: "https://www.facebook.com/profile.php?id=61565345762136",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Reddit",
|
||||
web_link: "https://www.reddit.com/r/Mzani_Innovation_Hub/",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "Discord",
|
||||
web_link: "https://discord.gg/ZtTZYd5d",
|
||||
),
|
||||
ProfileLink(
|
||||
idprofile_links: 1,
|
||||
app_id: "1234",
|
||||
business_id: "",
|
||||
destination: "My App",
|
||||
web_link: "https://app.mzansi-innovation-hub.co.za/about",
|
||||
),
|
||||
];
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
MihSingleChildScroll(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
MihProfileLinks(
|
||||
links: links,
|
||||
// links: [],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import 'package:custom_rating_bar/custom_rating_bar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class PackageToolTwo extends StatefulWidget {
|
||||
const PackageToolTwo({super.key});
|
||||
|
||||
@override
|
||||
State<PackageToolTwo> createState() => _PackageToolTwoState();
|
||||
}
|
||||
|
||||
class _PackageToolTwoState extends State<PackageToolTwo> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getBody() {
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
"World",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
RatingBar(
|
||||
filledIcon: Icons.star,
|
||||
emptyIcon: Icons.star_border,
|
||||
onRatingChanged: (value) => debugPrint('$value'),
|
||||
initialRating: 3,
|
||||
maxRating: 5,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
color: Colors.black,
|
||||
width: 200,
|
||||
height: 200,
|
||||
padding: EdgeInsets.zero,
|
||||
alignment: Alignment.center,
|
||||
child: IconButton.filled(
|
||||
onPressed: () {},
|
||||
icon: Icon(
|
||||
MihIcons.mihLogo,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,465 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
|
||||
|
||||
class PackageToolZero extends StatefulWidget {
|
||||
const PackageToolZero({super.key});
|
||||
|
||||
@override
|
||||
State<PackageToolZero> createState() => _PackageToolZeroState();
|
||||
}
|
||||
|
||||
class _PackageToolZeroState extends State<PackageToolZero> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
borderOn: false,
|
||||
bodyItem: getBody(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getBody() {
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"This is Package Tool Zero to test MIH Alerts",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().successBasicAlert(
|
||||
"Success!",
|
||||
"This is the message for the success message",
|
||||
context,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
child: Text(
|
||||
"Basic Success Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().successAdvancedAlert(
|
||||
"Success!",
|
||||
"This is the advanced alert message",
|
||||
[
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
"Okay",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
context,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
child: Text(
|
||||
"Advanced Success Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().warningAlert(
|
||||
"Warning Alert!", "This is a friendly warning mee", context);
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
child: Text(
|
||||
"Warning Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().warningAdvancedAlert(
|
||||
"warning!",
|
||||
"This is the advanced alert message",
|
||||
[
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
"Okay",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
context,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
child: Text(
|
||||
"Advanced Warning Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().errorBasicAlert(
|
||||
"Error!",
|
||||
"Thisis the basic error alert message",
|
||||
context,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Basic Error Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().errorAdvancedAlert(
|
||||
"Error!",
|
||||
"This is the advanced alert message",
|
||||
[
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
"Okay",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
buttonColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 300,
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
"Dismiss",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
context,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Advanced Error Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().deleteConfirmationAlert(
|
||||
"THis is a delete confirmation",
|
||||
() {
|
||||
context.pop();
|
||||
},
|
||||
context,
|
||||
);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Delete Confirmation Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().internetConnectionAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Internet Connection Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().locationPermissionAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Location Permission Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().inputErrorAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Input Error Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().passwordRequirementAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
"Password Requirement Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().passwordMatchAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Password Match Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().loginErrorAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Login Error Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().emailExistsAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Email Exists Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MihButton(
|
||||
width: 300,
|
||||
onPressed: () {
|
||||
MihAlertServices().invalidEmailAlert(context);
|
||||
},
|
||||
buttonColor: MihColors.getRedColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode != "Dark"),
|
||||
child: Text(
|
||||
"Invalid Email Alert",
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
BIN
mih_ui/lib/mih_package_components/assets/fonts/Mih_Icons.ttf
Normal file
@@ -0,0 +1 @@
|
||||
/* Mih Icons - https://icomoon.io/*/
|
||||
99
mih_ui/lib/mih_package_components/assets/fonts/style.css
Normal file
@@ -0,0 +1,99 @@
|
||||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src: url('fonts/icomoon.eot?8flwgj');
|
||||
src: url('fonts/icomoon.eot?8flwgj#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.ttf?8flwgj') format('truetype'),
|
||||
url('fonts/icomoon.woff?8flwgj') format('woff'),
|
||||
url('fonts/icomoon.svg?8flwgj#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
[class^="icon-"],
|
||||
[class*=" icon-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'icomoon' !important;
|
||||
/* speak: never; */
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-mine_sweeper:before {
|
||||
content: "\e900";
|
||||
}
|
||||
|
||||
.icon-mzansi_directory:before {
|
||||
content: "\e901";
|
||||
}
|
||||
|
||||
.icon-personal_profile:before {
|
||||
content: "\e902";
|
||||
}
|
||||
|
||||
.icon-about_mih:before {
|
||||
content: "\e903";
|
||||
}
|
||||
|
||||
.icon-access_control:before {
|
||||
content: "\e904";
|
||||
}
|
||||
|
||||
.icon-business_profile:before {
|
||||
content: "\e905";
|
||||
}
|
||||
|
||||
.icon-business_setup:before {
|
||||
content: "\e906";
|
||||
}
|
||||
|
||||
.icon-calculator:before {
|
||||
content: "\e907";
|
||||
}
|
||||
|
||||
.icon-calendar:before {
|
||||
content: "\e908";
|
||||
}
|
||||
|
||||
.icon-i_dont_know:before {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.icon-mih_logo:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
|
||||
.icon-mih_ring:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
|
||||
.icon-mzansi_ai:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
|
||||
.icon-mzansi_wallet:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
|
||||
.icon-notifications:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
|
||||
.icon-patient_manager:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
|
||||
.icon-patient_profile:before {
|
||||
content: "\e910";
|
||||
}
|
||||
|
||||
.icon-profile_setup:before {
|
||||
content: "\e911";
|
||||
}
|
||||
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 78 KiB |
BIN
mih_ui/lib/mih_package_components/assets/images/founder.jpg
Normal file
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 20 KiB |
BIN
mih_ui/lib/mih_package_components/assets/images/logo_light.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 23 KiB |