Merge commit '09389f18cb01effd9c855e5b91722ade4816395a' into tab-spacing-anim
This commit is contained in:
@@ -111,6 +111,34 @@ class _RunDetailViewState extends State<RunDetailView> {
|
|||||||
final subtitle = detailSubtitle(run);
|
final subtitle = detailSubtitle(run);
|
||||||
final openPipeline = _openPipeline(run);
|
final openPipeline = _openPipeline(run);
|
||||||
final pipelineName = detailPipeline(run);
|
final pipelineName = detailPipeline(run);
|
||||||
|
final pipelineAction = openPipeline == null
|
||||||
|
? null
|
||||||
|
: (cupertino
|
||||||
|
? Semantics(
|
||||||
|
button: true,
|
||||||
|
label: 'Open pipeline $pipelineName',
|
||||||
|
child: CupertinoButton(
|
||||||
|
key: runPipelineLinkKey,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
minimumSize: Size.zero,
|
||||||
|
onPressed: openPipeline,
|
||||||
|
child: const Icon(CupertinoIcons.arrow_branch),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Semantics(
|
||||||
|
button: true,
|
||||||
|
label: 'Open pipeline $pipelineName',
|
||||||
|
excludeSemantics: true,
|
||||||
|
child: GestureDetector(
|
||||||
|
key: runPipelineLinkKey,
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: openPipeline,
|
||||||
|
child: const Padding(
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
child: Icon(Icons.account_tree_outlined),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
final more = RunMoreMenu(
|
final more = RunMoreMenu(
|
||||||
run: run,
|
run: run,
|
||||||
gateway: widget.gateway,
|
gateway: widget.gateway,
|
||||||
@@ -124,10 +152,9 @@ class _RunDetailViewState extends State<RunDetailView> {
|
|||||||
title: title,
|
title: title,
|
||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
onTitlePressed: openPipeline,
|
onTitlePressed: openPipeline,
|
||||||
titleSemanticLabel: openPipeline == null
|
expandableTitle: true,
|
||||||
? null
|
titleAction: pipelineAction,
|
||||||
: 'Open pipeline $pipelineName',
|
titleSemanticLabel: 'Run title $title',
|
||||||
titleKey: openPipeline == null ? null : runPipelineLinkKey,
|
|
||||||
onBack: widget.onBack,
|
onBack: widget.onBack,
|
||||||
actions: [more],
|
actions: [more],
|
||||||
child: detail,
|
child: detail,
|
||||||
@@ -145,10 +172,9 @@ class _RunDetailViewState extends State<RunDetailView> {
|
|||||||
title: title,
|
title: title,
|
||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
onTitlePressed: openPipeline,
|
onTitlePressed: openPipeline,
|
||||||
titleSemanticLabel: openPipeline == null
|
expandableTitle: true,
|
||||||
? null
|
titleAction: pipelineAction,
|
||||||
: 'Open pipeline $pipelineName',
|
titleSemanticLabel: 'Run title $title',
|
||||||
titleKey: openPipeline == null ? null : runPipelineLinkKey,
|
|
||||||
actions: [more],
|
actions: [more],
|
||||||
),
|
),
|
||||||
child: detail,
|
child: detail,
|
||||||
|
|||||||
@@ -277,6 +277,8 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
|||||||
subtitle: spec?.subtitle,
|
subtitle: spec?.subtitle,
|
||||||
subtitleIcon: spec?.subtitleIcon,
|
subtitleIcon: spec?.subtitleIcon,
|
||||||
onTitlePressed: spec?.onTitlePressed,
|
onTitlePressed: spec?.onTitlePressed,
|
||||||
|
expandableTitle: spec?.expandableTitle ?? false,
|
||||||
|
titleAction: spec?.titleAction,
|
||||||
titleSemanticLabel: spec?.titleSemanticLabel,
|
titleSemanticLabel: spec?.titleSemanticLabel,
|
||||||
titleKey: spec?.titleKey,
|
titleKey: spec?.titleKey,
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
@@ -144,6 +144,8 @@ class _DetailPaneState extends State<DetailPane> {
|
|||||||
subtitle: spec?.subtitle,
|
subtitle: spec?.subtitle,
|
||||||
subtitleIcon: spec?.subtitleIcon,
|
subtitleIcon: spec?.subtitleIcon,
|
||||||
onTitlePressed: spec?.onTitlePressed,
|
onTitlePressed: spec?.onTitlePressed,
|
||||||
|
expandableTitle: spec?.expandableTitle ?? false,
|
||||||
|
titleAction: spec?.titleAction,
|
||||||
titleSemanticLabel: spec?.titleSemanticLabel,
|
titleSemanticLabel: spec?.titleSemanticLabel,
|
||||||
titleKey: spec?.titleKey,
|
titleKey: spec?.titleKey,
|
||||||
actions: actions,
|
actions: actions,
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ class ShellBarSpec {
|
|||||||
this.subtitle,
|
this.subtitle,
|
||||||
this.subtitleIcon,
|
this.subtitleIcon,
|
||||||
this.onTitlePressed,
|
this.onTitlePressed,
|
||||||
|
this.expandableTitle = false,
|
||||||
|
this.titleAction,
|
||||||
this.titleSemanticLabel,
|
this.titleSemanticLabel,
|
||||||
this.titleKey,
|
this.titleKey,
|
||||||
this.onBack,
|
this.onBack,
|
||||||
@@ -38,6 +40,8 @@ class ShellBarSpec {
|
|||||||
|
|
||||||
/// Makes the title pill a button; see `SegmentedBar.onTitlePressed`.
|
/// Makes the title pill a button; see `SegmentedBar.onTitlePressed`.
|
||||||
final VoidCallback? onTitlePressed;
|
final VoidCallback? onTitlePressed;
|
||||||
|
final bool expandableTitle;
|
||||||
|
final Widget? titleAction;
|
||||||
final String? titleSemanticLabel;
|
final String? titleSemanticLabel;
|
||||||
final Key? titleKey;
|
final Key? titleKey;
|
||||||
final VoidCallback? onBack;
|
final VoidCallback? onBack;
|
||||||
@@ -136,6 +140,8 @@ class ShellBar extends StatefulWidget {
|
|||||||
this.subtitle,
|
this.subtitle,
|
||||||
this.subtitleIcon,
|
this.subtitleIcon,
|
||||||
this.onTitlePressed,
|
this.onTitlePressed,
|
||||||
|
this.expandableTitle = false,
|
||||||
|
this.titleAction,
|
||||||
this.titleSemanticLabel,
|
this.titleSemanticLabel,
|
||||||
this.titleKey,
|
this.titleKey,
|
||||||
this.onBack,
|
this.onBack,
|
||||||
@@ -168,6 +174,8 @@ class ShellBar extends StatefulWidget {
|
|||||||
final String? subtitle;
|
final String? subtitle;
|
||||||
final IconData? subtitleIcon;
|
final IconData? subtitleIcon;
|
||||||
final VoidCallback? onTitlePressed;
|
final VoidCallback? onTitlePressed;
|
||||||
|
final bool expandableTitle;
|
||||||
|
final Widget? titleAction;
|
||||||
final String? titleSemanticLabel;
|
final String? titleSemanticLabel;
|
||||||
final Key? titleKey;
|
final Key? titleKey;
|
||||||
final VoidCallback? onBack;
|
final VoidCallback? onBack;
|
||||||
@@ -207,6 +215,8 @@ class _ShellBarState extends State<ShellBar> {
|
|||||||
subtitle: widget.subtitle,
|
subtitle: widget.subtitle,
|
||||||
subtitleIcon: widget.subtitleIcon,
|
subtitleIcon: widget.subtitleIcon,
|
||||||
onTitlePressed: widget.onTitlePressed,
|
onTitlePressed: widget.onTitlePressed,
|
||||||
|
expandableTitle: widget.expandableTitle,
|
||||||
|
titleAction: widget.titleAction,
|
||||||
titleSemanticLabel: widget.titleSemanticLabel,
|
titleSemanticLabel: widget.titleSemanticLabel,
|
||||||
titleKey: widget.titleKey,
|
titleKey: widget.titleKey,
|
||||||
onBack: widget.onBack,
|
onBack: widget.onBack,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export 'segmented_bar_pieces.dart' show SegmentedBackButton, SegmentedPill;
|
|||||||
/// bar's height through [MediaQuery.paddingOf], so a page keeps its
|
/// bar's height through [MediaQuery.paddingOf], so a page keeps its
|
||||||
/// scaffold's structure; [SegmentedBarOverlay] does the same anywhere else.
|
/// scaffold's structure; [SegmentedBarOverlay] does the same anywhere else.
|
||||||
/// It handles the top safe area itself.
|
/// It handles the top safe area itself.
|
||||||
class SegmentedBar extends StatelessWidget
|
class SegmentedBar extends StatefulWidget
|
||||||
implements ObstructingPreferredSizeWidget {
|
implements ObstructingPreferredSizeWidget {
|
||||||
const SegmentedBar({
|
const SegmentedBar({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -41,6 +41,8 @@ class SegmentedBar extends StatelessWidget
|
|||||||
this.subtitle,
|
this.subtitle,
|
||||||
this.subtitleIcon,
|
this.subtitleIcon,
|
||||||
this.onTitlePressed,
|
this.onTitlePressed,
|
||||||
|
this.expandableTitle = false,
|
||||||
|
this.titleAction,
|
||||||
this.titleSemanticLabel,
|
this.titleSemanticLabel,
|
||||||
this.titleKey,
|
this.titleKey,
|
||||||
this.actions = const [],
|
this.actions = const [],
|
||||||
@@ -79,6 +81,12 @@ class SegmentedBar extends StatelessWidget
|
|||||||
|
|
||||||
/// Makes the title pill a button (an information page, a picker).
|
/// Makes the title pill a button (an information page, a picker).
|
||||||
final VoidCallback? onTitlePressed;
|
final VoidCallback? onTitlePressed;
|
||||||
|
|
||||||
|
/// Lets the title expand over the content without changing bar clearance.
|
||||||
|
final bool expandableTitle;
|
||||||
|
|
||||||
|
/// An action shown inside the expanded title pill.
|
||||||
|
final Widget? titleAction;
|
||||||
final String? titleSemanticLabel;
|
final String? titleSemanticLabel;
|
||||||
|
|
||||||
/// The key of the title's button (or its content when not pressable).
|
/// The key of the title's button (or its content when not pressable).
|
||||||
@@ -142,14 +150,74 @@ class SegmentedBar extends StatelessWidget
|
|||||||
Theme.of(context).scaffoldBackgroundColor;
|
Theme.of(context).scaffoldBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SegmentedBar> createState() => _SegmentedBarState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SegmentedBarState extends State<SegmentedBar> {
|
||||||
|
bool _expanded = false;
|
||||||
|
|
||||||
|
/// The expanded title is drawn in the overlay, anchored to the collapsed
|
||||||
|
/// pill: drawn inside the bar it would overflow the bar's bounds, where
|
||||||
|
/// its pipeline action could be seen but not tapped.
|
||||||
|
final _titleLink = LayerLink();
|
||||||
|
final _expandedTitle = OverlayPortalController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(covariant SegmentedBar oldWidget) {
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
if (oldWidget.title != widget.title ||
|
||||||
|
oldWidget.subtitle != widget.subtitle) {
|
||||||
|
_expanded = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _toggleTitle() {
|
||||||
|
// The portal stays attached once used and draws nothing while
|
||||||
|
// collapsed, so collapsing on a new run (during a rebuild) needs no
|
||||||
|
// overlay call.
|
||||||
|
if (!_expandedTitle.isShowing) _expandedTitle.show();
|
||||||
|
setState(() => _expanded = !_expanded);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final cupertino = widget.cupertino;
|
||||||
|
final title = widget.title;
|
||||||
|
final titleWidget = widget.titleWidget;
|
||||||
|
final titleWidgetMaxWidth = widget.titleWidgetMaxWidth;
|
||||||
|
final leadingWidget = widget.leading;
|
||||||
|
final automaticallyImplyLeading = widget.automaticallyImplyLeading;
|
||||||
|
final subtitle = widget.subtitle;
|
||||||
|
final subtitleIcon = widget.subtitleIcon;
|
||||||
|
final onTitlePressed = widget.onTitlePressed;
|
||||||
|
final titleSemanticLabel = widget.titleSemanticLabel;
|
||||||
|
final titleKey = widget.titleKey;
|
||||||
|
final actions = widget.actions;
|
||||||
|
final pillColor = widget.pillColor;
|
||||||
|
final foregroundColor = widget.foregroundColor;
|
||||||
|
final bottomPadding = widget.bottomPadding;
|
||||||
final leading =
|
final leading =
|
||||||
this.leading ??
|
leadingWidget ??
|
||||||
(automaticallyImplyLeading
|
(automaticallyImplyLeading
|
||||||
? impliedSegmentedLeading(context, cupertino)
|
? impliedSegmentedLeading(context, cupertino)
|
||||||
: null);
|
: null);
|
||||||
final showTitle = title.isNotEmpty || (subtitle ?? '').isNotEmpty;
|
final showTitle = title.isNotEmpty || (subtitle ?? '').isNotEmpty;
|
||||||
|
Widget titlePill(bool expanded) => SegmentedTitlePill(
|
||||||
|
cupertino: cupertino,
|
||||||
|
title: title,
|
||||||
|
subtitle: subtitle,
|
||||||
|
subtitleIcon: subtitleIcon,
|
||||||
|
onPressed: widget.expandableTitle ? _toggleTitle : onTitlePressed,
|
||||||
|
semanticLabel: widget.expandableTitle
|
||||||
|
? '${titleSemanticLabel ?? title}, ${expanded ? 'expanded' : 'collapsed'}'
|
||||||
|
: titleSemanticLabel,
|
||||||
|
buttonKey: expanded ? null : titleKey,
|
||||||
|
expanded: expanded,
|
||||||
|
titleAction: expanded ? widget.titleAction : null,
|
||||||
|
foreground: foregroundColor,
|
||||||
|
fill: pillColor,
|
||||||
|
);
|
||||||
final Widget bar = LayoutBuilder(
|
final Widget bar = LayoutBuilder(
|
||||||
builder: (context, constraints) => Row(
|
builder: (context, constraints) => Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -182,17 +250,37 @@ class SegmentedBar extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
: showTitle && !widget.expandableTitle
|
||||||
|
? titlePill(false)
|
||||||
: showTitle
|
: showTitle
|
||||||
? SegmentedTitlePill(
|
? LayoutBuilder(
|
||||||
cupertino: cupertino,
|
builder: (context, titleSpace) => OverlayPortal(
|
||||||
title: title,
|
controller: _expandedTitle,
|
||||||
subtitle: subtitle,
|
overlayChildBuilder: (context) =>
|
||||||
subtitleIcon: subtitleIcon,
|
!(_expanded && widget.expandableTitle)
|
||||||
onPressed: onTitlePressed,
|
? const SizedBox.shrink()
|
||||||
semanticLabel: titleSemanticLabel,
|
: Positioned(
|
||||||
buttonKey: titleKey,
|
top: 0,
|
||||||
foreground: foregroundColor,
|
left: 0,
|
||||||
fill: pillColor,
|
child: CompositedTransformFollower(
|
||||||
|
link: _titleLink,
|
||||||
|
showWhenUnlinked: false,
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: titleSpace.maxWidth,
|
||||||
|
),
|
||||||
|
child: titlePill(true),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: CompositedTransformTarget(
|
||||||
|
link: _titleLink,
|
||||||
|
child: ExcludeSemantics(
|
||||||
|
excluding: _expanded && widget.expandableTitle,
|
||||||
|
child: titlePill(false),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: const SizedBox.shrink(),
|
: const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
@@ -211,7 +299,7 @@ class SegmentedBar extends StatelessWidget
|
|||||||
? 0
|
? 0
|
||||||
: segmentedPieceHeight(cupertino) + 8) -
|
: segmentedPieceHeight(cupertino) + 8) -
|
||||||
8 -
|
8 -
|
||||||
constraints.maxWidth * minTitleShare,
|
constraints.maxWidth * SegmentedBar.minTitleShare,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SegmentedPill(
|
child: SegmentedPill(
|
||||||
@@ -230,7 +318,7 @@ class SegmentedBar extends StatelessWidget
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final background = _background(context);
|
final background = widget._background(context);
|
||||||
final inset = MediaQuery.paddingOf(context).top;
|
final inset = MediaQuery.paddingOf(context).top;
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -271,12 +359,12 @@ class SegmentedBar extends StatelessWidget
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
12,
|
12,
|
||||||
_topPadding,
|
SegmentedBar._topPadding,
|
||||||
12,
|
12,
|
||||||
bottomPadding,
|
bottomPadding,
|
||||||
),
|
),
|
||||||
child: MediaQuery.withClampedTextScaling(
|
child: MediaQuery.withClampedTextScaling(
|
||||||
maxScaleFactor: maxTextScale,
|
maxScaleFactor: SegmentedBar.maxTextScale,
|
||||||
child: bar,
|
child: bar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ class SegmentedTitlePill extends StatelessWidget {
|
|||||||
this.onPressed,
|
this.onPressed,
|
||||||
this.semanticLabel,
|
this.semanticLabel,
|
||||||
this.buttonKey,
|
this.buttonKey,
|
||||||
|
this.expanded = false,
|
||||||
|
this.titleAction,
|
||||||
this.foreground,
|
this.foreground,
|
||||||
this.fill,
|
this.fill,
|
||||||
});
|
});
|
||||||
@@ -107,6 +109,8 @@ class SegmentedTitlePill extends StatelessWidget {
|
|||||||
|
|
||||||
/// The key of the pressable title, for finders.
|
/// The key of the pressable title, for finders.
|
||||||
final Key? buttonKey;
|
final Key? buttonKey;
|
||||||
|
final bool expanded;
|
||||||
|
final Widget? titleAction;
|
||||||
final Color? foreground;
|
final Color? foreground;
|
||||||
final Color? fill;
|
final Color? fill;
|
||||||
|
|
||||||
@@ -137,44 +141,56 @@ class SegmentedTitlePill extends StatelessWidget {
|
|||||||
final subtitle = this.subtitle ?? '';
|
final subtitle = this.subtitle ?? '';
|
||||||
final content = Padding(
|
final content = Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||||
child: Column(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Semantics(
|
Flexible(
|
||||||
header: true,
|
child: Column(
|
||||||
child: Text(
|
mainAxisSize: MainAxisSize.min,
|
||||||
title,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
maxLines: 1,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
overflow: TextOverflow.ellipsis,
|
children: [
|
||||||
style: titleStyle,
|
Semantics(
|
||||||
|
header: true,
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
maxLines: expanded ? null : 1,
|
||||||
|
overflow: expanded
|
||||||
|
? TextOverflow.visible
|
||||||
|
: TextOverflow.ellipsis,
|
||||||
|
style: titleStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (subtitle.isNotEmpty)
|
||||||
|
// One line that ellipsises as a whole, so a narrow pill never
|
||||||
|
// overflows on the icon.
|
||||||
|
Text.rich(
|
||||||
|
TextSpan(
|
||||||
|
children: [
|
||||||
|
if (subtitleIcon != null) ...[
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: Icon(
|
||||||
|
subtitleIcon,
|
||||||
|
size: subtitleStyle.fontSize,
|
||||||
|
color: subtitleStyle.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(text: ' '),
|
||||||
|
],
|
||||||
|
TextSpan(text: subtitle),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
maxLines: expanded ? null : 1,
|
||||||
|
overflow: expanded
|
||||||
|
? TextOverflow.visible
|
||||||
|
: TextOverflow.ellipsis,
|
||||||
|
style: subtitleStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (subtitle.isNotEmpty)
|
|
||||||
// One line that ellipsises as a whole, so a narrow pill never
|
|
||||||
// overflows on the icon.
|
|
||||||
Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [
|
|
||||||
if (subtitleIcon != null) ...[
|
|
||||||
WidgetSpan(
|
|
||||||
alignment: PlaceholderAlignment.middle,
|
|
||||||
child: Icon(
|
|
||||||
subtitleIcon,
|
|
||||||
size: subtitleStyle.fontSize,
|
|
||||||
color: subtitleStyle.color,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(text: ' '),
|
|
||||||
],
|
|
||||||
TextSpan(text: subtitle),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: subtitleStyle,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -200,6 +216,19 @@ class SegmentedTitlePill extends StatelessWidget {
|
|||||||
: InkWell(key: buttonKey, onTap: onPressed, child: content),
|
: InkWell(key: buttonKey, onTap: onPressed, child: content),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return SegmentedPill(cupertino: cupertino, fill: fill, child: body);
|
return SegmentedPill(
|
||||||
|
cupertino: cupertino,
|
||||||
|
fill: fill,
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
child: IntrinsicWidth(child: body),
|
||||||
|
),
|
||||||
|
?titleAction,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ void main() {
|
|||||||
cupertino,
|
cupertino,
|
||||||
onOpenPipeline: (id, version) => opened.add((id, version)),
|
onOpenPipeline: (id, version) => opened.add((id, version)),
|
||||||
);
|
);
|
||||||
|
// The title expands first; the pipeline action is intentionally only
|
||||||
|
// available in that expanded state.
|
||||||
|
await tester.tap(find.text('Nightly build').first);
|
||||||
|
await tester.pump();
|
||||||
await tester.tap(find.byKey(runPipelineLinkKey));
|
await tester.tap(find.byKey(runPipelineLinkKey));
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
expect(opened, [(10, 3)]);
|
expect(opened, [(10, 3)]);
|
||||||
|
|||||||
Reference in New Issue
Block a user