Remove Cupertino UI branches from shared primitives
Keep the existing Material rendering, semantics, and interaction paths while removing obsolete Cupertino imports, alternate widgets, and dynamic-color dependencies. Record focused verification and remaining fixture limitations for final integration.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// The shared status glyph whose tooltip and accessible name say the state.
|
||||
@@ -21,7 +20,7 @@ class RunStatusIcon extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = runStatusColor(state).resolveFrom(context);
|
||||
final color = runStatusColor(state, Theme.of(context).colorScheme);
|
||||
return Tooltip(
|
||||
message: label,
|
||||
child: Semantics(
|
||||
@@ -35,14 +34,17 @@ class RunStatusIcon extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// The dynamic colour for a run state, shared by every status glyph.
|
||||
CupertinoDynamicColor runStatusColor(String state) => switch (state) {
|
||||
'succeeded' => CupertinoColors.systemGreen,
|
||||
'failed' => CupertinoColors.systemRed,
|
||||
'running' || 'active' => CupertinoColors.systemBlue,
|
||||
'waiting' => CupertinoColors.systemYellow,
|
||||
'interrupted' => CupertinoColors.systemOrange,
|
||||
_ => CupertinoColors.systemGrey,
|
||||
};
|
||||
Color runStatusColor(String state, [ColorScheme? colorScheme]) {
|
||||
final scheme = colorScheme ?? const ColorScheme.light();
|
||||
return switch (state) {
|
||||
'succeeded' => scheme.tertiary,
|
||||
'failed' => scheme.error,
|
||||
'running' || 'active' => scheme.primary,
|
||||
'waiting' => scheme.secondary,
|
||||
'interrupted' => scheme.tertiary,
|
||||
_ => scheme.onSurfaceVariant,
|
||||
};
|
||||
}
|
||||
|
||||
IconData _materialIcon(String state) => switch (state) {
|
||||
'succeeded' => Icons.check_circle_outline,
|
||||
@@ -65,7 +67,7 @@ class RunStatusKicker extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = runStatusColor(state).resolveFrom(context);
|
||||
final color = runStatusColor(state, Theme.of(context).colorScheme);
|
||||
return Row(
|
||||
key: const Key('run-status-kicker'),
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
Reference in New Issue
Block a user