DPLYR-dev/SplashScreenFlutterPackage

Navigate to Multiple pages after navigateAfterSeconds

Mallikarjun-0369 opened this issue · 2 comments

In My Case i want to navigate to different pages based on some login response like below, like below.

_handleNavigation() {
if(UserSession.loginStatus == 0) {
print('LoginStatus -> ${UserSession.isLoggedIn}');
return LoginPage();
} else {
print('LoginStatus -> ${UserSession.isLoggedIn}');
switch (UserSession.shortName) {
case 'stay':
return AccommodationListPage();
// break;

    case 'activity':
      return ActivityDashboard();

// break;

    case 'transport':
      return TransportDashboard();

// break;

    case 'tour':
      return PendingContractsPage();
  }
}

}

But am getting issues with this function: Like it "Should be String or Widget."
How can i achieve my requirement. Please help me out on this.
Thanks Alot !.

Same Error

This issue will be solved if you added the return type of Widget to the function like this

Widget _handleNavigation() {
return WhateverPage();
}

Thank you