QOL: Remove legacy layout widgets
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MIHAction extends StatefulWidget {
|
||||
final void Function()? onTap;
|
||||
final double iconSize;
|
||||
final Widget icon;
|
||||
const MIHAction({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.iconSize,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHAction> createState() => _MIHActionState();
|
||||
}
|
||||
|
||||
class _MIHActionState extends State<MIHAction> {
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
iconSize: widget.iconSize,
|
||||
padding: const EdgeInsets.all(0),
|
||||
onPressed: widget.onTap,
|
||||
icon: widget.icon,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
class MIHBody extends StatefulWidget {
|
||||
final bool borderOn;
|
||||
final List<Widget> bodyItems;
|
||||
const MIHBody({
|
||||
super.key,
|
||||
required this.borderOn,
|
||||
required this.bodyItems,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHBody> createState() => _MIHBodyState();
|
||||
}
|
||||
|
||||
class _MIHBodyState extends State<MIHBody> {
|
||||
//double paddingSize = 10;
|
||||
|
||||
double getHorizontalPaddingSize(Size screenSize) {
|
||||
if (MzansiInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||
if (widget.borderOn) {
|
||||
return 10;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
// mobile
|
||||
if (widget.borderOn) {
|
||||
return 10;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double getVerticalPaddingSize(Size screenSize) {
|
||||
// mobile
|
||||
if (widget.borderOn) {
|
||||
return 10;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Decoration? getBoader() {
|
||||
if (widget.borderOn) {
|
||||
return BoxDecoration(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
width: 3.0),
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Size screenSize = MediaQuery.sizeOf(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: getHorizontalPaddingSize(screenSize),
|
||||
right: getHorizontalPaddingSize(screenSize),
|
||||
bottom: getVerticalPaddingSize(screenSize),
|
||||
top: 0,
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 10,
|
||||
top: getVerticalPaddingSize(screenSize),
|
||||
),
|
||||
width: screenSize.width,
|
||||
height: screenSize.height,
|
||||
decoration: getBoader(),
|
||||
child: ScrollConfiguration(
|
||||
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: widget.bodyItems,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MIHHeader extends StatefulWidget {
|
||||
final MainAxisAlignment headerAlignment;
|
||||
final List<Widget> headerItems;
|
||||
const MIHHeader({
|
||||
super.key,
|
||||
required this.headerAlignment,
|
||||
required this.headerItems,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHHeader> createState() => _MIHHeaderState();
|
||||
}
|
||||
|
||||
class _MIHHeaderState extends State<MIHHeader> {
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 50,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: widget.headerAlignment,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: widget.headerItems,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../mih_packages/mih_home/components/mih_app_drawer.dart';
|
||||
import 'mih_body.dart';
|
||||
import 'mih_header.dart';
|
||||
|
||||
class MIHLayoutBuilder extends StatefulWidget {
|
||||
final Widget actionButton;
|
||||
final Widget? secondaryActionButton;
|
||||
final MIHHeader header;
|
||||
final MIHBody body;
|
||||
final MIHAppDrawer? actionDrawer;
|
||||
final Widget? secondaryActionDrawer;
|
||||
final Widget? bottomNavBar;
|
||||
final bool pullDownToRefresh;
|
||||
final Future<void> Function() onPullDown;
|
||||
//final String type;
|
||||
const MIHLayoutBuilder({
|
||||
super.key,
|
||||
required this.actionButton,
|
||||
required this.header,
|
||||
required this.secondaryActionButton,
|
||||
required this.body,
|
||||
required this.actionDrawer,
|
||||
required this.secondaryActionDrawer,
|
||||
required this.bottomNavBar,
|
||||
required this.pullDownToRefresh,
|
||||
required this.onPullDown,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHLayoutBuilder> createState() => _MIHLayoutBuilderState();
|
||||
}
|
||||
|
||||
class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
|
||||
List<Widget> getList() {
|
||||
List<Widget> temp = [];
|
||||
temp.add(widget.header);
|
||||
temp.add(widget.body);
|
||||
return temp;
|
||||
}
|
||||
|
||||
// openTheDrawer() {
|
||||
// _scaffoldKey.currentState!.openEndDrawer();
|
||||
// }
|
||||
|
||||
Widget getLayoutHeader() {
|
||||
List<Widget> temp = [];
|
||||
temp.add(widget.actionButton);
|
||||
temp.add(Flexible(child: widget.header));
|
||||
if (widget.secondaryActionButton != null) {
|
||||
temp.add(widget.secondaryActionButton!);
|
||||
} else {
|
||||
//print(widget.header.headerItems.length);
|
||||
if (widget.header.headerItems.length == 1) {
|
||||
temp.add(const SizedBox(
|
||||
width: 50,
|
||||
));
|
||||
}
|
||||
}
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: temp,
|
||||
);
|
||||
}
|
||||
|
||||
Widget getBody(double width, double height) {
|
||||
if (widget.pullDownToRefresh == true) {
|
||||
return SafeArea(
|
||||
child: LayoutBuilder(builder: (context, BoxConstraints constraints) {
|
||||
double newheight = constraints.maxHeight;
|
||||
//print(newheight);
|
||||
return RefreshIndicator(
|
||||
onRefresh: widget.onPullDown,
|
||||
child: ListView.builder(
|
||||
itemCount: 1,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return SafeArea(
|
||||
child: SizedBox(
|
||||
width: width,
|
||||
height: newheight,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 5),
|
||||
getLayoutHeader(),
|
||||
const SizedBox(height: 5),
|
||||
Expanded(child: widget.body),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
// child: SafeArea(
|
||||
// child: SizedBox(
|
||||
// width: width,
|
||||
// height: height,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// getLayoutHeader(),
|
||||
// Expanded(child: widget.body),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
return SafeArea(
|
||||
child: SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 5),
|
||||
getLayoutHeader(),
|
||||
const SizedBox(height: 5),
|
||||
Expanded(child: widget.body),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Size screenSize = MediaQuery.sizeOf(context);
|
||||
return Scaffold(
|
||||
//drawerEnableOpenDragGesture: true,
|
||||
drawer: widget.actionDrawer,
|
||||
endDrawer: widget.secondaryActionDrawer,
|
||||
body: getBody(screenSize.width, screenSize.height),
|
||||
bottomNavigationBar: widget.bottomNavBar,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:pdf/pdf.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
import '../mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'mih_action.dart';
|
||||
|
||||
class MIHPrintPreview extends StatefulWidget {
|
||||
final PrintPreviewArguments arguments;
|
||||
const MIHPrintPreview({
|
||||
super.key,
|
||||
required this.arguments,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHPrintPreview> createState() => _MIHPrintPreviewState();
|
||||
}
|
||||
|
||||
class _MIHPrintPreviewState extends State<MIHPrintPreview> {
|
||||
MIHAction getActionButton() {
|
||||
return MIHAction(
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PdfPreview(
|
||||
pdfFileName: widget.arguments.fileName,
|
||||
initialPageFormat: PdfPageFormat.a4,
|
||||
loadingWidget: const Mihloadingcircle(),
|
||||
actions: [getActionButton()],
|
||||
build: (format) => widget.arguments.pdfData,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_yt_video_player.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MIHTile extends StatefulWidget {
|
||||
final String tileName;
|
||||
final String? videoID;
|
||||
final Widget tileIcon;
|
||||
final void Function() onTap;
|
||||
// final Widget tileIcon;
|
||||
final Color p;
|
||||
final Color s;
|
||||
|
||||
const MIHTile({
|
||||
super.key,
|
||||
required this.onTap,
|
||||
required this.tileName,
|
||||
this.videoID,
|
||||
required this.tileIcon,
|
||||
required this.p,
|
||||
required this.s,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHTile> createState() => _MIHTileState();
|
||||
}
|
||||
|
||||
class _MIHTileState extends State<MIHTile> {
|
||||
late Color mainC;
|
||||
late Color secondC;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
mainC = widget.p;
|
||||
secondC = widget.s;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void displayHint() {
|
||||
if (widget.videoID != null) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return MihPackageWindow(
|
||||
fullscreen: false,
|
||||
windowTitle: widget.tileName,
|
||||
onWindowTapClose: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
windowBody: Column(
|
||||
children: [
|
||||
MIHYTVideoPlayer(videoYTLink: widget.videoID!),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// print(
|
||||
// "Tile Name: ${widget.tileName}\nTitle Type: ${widget.tileIcon.runtimeType.toString()}");
|
||||
return FittedBox(
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
AnimatedContainer(
|
||||
//alignment: Alignment.center,
|
||||
width: 250,
|
||||
height: 250,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Material(
|
||||
color: mainC,
|
||||
// shadowColor:
|
||||
// MihColors.getSecondaryColor(MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// elevation: 5,
|
||||
borderRadius: BorderRadius.circular(80),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(80),
|
||||
// ho
|
||||
onTap: widget.onTap,
|
||||
onLongPress: () {
|
||||
displayHint();
|
||||
},
|
||||
// hoverDuration: ,
|
||||
splashColor: MihColors.getHighlightColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
highlightColor: MihColors.getHighlightColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
child: widget.tileIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(
|
||||
width: 300,
|
||||
child: Text(
|
||||
widget.tileName,
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.visible,
|
||||
style: TextStyle(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 40.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihPackageWindow extends StatefulWidget {
|
||||
final String windowTitle;
|
||||
final String? windowTitle;
|
||||
final Widget windowBody;
|
||||
final List<SpeedDialChild>? menuOptions;
|
||||
final void Function()? onWindowTapClose;
|
||||
@@ -87,23 +87,25 @@ class _MihPackageWindowState extends State<MihPackageWindow> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
widget.windowTitle,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: windowTitleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.foregroundColor ??
|
||||
MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
if (widget.windowTitle != null)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Text(
|
||||
widget.windowTitle!,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: windowTitleSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: widget.foregroundColor ??
|
||||
MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.menuOptions != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_install_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
@@ -343,31 +343,32 @@ class _MihInfoState extends State<MihInfo> {
|
||||
|
||||
List<Widget> getSocialsList() {
|
||||
List<Widget> socials = [];
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_youtubeUrl);
|
||||
},
|
||||
tileName: "YouTube",
|
||||
tileIcon: Center(
|
||||
appName: "YouTube",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.youtube,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
size: 175,
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_tiktokUrl);
|
||||
},
|
||||
tileName: "TikTok",
|
||||
tileIcon: Center(
|
||||
appName: "TikTok",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.tiktok,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -375,18 +376,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_twitch);
|
||||
},
|
||||
tileName: "Twitch",
|
||||
tileIcon: Center(
|
||||
appName: "Twitch",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.twitch,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -394,18 +396,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_threadsUrl);
|
||||
},
|
||||
tileName: "Threads",
|
||||
tileIcon: Center(
|
||||
appName: "Threads",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.threads,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -413,18 +416,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_whatsappUrl);
|
||||
},
|
||||
tileName: "Whatsapp",
|
||||
tileIcon: Center(
|
||||
appName: "Whatsapp",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.whatsapp,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -432,18 +436,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_instagramUrl);
|
||||
},
|
||||
tileName: "Instagram",
|
||||
tileIcon: Center(
|
||||
appName: "Instagram",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.instagram,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -451,19 +456,20 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_xUrl);
|
||||
},
|
||||
tileName: "X",
|
||||
tileIcon: Center(
|
||||
appName: "X",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.xTwitter,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -471,18 +477,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_linkedinUrl);
|
||||
},
|
||||
tileName: "LinkedIn",
|
||||
tileIcon: Center(
|
||||
appName: "LinkedIn",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.linkedin,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -490,18 +497,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_facebookUrl);
|
||||
},
|
||||
tileName: "FaceBook",
|
||||
tileIcon: Center(
|
||||
appName: "FaceBook",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.facebook,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -509,18 +517,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_redditUrl);
|
||||
},
|
||||
tileName: "Reddit",
|
||||
tileIcon: Center(
|
||||
appName: "Reddit",
|
||||
appIcon: Center(
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.reddit,
|
||||
color: MihColors.getPrimaryColor(
|
||||
@@ -528,18 +537,19 @@ class _MihInfoState extends State<MihInfo> {
|
||||
size: 200,
|
||||
),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
socials.add(MIHTile(
|
||||
socials.add(MihPackageTile(
|
||||
onTap: () {
|
||||
launchSocialUrl(_kick);
|
||||
},
|
||||
tileName: "Kick",
|
||||
tileIcon: Center(
|
||||
appName: "Kick",
|
||||
appIcon: Center(
|
||||
child: Text(
|
||||
"KICK",
|
||||
style: TextStyle(
|
||||
@@ -555,9 +565,10 @@ class _MihInfoState extends State<MihInfo> {
|
||||
// size: 200,
|
||||
// ),
|
||||
),
|
||||
p: MihColors.getSecondaryColor(
|
||||
iconSize: 200,
|
||||
primaryColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
s: MihColors.getPrimaryColor(
|
||||
secondaryColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
));
|
||||
//==================================================================
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_access_controlls_provider.dart';
|
||||
@@ -73,38 +70,6 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
|
||||
selectedDropdown = filterController.text;
|
||||
});
|
||||
}
|
||||
// setState(() {
|
||||
// accessRequestResults = fetchAccessRequests();
|
||||
// });
|
||||
}
|
||||
|
||||
MIHAction getActionButton() {
|
||||
return MIHAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
'mihHome',
|
||||
extra: false,
|
||||
);
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
MIHHeader getHeader() {
|
||||
return const MIHHeader(
|
||||
headerAlignment: MainAxisAlignment.center,
|
||||
headerItems: [
|
||||
Text(
|
||||
"Forever Access List",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget getBody() {
|
||||
|
||||
@@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||
@@ -36,7 +36,7 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
bool successfulSignIn = false;
|
||||
bool showProfiles = false;
|
||||
final baseAPI = AppEnviroment.baseApiUrl;
|
||||
late List<MIHTile> sandboxProfileList = [];
|
||||
late List<MihPackageTile> sandboxProfileList = [];
|
||||
|
||||
//sign user in
|
||||
Future<void> signUserIn() async {
|
||||
@@ -68,8 +68,8 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
}
|
||||
}
|
||||
|
||||
void setSandboxProfiles(List<MIHTile> tileList) {
|
||||
tileList.add(MIHTile(
|
||||
void setSandboxProfiles(List<MihPackageTile> tileList) {
|
||||
tileList.add(MihPackageTile(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
emailController.text = "testpatient@mzansi-innovation-hub.co.za";
|
||||
@@ -81,16 +81,18 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().formNotFilledCompletely(context);
|
||||
}
|
||||
},
|
||||
tileName: "Patient",
|
||||
tileIcon: Icon(
|
||||
appName: "Patient",
|
||||
appIcon: Icon(
|
||||
Icons.perm_identity_rounded,
|
||||
color: getSec(),
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
iconSize: 200,
|
||||
primaryColor: getPrim(),
|
||||
secondaryColor: getSec(),
|
||||
authenticateUser: false,
|
||||
));
|
||||
tileList.add(MIHTile(
|
||||
tileList.add(MihPackageTile(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
emailController.text = "testdoctor@mzansi-innovation-hub.co.za";
|
||||
@@ -102,17 +104,19 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().formNotFilledCompletely(context);
|
||||
}
|
||||
},
|
||||
tileName: "Doctor",
|
||||
tileIcon: Icon(
|
||||
appName: "Doctor",
|
||||
appIcon: Icon(
|
||||
Icons.medical_services,
|
||||
color: getSec(),
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
iconSize: 200,
|
||||
primaryColor: getPrim(),
|
||||
secondaryColor: getSec(),
|
||||
authenticateUser: false,
|
||||
));
|
||||
//if (AppEnviroment.getEnv() == "Dev") {
|
||||
tileList.add(MIHTile(
|
||||
tileList.add(MihPackageTile(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
emailController.text = "test-business@mzansi-innovation-hub.co.za";
|
||||
@@ -124,16 +128,18 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().formNotFilledCompletely(context);
|
||||
}
|
||||
},
|
||||
tileName: "Business",
|
||||
tileIcon: Icon(
|
||||
appName: "Business",
|
||||
appIcon: Icon(
|
||||
Icons.business,
|
||||
color: getSec(),
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
iconSize: 200,
|
||||
primaryColor: getPrim(),
|
||||
secondaryColor: getSec(),
|
||||
authenticateUser: false,
|
||||
));
|
||||
tileList.add(MIHTile(
|
||||
tileList.add(MihPackageTile(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
emailController.text = "test@mzansi-innovation-hub.co.za";
|
||||
@@ -145,14 +151,16 @@ class _MihSignInState extends State<MihSignIn> {
|
||||
MihAlertServices().formNotFilledCompletely(context);
|
||||
}
|
||||
},
|
||||
tileName: "Test",
|
||||
tileIcon: Icon(
|
||||
appName: "Test",
|
||||
appIcon: Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
color: getSec(),
|
||||
color: getPrim(),
|
||||
size: 200,
|
||||
),
|
||||
p: getPrim(),
|
||||
s: getSec(),
|
||||
iconSize: 200,
|
||||
primaryColor: getPrim(),
|
||||
secondaryColor: getSec(),
|
||||
authenticateUser: false,
|
||||
));
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user