From 3be71093753dd098f1e536bb4a868ff9544376e6 Mon Sep 17 00:00:00 2001 From: Timm Preetz Date: Wed, 4 Sep 2024 19:27:27 +0200 Subject: [PATCH] Change implementation of `StatelessNavigator` to be based upon `StatefulNavigator` --- .../stateless_navigator.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/src/declarative_navigatable/stateless_navigator.dart b/lib/src/declarative_navigatable/stateless_navigator.dart index 2a8216c..14efa1c 100644 --- a/lib/src/declarative_navigatable/stateless_navigator.dart +++ b/lib/src/declarative_navigatable/stateless_navigator.dart @@ -1,8 +1,16 @@ import 'package:fdr/fdr.dart'; -abstract class StatelessNavigator extends MappedNavigatableSource { - StatelessNavigator() : super(initialState: null); +abstract class StatelessNavigator extends StatefulNavigator { + List build(); @override - List build(); + StatefulNavigatorState createState() => + _StatelessNavigatorState(); +} + +class _StatelessNavigatorState extends StatefulNavigatorState { + @override + List build() { + return (navigator as StatelessNavigator).build(); + } }