Merge pull request #239 from yaso-meth/NEW--about-MIH-route-fix
Fix about route if entered into the url
This commit is contained in:
@@ -147,8 +147,12 @@ class RouteGenerator {
|
|||||||
settings: settings,
|
settings: settings,
|
||||||
builder: (_) => AboutMih(packageIndex: args),
|
builder: (_) => AboutMih(packageIndex: args),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
return MaterialPageRoute(
|
||||||
|
settings: settings,
|
||||||
|
builder: (_) => AboutMih(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case AppRoutes.mzansiProfile:
|
case AppRoutes.mzansiProfile:
|
||||||
if (args is AppProfileUpdateArguments) {
|
if (args is AppProfileUpdateArguments) {
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_t
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class AboutMih extends StatefulWidget {
|
class AboutMih extends StatefulWidget {
|
||||||
final int packageIndex;
|
final int? packageIndex;
|
||||||
const AboutMih({
|
const AboutMih({
|
||||||
super.key,
|
super.key,
|
||||||
required this.packageIndex,
|
this.packageIndex,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -25,7 +25,11 @@ class _AboutMihState extends State<AboutMih> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
setState(() {
|
setState(() {
|
||||||
_selcetedIndex = widget.packageIndex;
|
if(widget.packageIndex == null) {
|
||||||
|
_selcetedIndex = 0;
|
||||||
|
} else {
|
||||||
|
_selcetedIndex = widget.packageIndex!;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user