Format shared Material primitive integration

This commit is contained in:
2026-11-11 21:17:32 +00:00
parent 16dab6d74e
commit 16f4e43ddc
12 changed files with 35 additions and 38 deletions
@@ -108,7 +108,10 @@ class GraphStageNode extends StatelessWidget {
// coloured, smaller text in the status's own hue.
final color = status == null
? null
: runStatusColor(graphStatusState(status), Theme.of(context).colorScheme);
: runStatusColor(
graphStatusState(status),
Theme.of(context).colorScheme,
);
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -238,7 +238,10 @@ class PipelineListPanel extends StatelessWidget {
? null
: AppListStatusDot(
key: Key('pipeline-status-${pipeline.id}'),
color: runStatusColor(badge.state, Theme.of(context).colorScheme),
color: runStatusColor(
badge.state,
Theme.of(context).colorScheme,
),
semanticLabel: runStateLabel(badge.state),
),
subtitle: Text(
@@ -280,10 +283,7 @@ class PipelineListPanel extends StatelessWidget {
/// The pipeline's initial on a tint picked from its id, so neighbouring
/// pipelines are told apart at a glance.
Widget _pipelineIdentityIcon(
BuildContext context,
PipelineSummary pipeline,
) {
Widget _pipelineIdentityIcon(BuildContext context, PipelineSummary pipeline) {
final scheme = Theme.of(context).colorScheme;
final colors = [scheme.primary, scheme.secondary, scheme.tertiary];
return Semantics(
@@ -145,7 +145,7 @@ class RunTimelineRow extends StatelessWidget {
divider: divider,
onTap: onTap,
leading: AppListAvatar(
foreground: runStatusColor(state, Theme.of(context).colorScheme),
foreground: runStatusColor(state, Theme.of(context).colorScheme),
child: RunStatusIcon(
state: state,
label: visit.status.isEmpty ? 'Status unavailable' : visit.status,
+1 -1
View File
@@ -126,7 +126,7 @@ class RunListRow extends StatelessWidget {
onLongPress: selecting ? null : onLongPress,
selectionControl: selecting ? _checkbox(context) : null,
leading: AppListAvatar(
foreground: runStatusColor(state, Theme.of(context).colorScheme),
foreground: runStatusColor(state, Theme.of(context).colorScheme),
child: RunStatusIcon(state: state, label: runStatusLabel(run)),
),
title: Text(title),
+1 -1
View File
@@ -59,7 +59,7 @@ class RunPathMini extends StatelessWidget {
width: 14,
height: 10,
decoration: BoxDecoration(
color: runStatusColor(stage.state, Theme.of(context).colorScheme),
color: runStatusColor(stage.state, Theme.of(context).colorScheme),
borderRadius: BorderRadius.circular(3),
),
);
@@ -14,9 +14,9 @@ import 'runs_controller.dart';
/// Opens the runs' usage and charts on their own page.
Future<void> openRunsStats(BuildContext context, RunsController controller) {
final page = RunsStatsPage(controller: controller);
return Navigator.of(context).push<void>(
MaterialPageRoute<void>(builder: (_) => page),
);
return Navigator.of(
context,
).push<void>(MaterialPageRoute<void>(builder: (_) => page));
}
/// Usage totals, runs by status (a pie) and runs per day for the last week.
@@ -92,7 +92,10 @@ class RunsStatsPage extends StatelessWidget {
painter: _PiePainter([
for (final entry in byState.entries)
(
runStatusColor(entry.key, Theme.of(context).colorScheme),
runStatusColor(
entry.key,
Theme.of(context).colorScheme,
),
entry.value,
),
]),
+11 -11
View File
@@ -86,8 +86,8 @@ class FloatingTabButton extends StatelessWidget {
}
String _tabLabel(BuildContext context) => MaterialLocalizations.of(
context,
).tabLabel(tabIndex: index + 1, tabCount: count);
context,
).tabLabel(tabIndex: index + 1, tabCount: count);
({Color tint, Color selectedIcon, Color icon}) _colors(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
@@ -109,15 +109,15 @@ class FloatingTabButton extends StatelessWidget {
shape: const CircleBorder(),
);
final Widget fill = Ink(
key: fillKey,
decoration: decoration,
child: InkResponse(
onTap: onTap,
customBorder: const CircleBorder(),
containedInkWell: true,
highlightShape: BoxShape.circle,
),
);
key: fillKey,
decoration: decoration,
child: InkResponse(
onTap: onTap,
customBorder: const CircleBorder(),
containedInkWell: true,
highlightShape: BoxShape.circle,
),
);
Widget glyph = IconTheme.merge(
data: IconThemeData(
size: iconSize,
+1 -3
View File
@@ -22,9 +22,7 @@ class AdaptiveResizeGrip extends StatelessWidget {
color: Theme.of(context).colorScheme.surfaceContainerHigh,
borderRadius: BorderRadius.circular(8),
border: emphasized
? Border.all(
color: Theme.of(context).colorScheme.primary,
)
? Border.all(color: Theme.of(context).colorScheme.primary)
: null,
),
child: Padding(
@@ -122,5 +122,4 @@ class SegmentedMoreButton extends StatelessWidget {
),
);
}
}
@@ -5,8 +5,7 @@ import 'segmented_bar_motion.dart';
/// The smallest height of every piece of a [SegmentedBar]: the platform's
/// minimum touch target, so a round Back is a circle.
double segmentedPieceHeight(bool cupertino) =>
kMinInteractiveDimension;
double segmentedPieceHeight(bool cupertino) => kMinInteractiveDimension;
/// One rounded piece of a segmented bar: a [GlassPill] at least the
/// platform's touch-target size.
@@ -21,6 +21,7 @@ class BarIconButton extends StatelessWidget {
});
final IconData icon;
/// Retained for source compatibility; Material rendering always uses [icon].
final IconData? cupertinoIcon;
@@ -45,13 +45,7 @@ void main() {
final scheme = Theme.of(
tester.element(find.byKey(const Key('run-path-mini'))),
).colorScheme;
expect(
colors,
contains(runStatusColor('succeeded', scheme).toARGB32()),
);
expect(
colors,
contains(runStatusColor('failed', scheme).toARGB32()),
);
expect(colors, contains(runStatusColor('succeeded', scheme).toARGB32()));
expect(colors, contains(runStatusColor('failed', scheme).toARGB32()));
});
}