backToInitial static method
Future<void>
backToInitial(
{ - dynamic result,
- int? tabIndex,
- String? tabName,
})
Implementation
static Future<void> backToInitial({dynamic result, int? tabIndex, String? tabName}) async {
// pop to initial route in stack
await _stackRouter?.backToInitial(result: result);
// optional: pop to specific route in tab
if (tabName != null || tabIndex != null) {
int? newTabIndex;
if (tabName != null) {
newTabIndex = await _tabRouter?.currentState?.setNewRoute(tabName);
}
if (tabIndex != null && newTabIndex == null) {
newTabIndex = await _tabRouter?.currentState?.setNewIndex(tabIndex);
}
}
}