diff --git a/example/lib/src/common/widget/router_state_observer.dart b/example/lib/src/common/widget/router_state_observer.dart index a9c40f9..e2f0613 100644 --- a/example/lib/src/common/widget/router_state_observer.dart +++ b/example/lib/src/common/widget/router_state_observer.dart @@ -35,15 +35,18 @@ class RouterStateObserver extends StatelessWidget { SizedBox.fromSize( size: size, child: Material( - color: Colors.transparent, - child: SingleChildScrollView( - child: ValueListenableBuilder( - valueListenable: listenable, - builder: (context, state, child) => Text( - state.toString(), - style: const TextStyle( - overflow: TextOverflow.clip, - fontSize: 12, + color: Theme.of(context).colorScheme.surface, + child: Padding( + padding: const EdgeInsets.all(8), + child: SingleChildScrollView( + child: ValueListenableBuilder( + valueListenable: listenable, + builder: (context, state, child) => Text( + state.toString(), + style: const TextStyle( + overflow: TextOverflow.clip, + fontSize: 12, + ), ), ), ), diff --git a/lib/src/utils/state_util.dart b/lib/src/utils/state_util.dart index b83e9ea..0892d24 100644 --- a/lib/src/utils/state_util.dart +++ b/lib/src/utils/state_util.dart @@ -99,7 +99,7 @@ abstract final class StateUtil { ); } else { return OctopusState( - children: _parseSegments(segments, 0).toList(), + children: _parseSegments(segments.toList(), 0).toList(), arguments: arguments, ); } @@ -150,8 +150,7 @@ abstract final class StateUtil { int depth, ) sync* { while (segments.isNotEmpty) { - var segment = segments.first; - segments.removeAt(0); + var segment = segments.removeAt(0); var currentDepth = 0; while (currentDepth < segment.length && segment[currentDepth] == '.') {