Skip to content

Commit

Permalink
Fix unmodify list
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Nov 20, 2023
1 parent 606cf5e commit fe9fd97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
21 changes: 12 additions & 9 deletions example/lib/src/common/widget/router_state_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/src/utils/state_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ abstract final class StateUtil {
);
} else {
return OctopusState(
children: _parseSegments(segments, 0).toList(),
children: _parseSegments(segments.toList(), 0).toList(),
arguments: arguments,
);
}
Expand Down Expand Up @@ -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] == '.') {
Expand Down

0 comments on commit fe9fd97

Please sign in to comment.