MIH Auth Offline First Change
This commit is contained in:
parent
a5bdee892c
commit
9d30face3d
13 changed files with 425 additions and 55 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/Example/package_tools/package_tool_four.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/Example/package_tools/package_tool_one.dart';
|
||||
|
|
@ -61,26 +62,31 @@ class _PackageTestState extends State<PackageTest> {
|
|||
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = Map();
|
||||
temp[const Icon(Icons.link)] = () {
|
||||
temp[const Icon(Icons.lock)] = () {
|
||||
setState(() {
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.warning)] = () {
|
||||
temp[const Icon(Icons.link)] = () {
|
||||
setState(() {
|
||||
_selectedIndex = 1;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.inbox)] = () {
|
||||
temp[const Icon(Icons.warning)] = () {
|
||||
setState(() {
|
||||
_selectedIndex = 2;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.outbond)] = () {
|
||||
temp[const Icon(Icons.inbox)] = () {
|
||||
setState(() {
|
||||
_selectedIndex = 3;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.outbond)] = () {
|
||||
setState(() {
|
||||
_selectedIndex = 4;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selectedIndex: _selectedIndex,
|
||||
|
|
@ -95,6 +101,8 @@ class _PackageTestState extends State<PackageTest> {
|
|||
MzansiProfileProvider profileProvider =
|
||||
context.read<MzansiProfileProvider>();
|
||||
List<Widget> toolBodies = [
|
||||
const PackageToolFour(),
|
||||
const PackageToolThree(),
|
||||
const PackageToolThree(),
|
||||
const PackageToolZero(),
|
||||
PackageToolOne(
|
||||
|
|
@ -108,9 +116,12 @@ class _PackageTestState extends State<PackageTest> {
|
|||
|
||||
List<String> getToolTitle() {
|
||||
List<String> toolTitles = [
|
||||
"Tool Zero",
|
||||
"Tool One",
|
||||
"Tool Two",
|
||||
"Tool Three",
|
||||
"Tool Four",
|
||||
"Tool Five",
|
||||
"Tool Six",
|
||||
];
|
||||
return toolTitles;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/components/mih_soft_login_popup.dart';
|
||||
|
||||
class PackageToolFour extends StatefulWidget {
|
||||
const PackageToolFour({super.key});
|
||||
|
||||
@override
|
||||
State<PackageToolFour> createState() => _PackageToolFourState();
|
||||
}
|
||||
|
||||
class _PackageToolFourState extends State<PackageToolFour> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
MihButton(
|
||||
onPressed: () async {
|
||||
final bool didReauthenticate = await showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) => const MihSoftLoginPopup(),
|
||||
) ??
|
||||
false;
|
||||
KenLogger.success("reauthenticate Successful: $didReauthenticate");
|
||||
},
|
||||
buttonColor: MihColors.secondary(),
|
||||
width: 300,
|
||||
child: Text(
|
||||
"Soft Login",
|
||||
style: TextStyle(
|
||||
color: MihColors.primary(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue