merge(app): land stage tabs at the bottom and Android Back
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// Asks before Back leaves the app from the top of a tab. True to leave.
|
||||||
|
Future<bool> confirmAppExit(
|
||||||
|
BuildContext context, {
|
||||||
|
required bool cupertino,
|
||||||
|
}) async {
|
||||||
|
const title = Text('Close Pipelines?');
|
||||||
|
final leave = cupertino
|
||||||
|
? await showCupertinoDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => CupertinoAlertDialog(
|
||||||
|
title: title,
|
||||||
|
actions: [
|
||||||
|
CupertinoDialogAction(
|
||||||
|
key: const Key('app-exit-stay'),
|
||||||
|
isDefaultAction: true,
|
||||||
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
|
child: const Text('Stay'),
|
||||||
|
),
|
||||||
|
CupertinoDialogAction(
|
||||||
|
key: const Key('app-exit-close'),
|
||||||
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
child: const Text('Close'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: await showDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
title: title,
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
key: const Key('app-exit-stay'),
|
||||||
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
|
child: const Text('Stay'),
|
||||||
|
),
|
||||||
|
FilledButton(
|
||||||
|
key: const Key('app-exit-close'),
|
||||||
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
child: const Text('Close'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return leave ?? false;
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
import 'app_exit_dialog.dart';
|
||||||
import 'app_route.dart';
|
import 'app_route.dart';
|
||||||
|
|
||||||
/// Parses the browser (or platform) location into the app's routes.
|
/// Parses the browser (or platform) location into the app's routes.
|
||||||
@@ -144,7 +146,19 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
return Navigator(
|
return Navigator(
|
||||||
key: _navigatorKey,
|
key: _navigatorKey,
|
||||||
pages: [
|
pages: [
|
||||||
_page(_pageKey, builder(context, shellRoute)),
|
// While an item is open inside its tab (a wide screen keeps it
|
||||||
|
// there), Android's Back and back gesture step up a level instead of
|
||||||
|
// leaving the app: the shell tells the system it handles Back.
|
||||||
|
_page(
|
||||||
|
_pageKey,
|
||||||
|
PopScope(
|
||||||
|
canPop: !_canStepUp && !_asksBeforeExit,
|
||||||
|
onPopInvokedWithResult: (didPop, _) {
|
||||||
|
if (!didPop && !_stepUp()) _confirmExit();
|
||||||
|
},
|
||||||
|
child: builder(context, shellRoute),
|
||||||
|
),
|
||||||
|
),
|
||||||
// Templates is a Settings sub-page: the shell stays mounted underneath,
|
// Templates is a Settings sub-page: the shell stays mounted underneath,
|
||||||
// so closing restores Settings exactly as it was left.
|
// so closing restores Settings exactly as it was left.
|
||||||
if (templates) _page(_templatesPageKey, templatesBuilder!(context)),
|
if (templates) _page(_templatesPageKey, templatesBuilder!(context)),
|
||||||
@@ -232,6 +246,38 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
closeTemplates();
|
closeTemplates();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (_stepUp()) return true;
|
||||||
|
return _confirmExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// At the top of a tab Android's Back would leave the app; ask first.
|
||||||
|
/// Elsewhere (a browser) Back keeps its usual meaning.
|
||||||
|
bool get _asksBeforeExit =>
|
||||||
|
!kIsWeb && defaultTargetPlatform == TargetPlatform.android;
|
||||||
|
|
||||||
|
bool _confirming = false;
|
||||||
|
|
||||||
|
bool _confirmExit() {
|
||||||
|
final context = _navigatorKey.currentContext;
|
||||||
|
if (!_asksBeforeExit || context == null) return false;
|
||||||
|
if (_confirming) return true;
|
||||||
|
_confirming = true;
|
||||||
|
confirmAppExit(context, cupertino: cupertino).then((leave) {
|
||||||
|
_confirming = false;
|
||||||
|
if (leave) SystemNavigator.pop();
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Whether the open route has a level above it in its own tab (a stage,
|
||||||
|
/// a run, a pipeline, a chat).
|
||||||
|
bool get _canStepUp =>
|
||||||
|
_route.runId != null ||
|
||||||
|
_route.chatSessionId != null ||
|
||||||
|
(_route.kind == AppRouteKind.pipelines && _route.pipelineId != null);
|
||||||
|
|
||||||
|
/// Goes up one level: a stage to its run or pipeline, an item to its list.
|
||||||
|
bool _stepUp() {
|
||||||
final runId = _route.runId;
|
final runId = _route.runId;
|
||||||
if (runId != null && _route.stageKey != null) {
|
if (runId != null && _route.stageKey != null) {
|
||||||
goTo(AppRoute.run(runId));
|
goTo(AppRoute.run(runId));
|
||||||
|
|||||||
@@ -178,6 +178,9 @@ class _PipelinesAppState extends State<PipelinesApp>
|
|||||||
routeInformationParser: const AppRouteParser(),
|
routeInformationParser: const AppRouteParser(),
|
||||||
routerDelegate: _delegate,
|
routerDelegate: _delegate,
|
||||||
routeInformationProvider: _provider,
|
routeInformationProvider: _provider,
|
||||||
|
// Android's Back button and back gesture go through the router, so
|
||||||
|
// they close a page or step up a level instead of leaving the app.
|
||||||
|
backButtonDispatcher: RootBackButtonDispatcher(),
|
||||||
);
|
);
|
||||||
unawaited(_session.start());
|
unawaited(_session.start());
|
||||||
}
|
}
|
||||||
@@ -434,6 +437,18 @@ class _PipelinesAppState extends State<PipelinesApp>
|
|||||||
onViewPipelineRuns: (id) =>
|
onViewPipelineRuns: (id) =>
|
||||||
_delegate.goTo(AppRoute.runsForPipeline(id)),
|
_delegate.goTo(AppRoute.runsForPipeline(id)),
|
||||||
onOpenSchedules: _delegate.openSchedules,
|
onOpenSchedules: _delegate.openSchedules,
|
||||||
|
// The open pipeline is part of the route, so Back steps out of it.
|
||||||
|
onSelectionChanged: (id) {
|
||||||
|
final current = _delegate.route;
|
||||||
|
if (current.kind != AppRouteKind.pipelines) return;
|
||||||
|
if (id == null) {
|
||||||
|
if (current.pipelineId != null) {
|
||||||
|
_delegate.goTo(AppRoute.pipelines);
|
||||||
|
}
|
||||||
|
} else if (current.pipelineId != id) {
|
||||||
|
_delegate.goTo(AppRoute.pipeline(id));
|
||||||
|
}
|
||||||
|
},
|
||||||
initialPipelineId: pipelinesRoute.pipelineId,
|
initialPipelineId: pipelinesRoute.pipelineId,
|
||||||
initialVersion: pipelinesRoute.version,
|
initialVersion: pipelinesRoute.version,
|
||||||
initialStageKey: pipelinesRoute.stageKey,
|
initialStageKey: pipelinesRoute.stageKey,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class PipelinesDestination extends StatelessWidget {
|
|||||||
this.onRunStarted,
|
this.onRunStarted,
|
||||||
this.onViewPipelineRuns,
|
this.onViewPipelineRuns,
|
||||||
this.onOpenSchedules,
|
this.onOpenSchedules,
|
||||||
|
this.onSelectionChanged,
|
||||||
this.initialPipelineId,
|
this.initialPipelineId,
|
||||||
this.initialVersion = 0,
|
this.initialVersion = 0,
|
||||||
this.initialStageKey,
|
this.initialStageKey,
|
||||||
@@ -38,6 +39,7 @@ class PipelinesDestination extends StatelessWidget {
|
|||||||
final ValueChanged<int>? onRunStarted;
|
final ValueChanged<int>? onRunStarted;
|
||||||
final ValueChanged<int>? onViewPipelineRuns;
|
final ValueChanged<int>? onViewPipelineRuns;
|
||||||
final VoidCallback? onOpenSchedules;
|
final VoidCallback? onOpenSchedules;
|
||||||
|
final ValueChanged<int?>? onSelectionChanged;
|
||||||
|
|
||||||
/// The pipeline and pinned version a deep link names.
|
/// The pipeline and pinned version a deep link names.
|
||||||
final int? initialPipelineId;
|
final int? initialPipelineId;
|
||||||
@@ -84,6 +86,7 @@ class PipelinesDestination extends StatelessWidget {
|
|||||||
onRunStarted: onRunStarted,
|
onRunStarted: onRunStarted,
|
||||||
onViewPipelineRuns: onViewPipelineRuns,
|
onViewPipelineRuns: onViewPipelineRuns,
|
||||||
onOpenSchedules: onOpenSchedules,
|
onOpenSchedules: onOpenSchedules,
|
||||||
|
onSelectionChanged: onSelectionChanged,
|
||||||
initialPipelineId: initialPipelineId,
|
initialPipelineId: initialPipelineId,
|
||||||
initialVersion: initialVersion,
|
initialVersion: initialVersion,
|
||||||
initialStageKey: initialStageKey,
|
initialStageKey: initialStageKey,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class PipelinesScreen extends StatefulWidget {
|
|||||||
this.syncToken = 0,
|
this.syncToken = 0,
|
||||||
this.onRunStarted,
|
this.onRunStarted,
|
||||||
this.onViewPipelineRuns,
|
this.onViewPipelineRuns,
|
||||||
|
this.onSelectionChanged,
|
||||||
this.onOpenSchedules,
|
this.onOpenSchedules,
|
||||||
this.initialPipelineId,
|
this.initialPipelineId,
|
||||||
this.initialVersion = 0,
|
this.initialVersion = 0,
|
||||||
@@ -57,6 +58,10 @@ class PipelinesScreen extends StatefulWidget {
|
|||||||
final ValueChanged<int>? onRunStarted;
|
final ValueChanged<int>? onRunStarted;
|
||||||
final ValueChanged<int>? onViewPipelineRuns;
|
final ValueChanged<int>? onViewPipelineRuns;
|
||||||
|
|
||||||
|
/// Reports the open pipeline (null for the list) so the route, and with it
|
||||||
|
/// Back, follows what is shown.
|
||||||
|
final ValueChanged<int?>? onSelectionChanged;
|
||||||
|
|
||||||
/// Opens every schedule; shown in the bar while the list is visible.
|
/// Opens every schedule; shown in the bar while the list is visible.
|
||||||
final VoidCallback? onOpenSchedules;
|
final VoidCallback? onOpenSchedules;
|
||||||
|
|
||||||
@@ -105,6 +110,17 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
|||||||
// The detail read owns its own failure state; the list read continues.
|
// The detail read owns its own failure state; the list read continues.
|
||||||
_controller.openPipeline(id, version: widget.initialVersion);
|
_controller.openPipeline(id, version: widget.initialVersion);
|
||||||
}
|
}
|
||||||
|
_reported = _controller.selectedId;
|
||||||
|
_controller.addListener(_reportSelection);
|
||||||
|
}
|
||||||
|
|
||||||
|
int? _reported;
|
||||||
|
|
||||||
|
void _reportSelection() {
|
||||||
|
final id = _controller.selectedId;
|
||||||
|
if (id == _reported) return;
|
||||||
|
_reported = id;
|
||||||
|
widget.onSelectionChanged?.call(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -113,10 +129,15 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
|||||||
if (oldWidget.gateway != widget.gateway ||
|
if (oldWidget.gateway != widget.gateway ||
|
||||||
oldWidget.endpoint != widget.endpoint) {
|
oldWidget.endpoint != widget.endpoint) {
|
||||||
_controller.dispose();
|
_controller.dispose();
|
||||||
_controller = PipelinesController(
|
_controller =
|
||||||
PipelinesRepository(widget.gateway),
|
PipelinesController(
|
||||||
pendingRunStore: SharedPreferencesPendingRunStore(widget.endpoint),
|
PipelinesRepository(widget.gateway),
|
||||||
)..load();
|
pendingRunStore: SharedPreferencesPendingRunStore(
|
||||||
|
widget.endpoint,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
..load()
|
||||||
|
..addListener(_reportSelection);
|
||||||
} else if (oldWidget.syncToken != widget.syncToken) {
|
} else if (oldWidget.syncToken != widget.syncToken) {
|
||||||
// The socket was replaced; re-read through the existing controller so the
|
// The socket was replaced; re-read through the existing controller so the
|
||||||
// selected pipeline and requested version survive the reconnect.
|
// selected pipeline and requested version survive the reconnect.
|
||||||
@@ -129,7 +150,12 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
|||||||
final id = widget.initialPipelineId;
|
final id = widget.initialPipelineId;
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
_controller.clearSelection();
|
_controller.clearSelection();
|
||||||
} else if (!_isRoutePin(_controller.detail)) {
|
} else if (!(_controller.selectedId == id &&
|
||||||
|
// The route caught up with a pipeline opened from the list.
|
||||||
|
((oldWidget.initialPipelineId != id &&
|
||||||
|
widget.initialVersion <= 0) ||
|
||||||
|
_controller.selectedVersion == widget.initialVersion)) &&
|
||||||
|
!_isRoutePin(_controller.detail)) {
|
||||||
_controller.openPipeline(id, version: widget.initialVersion);
|
_controller.openPipeline(id, version: widget.initialVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,61 +71,64 @@ class _RunVisitPaneState extends State<RunVisitPane> {
|
|||||||
final facts = detailVisitFacts(widget.step);
|
final facts = detailVisitFacts(widget.step);
|
||||||
final verdict = detailVisitVerdict(widget.step);
|
final verdict = detailVisitVerdict(widget.step);
|
||||||
final diagnostic = detailVisitDiagnostic(widget.step);
|
final diagnostic = detailVisitDiagnostic(widget.step);
|
||||||
return Column(
|
// The facts take what they need, up to 40% of the height (then scroll);
|
||||||
key: const Key('run-visit-pane'),
|
// the section fills everything else, so the tabs always end at the
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
// bottom of the screen however short the facts or the section are.
|
||||||
children: [
|
return LayoutBuilder(
|
||||||
Flexible(
|
builder: (context, constraints) => Column(
|
||||||
flex: 2,
|
key: const Key('run-visit-pane'),
|
||||||
fit: FlexFit.loose,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
child: SingleChildScrollView(
|
children: [
|
||||||
key: const Key('run-visit-facts'),
|
ConstrainedBox(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8),
|
constraints: BoxConstraints(maxHeight: constraints.maxHeight * 0.4),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
key: const Key('run-visit-facts'),
|
||||||
children: [
|
padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8),
|
||||||
_bar(style),
|
child: Column(
|
||||||
_FactGrid(facts: facts, style: style),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
if (verdict != null) ...[
|
children: [
|
||||||
const SizedBox(height: 8),
|
_bar(style),
|
||||||
Text('Verdict', style: style.heading),
|
_FactGrid(facts: facts, style: style),
|
||||||
if (verdict.option != null) Text(verdict.option!),
|
if (verdict != null) ...[
|
||||||
if (verdict.reason != null)
|
const SizedBox(height: 8),
|
||||||
Text(verdict.reason!, style: style.value),
|
Text('Verdict', style: style.heading),
|
||||||
|
if (verdict.option != null) Text(verdict.option!),
|
||||||
|
if (verdict.reason != null)
|
||||||
|
Text(verdict.reason!, style: style.value),
|
||||||
|
],
|
||||||
|
if (diagnostic != null) ...[
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text('Diagnostic', style: style.heading),
|
||||||
|
Text(diagnostic, style: style.value),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
if (diagnostic != null) ...[
|
),
|
||||||
const SizedBox(height: 8),
|
|
||||||
Text('Diagnostic', style: style.heading),
|
|
||||||
Text(diagnostic, style: style.value),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: runVisitSectionBody(
|
||||||
flex: 5,
|
section: _section,
|
||||||
child: runVisitSectionBody(
|
run: widget.run,
|
||||||
section: _section,
|
step: widget.step,
|
||||||
run: widget.run,
|
visitIndex: widget.visitIndex,
|
||||||
step: widget.step,
|
stageKey: widget.visit.stage,
|
||||||
visitIndex: widget.visitIndex,
|
runSteps: widget.runSteps,
|
||||||
stageKey: widget.visit.stage,
|
gateway: widget.gateway,
|
||||||
runSteps: widget.runSteps,
|
onRunChanged: widget.onRunChanged,
|
||||||
gateway: widget.gateway,
|
configuredEndpoint: widget.configuredEndpoint,
|
||||||
onRunChanged: widget.onRunChanged,
|
cupertino: widget.cupertino,
|
||||||
configuredEndpoint: widget.configuredEndpoint,
|
),
|
||||||
cupertino: widget.cupertino,
|
|
||||||
),
|
),
|
||||||
),
|
// The sections are tabs at the bottom, under what they show.
|
||||||
// The sections are tabs at the bottom, under what they show.
|
SafeArea(
|
||||||
SafeArea(
|
top: false,
|
||||||
top: false,
|
child: RunVisitSectionStrip(
|
||||||
child: RunVisitSectionStrip(
|
selected: _section,
|
||||||
selected: _section,
|
onSelected: (section) => setState(() => _section = section),
|
||||||
onSelected: (section) => setState(() => _section = section),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:pipelines_app/application/app_route.dart';
|
import 'package:pipelines_app/application/app_route.dart';
|
||||||
@@ -169,6 +170,65 @@ void main() {
|
|||||||
expect(find.text('Deep-linked run'), findsWidgets);
|
expect(find.text('Deep-linked run'), findsWidgets);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('Android Back on a wide screen steps out of a run, not the app', (
|
||||||
|
tester,
|
||||||
|
) async {
|
||||||
|
tester.view.physicalSize = const Size(1000, 800);
|
||||||
|
tester.view.devicePixelRatio = 1;
|
||||||
|
addTearDown(tester.view.reset);
|
||||||
|
final exits = <String>[];
|
||||||
|
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
|
||||||
|
SystemChannels.platform,
|
||||||
|
(call) async {
|
||||||
|
if (call.method == 'SystemNavigator.pop') exits.add(call.method);
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
addTearDown(
|
||||||
|
() => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
|
||||||
|
SystemChannels.platform,
|
||||||
|
null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final channel = FakeChannel()..readyCompleter.complete();
|
||||||
|
final client = PipelinesClient(channelFactory: (_) => channel);
|
||||||
|
final provider = PlatformRouteInformationProvider(
|
||||||
|
initialRouteInformation: RouteInformation(uri: Uri.parse('/runs/1')),
|
||||||
|
);
|
||||||
|
addTearDown(provider.dispose);
|
||||||
|
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||||
|
await replyList(
|
||||||
|
tester,
|
||||||
|
channel,
|
||||||
|
runs: [
|
||||||
|
{'id': 1, 'name': 'Deep-linked run', 'status': 'running'},
|
||||||
|
],
|
||||||
|
);
|
||||||
|
await replyDetail(tester, channel, 1);
|
||||||
|
expect(provider.value.uri.path, '/runs/1');
|
||||||
|
|
||||||
|
// The system Back button or gesture.
|
||||||
|
await tester.binding.handlePopRoute();
|
||||||
|
await tester.pump();
|
||||||
|
expect(provider.value.uri.path, '/runs');
|
||||||
|
expect(exits, isEmpty);
|
||||||
|
|
||||||
|
// From the list, Back asks before leaving the app.
|
||||||
|
await tester.binding.handlePopRoute();
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(find.text('Close Pipelines?'), findsOneWidget);
|
||||||
|
await tester.tap(find.byKey(const Key('app-exit-stay')));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(exits, isEmpty);
|
||||||
|
expect(provider.value.uri.path, '/runs');
|
||||||
|
|
||||||
|
await tester.binding.handlePopRoute();
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.byKey(const Key('app-exit-close')));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(exits, ['SystemNavigator.pop']);
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('tabs and run selection update the route; browser Back pops it', (
|
testWidgets('tabs and run selection update the route; browser Back pops it', (
|
||||||
tester,
|
tester,
|
||||||
) async {
|
) async {
|
||||||
|
|||||||
@@ -196,4 +196,24 @@ void main() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (final platform in RunDetailTestPlatform.values) {
|
||||||
|
for (final size in const [
|
||||||
|
Size(390, 844),
|
||||||
|
Size(884, 832),
|
||||||
|
Size(1000, 700),
|
||||||
|
]) {
|
||||||
|
testWidgets(
|
||||||
|
'${platform.name} stage tabs end at the bottom at ${size.width}x${size.height}',
|
||||||
|
(tester) async {
|
||||||
|
await openVisit(tester, platform, size: size);
|
||||||
|
for (final section in shownVisitSections) {
|
||||||
|
await openVisitTab(tester, section);
|
||||||
|
final strip = tester.getRect(find.byType(RunVisitSectionStrip));
|
||||||
|
expect(strip.bottom, size.height, reason: section.name);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user