diff --git a/lib/src/flutter_deck_router.dart b/lib/src/flutter_deck_router.dart index bd6e37b..8623b7e 100644 --- a/lib/src/flutter_deck_router.dart +++ b/lib/src/flutter_deck_router.dart @@ -1,9 +1,20 @@ +import 'package:flutter/widgets.dart'; import 'package:flutter_deck/src/configuration/configuration.dart'; import 'package:flutter_deck/src/flutter_deck_slide.dart'; import 'package:go_router/go_router.dart'; const _queryParameterStep = 'step'; +class _FlutterDeckSlidePage extends StatelessWidget { + const _FlutterDeckSlidePage(this.slide); + final FlutterDeckRouterSlide slide; + + @override + Widget build(BuildContext context) { + return slide.widget.build(context); + } +} + /// A slide route for the slide deck. class FlutterDeckRouterSlide { /// Creates a slide route for the slide deck. @@ -63,7 +74,7 @@ class FlutterDeckRouter { key: state.pageKey, restorationId: state.pageKey.value, transitionsBuilder: slide.configuration.transition.build, - child: slide.widget.build(context), + child: _FlutterDeckSlidePage(slide), ), ), ],