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>
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
import 'package:clide/widgets/src/clide_settings.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
/// Themed container. Replaces Material's Card / Scaffold body surfaces
|
|
/// for clide widgets — pulls color, border, and padding from the
|
|
/// current theme's surface tokens.
|
|
class ClideSurface extends StatelessWidget {
|
|
const ClideSurface({super.key, this.child, this.color, this.border, this.padding = EdgeInsets.zero, this.width, this.height, this.borderRadius});
|
|
|
|
final Widget? child;
|
|
final Color? color;
|
|
final Color? border;
|
|
final EdgeInsetsGeometry padding;
|
|
final double? width;
|
|
final double? height;
|
|
final BorderRadius? borderRadius;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final tokens = ClideSettings.theme.of(context).surface;
|
|
return Container(
|
|
width: width,
|
|
height: height,
|
|
padding: padding,
|
|
decoration: BoxDecoration(
|
|
color: color ?? tokens.panelBackground,
|
|
border: border == null ? null : Border.all(color: border!, width: 1),
|
|
borderRadius: borderRadius,
|
|
),
|
|
child: child,
|
|
);
|
|
}
|
|
}
|