|
| 1 | +import 'package:shadcn_flutter/shadcn_flutter.dart'; |
| 2 | + |
| 3 | +import '../../widgets/code_card.dart'; |
| 4 | + |
| 5 | +class CardsScreen extends StatelessWidget { |
| 6 | + const CardsScreen({super.key}); |
| 7 | + |
| 8 | + @override |
| 9 | + Widget build(BuildContext context) { |
| 10 | + return ConstrainedBox( |
| 11 | + constraints: BoxConstraints(maxWidth: 752), |
| 12 | + child: Column( |
| 13 | + crossAxisAlignment: CrossAxisAlignment.stretch, |
| 14 | + children: [ |
| 15 | + Text('Card Komponente verwenden').h3, |
| 16 | + CodeCard( |
| 17 | + title: "Basis Card", |
| 18 | + example: SizedBox( |
| 19 | + width: double.infinity, |
| 20 | + child: Card( |
| 21 | + child: Basic( |
| 22 | + title: Text('Basis Card').base, |
| 23 | + subtitle: Text( |
| 24 | + 'Eine einfache Card-Komponente mit Titel und Text.', |
| 25 | + ).small, |
| 26 | + titleSpacing: 20, |
| 27 | + content: LinkButton( |
| 28 | + density: ButtonDensity.compact, |
| 29 | + onPressed: () {}, |
| 30 | + trailing: Icon(LucideIcons.arrowRight), |
| 31 | + child: Text('Mehr erfahren'), |
| 32 | + ), |
| 33 | + ), |
| 34 | + ), |
| 35 | + ), |
| 36 | + lines: [ |
| 37 | + CodeTextLine("Card("), |
| 38 | + CodeTextLine(" child: Basic("), |
| 39 | + CodeTextLine(" title: Text('Basis Card').base,"), |
| 40 | + CodeTextLine(" subtitle: Text("), |
| 41 | + CodeTextLine( |
| 42 | + " 'Eine einfache Card-Komponente mit Titel und Text.'", |
| 43 | + ), |
| 44 | + CodeTextLine(" ).small,"), |
| 45 | + CodeTextLine(" titleSpacing: 20,"), |
| 46 | + CodeTextLine(" content: LinkButton("), |
| 47 | + CodeTextLine(" density: ButtonDensity.compact,"), |
| 48 | + CodeTextLine(" onPressed: () {},"), |
| 49 | + CodeTextLine(" trailing: Icon(LucideIcons.arrowRight),"), |
| 50 | + CodeTextLine(" child: Text('Mehr erfahren'),"), |
| 51 | + CodeTextLine(" ),"), |
| 52 | + CodeTextLine(" ),"), |
| 53 | + CodeTextLine(");"), |
| 54 | + ], |
| 55 | + ), |
| 56 | + CodeCard( |
| 57 | + title: "Basis Card mit Icon", |
| 58 | + example: SizedBox( |
| 59 | + width: double.infinity, |
| 60 | + child: Card( |
| 61 | + child: Column( |
| 62 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 63 | + children: [ |
| 64 | + IconContainer(icon: Icon(LucideIcons.info)), |
| 65 | + Basic( |
| 66 | + title: Text('Basis Card').base, |
| 67 | + subtitle: Text( |
| 68 | + 'Eine einfache Card-Komponente mit Titel und Text.', |
| 69 | + ).small, |
| 70 | + titleSpacing: 20, |
| 71 | + content: LinkButton( |
| 72 | + density: ButtonDensity.compact, |
| 73 | + onPressed: () {}, |
| 74 | + trailing: Icon(LucideIcons.arrowRight), |
| 75 | + child: Text('Mehr erfahren'), |
| 76 | + ), |
| 77 | + ), |
| 78 | + ], |
| 79 | + ), |
| 80 | + ), |
| 81 | + ), |
| 82 | + lines: [ |
| 83 | + CodeTextLine("Card("), |
| 84 | + CodeTextLine(" child: Basic("), |
| 85 | + CodeTextLine(" title: Text('Basis Card').base,"), |
| 86 | + CodeTextLine(" subtitle: Text("), |
| 87 | + CodeTextLine( |
| 88 | + " 'Eine einfache Card-Komponente mit Titel und Text.'", |
| 89 | + ), |
| 90 | + CodeTextLine(" ).small,"), |
| 91 | + CodeTextLine(" titleSpacing: 20,"), |
| 92 | + CodeTextLine(" content: LinkButton("), |
| 93 | + CodeTextLine(" density: ButtonDensity.compact,"), |
| 94 | + CodeTextLine(" onPressed: () {},"), |
| 95 | + CodeTextLine(" trailing: Icon(LucideIcons.arrowRight),"), |
| 96 | + CodeTextLine(" child: Text('Mehr erfahren'),"), |
| 97 | + CodeTextLine(" ),"), |
| 98 | + CodeTextLine(" ),"), |
| 99 | + CodeTextLine(");"), |
| 100 | + ], |
| 101 | + ), |
| 102 | + ], |
| 103 | + ).gap(15).withPadding(vertical: 30), |
| 104 | + ).withPadding(horizontal: 20); |
| 105 | + } |
| 106 | +} |
0 commit comments