forked from yaso_meth/mih-project
reuire personal selected param in migh_calc
This commit is contained in:
@@ -9,7 +9,11 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_swipe_detector/flutter_swipe_detector.dart';
|
||||
|
||||
class MIHCalculator extends StatefulWidget {
|
||||
const MIHCalculator({super.key});
|
||||
final bool personalSelected;
|
||||
const MIHCalculator({
|
||||
super.key,
|
||||
required this.personalSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
State<MIHCalculator> createState() => _MIHCalculatorState();
|
||||
@@ -26,7 +30,7 @@ class _MIHCalculatorState extends State<MIHCalculator> {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
'/',
|
||||
arguments: AuthArguments(true, false),
|
||||
arguments: AuthArguments(widget.personalSelected, false),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -280,7 +280,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calculator',
|
||||
//arguments: widget.signedInUser,
|
||||
arguments: widget.personalSelected,
|
||||
);
|
||||
},
|
||||
tileName: "Calculator",
|
||||
@@ -486,7 +486,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/calculator',
|
||||
//arguments: widget.signedInUser,
|
||||
arguments: widget.personalSelected,
|
||||
);
|
||||
},
|
||||
tileName: "Calculator",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:Mzansi_Innovation_Hub/mih_components/mih_package/test/package_test.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calendar/mzansi_calendar.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calculator/calculator.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/calculator/mih_calculator.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mih_policy_tos/mih_privacy_polocy.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mih_policy_tos/mih_terms_of_service.dart';
|
||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_ai/mzansi_ai.dart';
|
||||
@@ -308,10 +308,16 @@ class RouteGenerator {
|
||||
|
||||
//Calculator
|
||||
case '/calculator':
|
||||
return MaterialPageRoute(
|
||||
settings: settings,
|
||||
builder: (_) => const MIHCalculator(),
|
||||
);
|
||||
if (args is bool) {
|
||||
return MaterialPageRoute(
|
||||
settings: settings,
|
||||
builder: (_) => MIHCalculator(
|
||||
personalSelected: args,
|
||||
),
|
||||
);
|
||||
}
|
||||
return _errorRoute();
|
||||
//===============================================================
|
||||
|
||||
//===============================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user