feat(app): compose live Runs with deep links and reconnect retention

This commit is contained in:
2026-10-21 17:26:36 +01:00
parent 38b7a849a7
commit 35a8aab772
34 changed files with 3038 additions and 128 deletions
+29 -3
View File
@@ -8,20 +8,46 @@ class AdaptiveShell extends StatefulWidget {
super.key,
this.destinationBodies = const {},
this.cupertino = false,
this.destination,
this.onDestinationSelected,
});
final Map<AppDestination, WidgetBuilder> destinationBodies;
final bool cupertino;
/// The destination a route owner selected. When null the shell keeps its own
/// selection, which preserves the plain-shell tests and native composition.
final AppDestination? destination;
final ValueChanged<AppDestination>? onDestinationSelected;
@override
State<AdaptiveShell> createState() => _AdaptiveShellState();
}
class _AdaptiveShellState extends State<AdaptiveShell> {
AppDestination _selected = AppDestination.pipelines;
late AppDestination _selected;
void _select(AppDestination destination) =>
setState(() => _selected = destination);
@override
void initState() {
super.initState();
_selected = widget.destination ?? AppDestination.pipelines;
}
@override
void didUpdateWidget(covariant AdaptiveShell oldWidget) {
super.didUpdateWidget(oldWidget);
final destination = widget.destination;
if (destination != null) _selected = destination;
}
void _select(AppDestination destination) {
final callback = widget.onDestinationSelected;
if (callback != null) {
callback(destination);
return;
}
setState(() => _selected = destination);
}
List<T> _items<T>(T Function(AppDestination) build) =>
AppDestination.values.map(build).toList();