childButtonStandardBack method
Widget
childButtonStandardBack(
- AFStateProgrammingInterface<
AFComponentState, AFBuildContext< spi, {AFFlexibleStateView, AFRouteParam> , AFFunctionalTheme> - required AFScreenID screen,
- AFWidgetID wid = AFUIWidgetID.buttonBack,
- dynamic iconIdOrWidget = AFUIThemeID.iconBack,
- dynamic iconColor,
- dynamic iconSize,
- String tooltip = "Back",
- bool worksInSingleScreenTest = true,
- AFShouldContinueCheckDelegate? shouldContinueCheck,
inherited
Creates a standard back button, which navigates up the screen hierarchy.
The back button can optionally display a dialog which checks whether the user
should continue, see standardShouldContinueAlertCheck
for more.
Implementation
Widget childButtonStandardBack(AFStateProgrammingInterface spi, {
required AFScreenID screen,
AFWidgetID wid = AFUIWidgetID.buttonBack,
dynamic iconIdOrWidget = AFUIThemeID.iconBack,
dynamic iconColor,
dynamic iconSize,
String tooltip = "Back",
bool worksInSingleScreenTest = true,
AFShouldContinueCheckDelegate? shouldContinueCheck,
}) {
var ico = icon(iconIdOrWidget, iconColor: iconColor, iconSize: iconSize);
if(ico == null) throw AFException("Could not create icon");
return IconButton(
key: keyForWID(wid),
icon: ico,
tooltip: translate(text: tooltip),
onPressed: () async {
if(shouldContinueCheck == null || await shouldContinueCheck() == AFShouldContinue.yesContinue) {
spi.context.navigatePop(worksInSingleScreenTest: worksInSingleScreenTest);
spi.context.executeWireframeEvent(wid, null);
}
}
);
}