Some checks failed
Security / Security check (push) Failing after 2s
The Studio design system, widgets and helpers carried a Fai* / fai_ prefix (FaiSpace, FaiColors, FaiTheme, FaiLog, 17 fai_*.dart files, the faiBinary* l10n keys). Studio is the Ch∆In product, so rename them to Chain* / chain_ — carefully preserving English fail/failure/failed. Also fix stale references: the 'fai' binary in l10n strings -> 'chain', FAI_* env vars (FAI_BIN/DATA_DIR/MODULES_DIR/TODAY/BOOTSTRAP_TOKEN) -> CHAIN_*, fai_platform -> fai_chain, fai_hub -> chain_hub. Vendor security-hook tooling (FAI_BANNED_TERMS_FILE) + the .fai bundle ext left. flutter analyze + test: clean (20 passed). Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
83 lines
2.5 KiB
Dart
83 lines
2.5 KiB
Dart
// ChainCard — flat card with subtle accent gradient on the top
|
|
// border. Replaces Material's default Card for the Ch∆In look.
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../theme/tokens.dart';
|
|
|
|
class ChainCard extends StatelessWidget {
|
|
/// Card body. Padding is applied internally; pass plain content.
|
|
final Widget child;
|
|
|
|
/// When true, paint a 2px accent-coloured stripe along the top
|
|
/// edge. Used by foreground / "this matters" cards (a pending
|
|
/// approval, a failed step).
|
|
final bool accentTop;
|
|
|
|
/// When true, paint a faint vertical accent stripe on the left.
|
|
/// Used by status rows (live event, healthy service).
|
|
final Color? accentLeft;
|
|
|
|
/// Internal padding. Defaults to [ChainSpace.lg].
|
|
final EdgeInsetsGeometry padding;
|
|
|
|
const ChainCard({
|
|
super.key,
|
|
required this.child,
|
|
this.accentTop = false,
|
|
this.accentLeft,
|
|
this.padding = const EdgeInsets.all(ChainSpace.lg),
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: theme.colorScheme.surfaceContainer,
|
|
borderRadius: BorderRadius.circular(ChainRadius.md),
|
|
border: Border.all(color: theme.colorScheme.outlineVariant),
|
|
),
|
|
clipBehavior: Clip.antiAlias,
|
|
child: Stack(
|
|
children: [
|
|
if (accentTop)
|
|
Positioned(
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
height: 2,
|
|
child: DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
colors: [
|
|
theme.colorScheme.primary.withValues(alpha: 0.0),
|
|
theme.colorScheme.primary,
|
|
theme.colorScheme.primary.withValues(alpha: 0.0),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
if (accentLeft != null)
|
|
Positioned(
|
|
top: ChainSpace.md,
|
|
bottom: ChainSpace.md,
|
|
left: 0,
|
|
width: 3,
|
|
child: DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
color: accentLeft,
|
|
borderRadius: const BorderRadius.only(
|
|
topRight: Radius.circular(2),
|
|
bottomRight: Radius.circular(2),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(padding: padding, child: child),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|