Merge branch 'worktree-agent-aa9ed772f90c7c7b3'
This commit is contained in:
@@ -961,6 +961,7 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
server: widget.server,
|
||||
onBack: _delegate.closeSchedules,
|
||||
onOpenPipeline: (id) => _delegate.goTo(AppRoute.pipeline(id)),
|
||||
onSelectDestination: _selectDestination,
|
||||
);
|
||||
|
||||
Widget _buildTemplates(BuildContext context) => TemplatesDestination(
|
||||
@@ -1137,6 +1138,7 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
connection: _session,
|
||||
connected: () => _session.connected,
|
||||
gateway: _session.client,
|
||||
onOpenConnection: () => _delegate.goTo(AppRoute.settings),
|
||||
child: PipelinesDestination(
|
||||
session: _session,
|
||||
server: widget.server,
|
||||
@@ -1242,7 +1244,13 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
deliveryServiceController: _deliveryController,
|
||||
// The Help and about row replays the first-run walkthrough. It only
|
||||
// shows it; the device's seen record is left alone.
|
||||
onShowWalkthrough: () => unawaited(showFirstRunWalkthrough(context)),
|
||||
onShowWalkthrough: () => unawaited(
|
||||
showFirstRunWalkthrough(
|
||||
context,
|
||||
connected: _session.connected,
|
||||
onOpenConnection: () => _delegate.goTo(AppRoute.settings),
|
||||
),
|
||||
),
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
@@ -8,6 +8,8 @@ import '../features/schedules/ui/list/schedule_list_controller.dart';
|
||||
import '../features/schedules/ui/list/schedule_list_toolbar.dart'
|
||||
show ScheduleRefreshAction;
|
||||
import '../features/schedules/ui/list/schedule_list_view.dart';
|
||||
import '../shell/destination.dart';
|
||||
import '../shell/navigation_rail.dart';
|
||||
import 'app_session.dart';
|
||||
import 'server_endpoint.dart';
|
||||
|
||||
@@ -26,8 +28,13 @@ class SchedulesDestination extends StatefulWidget {
|
||||
required this.server,
|
||||
required this.onBack,
|
||||
required this.onOpenPipeline,
|
||||
this.onSelectDestination,
|
||||
});
|
||||
|
||||
/// Selects a destination from the rail this page keeps on a wide window,
|
||||
/// so Schedules does not hide the app's navigation. Null draws no rail.
|
||||
final ValueChanged<AppDestination>? onSelectDestination;
|
||||
|
||||
final AppSession session;
|
||||
final ServerEndpoint server;
|
||||
final VoidCallback onBack;
|
||||
@@ -97,7 +104,36 @@ class _SchedulesDestinationState extends State<SchedulesDestination> {
|
||||
// finished read would otherwise stay on `Loading schedules…`.
|
||||
return AnimatedBuilder(
|
||||
animation: Listenable.merge([widget.session, _controller]),
|
||||
builder: (context, _) => _page(),
|
||||
builder: (context, _) => _withRail(context, _page()),
|
||||
);
|
||||
}
|
||||
|
||||
/// On a window wide enough for the rail, the page keeps it at its leading
|
||||
/// edge (Settings selected, since Schedules sits under it).
|
||||
Widget _withRail(BuildContext context, Widget page) {
|
||||
final select = widget.onSelectDestination;
|
||||
if (select == null || !showsNavigationRail(context)) return page;
|
||||
final padding = MediaQuery.paddingOf(context);
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Material(
|
||||
child: ShellNavigationRail(
|
||||
selected: AppDestination.settings,
|
||||
icon: (destination) => Icon(destinationDetails(destination).icon),
|
||||
onSelected: select,
|
||||
padding: EdgeInsets.only(top: padding.top, bottom: padding.bottom),
|
||||
),
|
||||
),
|
||||
const VerticalDivider(width: 1, thickness: 1),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeLeft: true,
|
||||
child: page,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user