push<T extends Object?> method
Future<T?>
push<T extends Object?>(
- Widget sheet, {
- required SideSheetTransitionBuilder transitionBuilder,
- required SideSheetPosition position,
- DecorationBuilder? decorationBuilder,
- bool dismissible = true,
- Duration? animationDuration,
- Duration? reverseAnimationDuration,
Push the given sheet onto the navigation stack.
Implementation
Future<T?> push<T extends Object?>(
Widget sheet, {
required SideSheetTransitionBuilder transitionBuilder,
required SideSheetPosition position,
DecorationBuilder? decorationBuilder,
bool dismissible = true,
Duration? animationDuration,
Duration? reverseAnimationDuration,
}) async {
if (!mounted || _blockGestures) return null;
final completer = Completer<T?>();
final newEntry = SideSheetEntry<T?>.createNewElement(
index: _sheetEntries.length,
transitionBuilder: transitionBuilder,
tickerProvider: this,
sheet: sheet,
completer: completer,
decorationBuilder: decorationBuilder ?? widget.decorationBuilder,
position: position,
dismissible: dismissible,
animationDuration: _setSettleDuration(animationDuration),
reverseDuration: _setReverseSettleDuration(reverseAnimationDuration),
);
_sheetEntries.add(newEntry);
_notifyStateChange();
if (_scrimAnimationController.value == 0) {
_scrimAnimationController.forward();
}
return completer.future;
}