Files
clide/lib/builtin/ipc_status/src/status_item.dart
T
jpmschweitzerandClaude Opus 4.8 18cd945380 refactor(theme): route consumer reads through ClideSettings.theme (T-473)
Migrate ClideTheme.of(context) reads across the widget, feature, and shell
layers to the unified ClideSettings.theme.of(context) facade (D-101), so
theme/i18n/fonts/settings share one widget-facing entry. The facade delegates
straight to ClideTheme, so behaviour is unchanged — goldens are unmoved.

The low-level theme provider keeps its direct ClideTheme.of: the facade is
built on it, and the two kernel sites (ClideTheme's own definition + the
panels drag-resize widget) stay direct to avoid a widgets→kernel import cycle.
Dead controller.dart/kernel.dart imports left by the sweep removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 21:47:15 +02:00

51 lines
1.5 KiB
Dart

import 'package:clide/kernel/kernel.dart';
import 'package:clide/widgets/widgets.dart';
import 'package:flutter/widgets.dart';
class ToolStatusItem extends StatelessWidget {
const ToolStatusItem({super.key});
@override
Widget build(BuildContext context) {
final kernel = ClideKernel.of(context);
final tokens = ClideSettings.theme.of(context).surface;
return ListenableBuilder(
listenable: kernel.toolchain,
builder: (ctx, _) {
final tc = kernel.toolchain;
if (!tc.resolved) return const SizedBox.shrink();
if (tc.allOk) {
return _chip('application ok', tokens.statusSuccess, tokens);
}
return Row(
mainAxisSize: MainAxisSize.min,
children: [
for (var i = 0; i < tc.missing.length; i++) ...[
if (i > 0) const SizedBox(width: 10),
_chip('${tc.missing[i]} not found', tokens.statusWarning, tokens),
],
],
);
},
);
}
Widget _chip(String label, Color color, SurfaceTokens tokens) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 7,
height: 7,
decoration: BoxDecoration(color: color, shape: BoxShape.circle),
),
const SizedBox(width: 6),
ClideText(label, fontSize: clideFontCaption, color: color),
],
),
);
}
}