TNC Route Fixed

This commit is contained in:
2025-11-10 12:39:31 +05:30
parent 3e88aad43f
commit 5c8df8ace3
7 changed files with 301 additions and 84 deletions

View File

@@ -185,19 +185,16 @@ class _MPinScreenState extends State<MPinScreen> with TickerProviderStateMixin {
),
);
break;
case MPinMode.confirm:
if (widget.initialPin == pin) {
// 1) persist the pin
await storage.write('mpin', pin);
case MPinMode.confirm:
if (widget.initialPin == pin) {
// 1) persist the pin
await storage.write('mpin', pin);
// 3) now clear the entire navigation stack and go to your main scaffold
if (mounted) {
Navigator.of(context, rootNavigator: true).pushAndRemoveUntil(
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
(route) => false,
);
}
} else {
// 2) Call the onCompleted callback to let the parent handle navigation
if (mounted) {
widget.onCompleted?.call(pin);
}
} else {
setState(() {
_isError = true;
errorText = AppLocalizations.of(context).pinsDoNotMatch;