|
| 1 | +import 'package:police_flutter_template/extensions/widget_extensions.dart'; |
| 2 | +import 'package:police_flutter_template/screens/widgets/lists/contact_list.dart'; |
| 3 | +import 'package:police_flutter_template/screens/widgets/lists/icon_list.dart'; |
| 4 | +import 'package:police_flutter_template/screens/widgets/lists/models/contact_list_model.dart'; |
| 5 | +import 'package:police_flutter_template/screens/widgets/lists/models/icon_list_model.dart'; |
| 6 | +import 'package:shadcn_flutter/shadcn_flutter.dart'; |
| 7 | + |
| 8 | +import '../../widgets/code_card.dart'; |
| 9 | + |
| 10 | +class ListsScreen extends StatelessWidget { |
| 11 | + const ListsScreen({super.key}); |
| 12 | + |
| 13 | + @override |
| 14 | + Widget build(BuildContext context) { |
| 15 | + return ConstrainedBox( |
| 16 | + constraints: BoxConstraints(maxWidth: 752), |
| 17 | + child: Column( |
| 18 | + crossAxisAlignment: CrossAxisAlignment.stretch, |
| 19 | + children: [ |
| 20 | + Text('Listen verwenden').h3, |
| 21 | + CodeCard( |
| 22 | + title: "Einfache Liste", |
| 23 | + example: SizedBox( |
| 24 | + width: double.infinity, |
| 25 | + child: Column( |
| 26 | + crossAxisAlignment: CrossAxisAlignment.start, |
| 27 | + children: [ |
| 28 | + const Text('Online-Anzeige erstatten'), |
| 29 | + const Text('Fundstelle melden'), |
| 30 | + const Text('Präventionstipps lesen'), |
| 31 | + const Text('Termine vereinbaren'), |
| 32 | + ], |
| 33 | + ).liIcon(icon: LucideIcons.check, color: Colors.green[600]), |
| 34 | + ), |
| 35 | + lines: [ |
| 36 | + CodeTextLine("Column("), |
| 37 | + CodeTextLine(" crossAxisAlignment: CrossAxisAlignment.start,"), |
| 38 | + CodeTextLine(" children: const ["), |
| 39 | + CodeTextLine(" Text('Online-Anzeige erstatten'),"), |
| 40 | + CodeTextLine(" Text('Fundstelle melden'),"), |
| 41 | + CodeTextLine(" Text('Präventionstipps lesen'),"), |
| 42 | + CodeTextLine(" Text('Termine vereinbaren'),"), |
| 43 | + CodeTextLine(" ],"), |
| 44 | + CodeTextLine( |
| 45 | + ").liIcon(icon: LucideIcons.check, color: Colors.green[600]),", |
| 46 | + ), |
| 47 | + ], |
| 48 | + ), |
| 49 | + CodeCard( |
| 50 | + title: "Liste mit Icons", |
| 51 | + example: SizedBox( |
| 52 | + width: double.infinity, |
| 53 | + child: IconList( |
| 54 | + items: [ |
| 55 | + IconListModel( |
| 56 | + icon: LucideIcons.phone, |
| 57 | + title: "Notruf", |
| 58 | + subtitle: "24/7 erreichbar unter 110", |
| 59 | + ), |
| 60 | + IconListModel( |
| 61 | + icon: LucideIcons.mail, |
| 62 | + title: "E-Mail", |
| 63 | + subtitle: "kontakt@polizei.berlin.de", |
| 64 | + ), |
| 65 | + IconListModel( |
| 66 | + icon: LucideIcons.pin, |
| 67 | + title: "Standorte", |
| 68 | + subtitle: "Über 100 Wachen in Berlin", |
| 69 | + ), |
| 70 | + ], |
| 71 | + ), |
| 72 | + ), |
| 73 | + lines: [ |
| 74 | + CodeTextLine("IconList(items: ["), |
| 75 | + CodeTextLine(" IconListModel("), |
| 76 | + CodeTextLine(" icon: LucideIcons.phone,"), |
| 77 | + CodeTextLine( |
| 78 | + " title: 'Notruf'," |
| 79 | + " subtitle: '24/7 erreichbar unter 110',", |
| 80 | + ), |
| 81 | + CodeTextLine(" ),"), |
| 82 | + CodeTextLine(" IconListModel("), |
| 83 | + CodeTextLine(" icon: LucideIcons.mail,"), |
| 84 | + CodeTextLine( |
| 85 | + " title: 'E-Mail'," |
| 86 | + " subtitle: 'kontakt@polizei.berlin.de',", |
| 87 | + ), |
| 88 | + CodeTextLine(" ),"), |
| 89 | + CodeTextLine(" IconListModel("), |
| 90 | + CodeTextLine(" icon: LucideIcons.pin,"), |
| 91 | + CodeTextLine( |
| 92 | + " title: 'Standorte'," |
| 93 | + " subtitle: 'Über 100 Wachen in Berlin',", |
| 94 | + ), |
| 95 | + CodeTextLine(" ),"), |
| 96 | + CodeTextLine("]),"), |
| 97 | + ], |
| 98 | + ), |
| 99 | + CodeCard( |
| 100 | + title: "Kontakt-Liste", |
| 101 | + example: SizedBox( |
| 102 | + width: double.infinity, |
| 103 | + child: ContactList( |
| 104 | + items: [ |
| 105 | + ContactListModel( |
| 106 | + avatar: Avatar( |
| 107 | + initials: Avatar.getInitials('Maria Schmidt'), |
| 108 | + ), |
| 109 | + title: 'Maria Schmidt', |
| 110 | + subtitle: 'Polizeioberkommissarin • PN-2024-1234', |
| 111 | + ), |
| 112 | + ContactListModel( |
| 113 | + avatar: Avatar( |
| 114 | + initials: Avatar.getInitials('Thomas Müller'), |
| 115 | + ), |
| 116 | + title: 'Thomas Müller', |
| 117 | + subtitle: 'Polizeihauptkommissar • PN-2024-5678', |
| 118 | + ), |
| 119 | + ContactListModel( |
| 120 | + avatar: Avatar(initials: Avatar.getInitials('Lisa Weber')), |
| 121 | + title: 'Lisa Weber', |
| 122 | + subtitle: 'Polizeikommissarin • PN-2024-9012', |
| 123 | + ), |
| 124 | + ], |
| 125 | + ), |
| 126 | + ), |
| 127 | + lines: [ |
| 128 | + CodeTextLine("ContactList(items: ["), |
| 129 | + CodeTextLine(" ContactListModel("), |
| 130 | + CodeTextLine(" avatar: Avatar("), |
| 131 | + CodeTextLine( |
| 132 | + " initials: Avatar.getInitials('Maria Schmidt'),", |
| 133 | + ), |
| 134 | + CodeTextLine(" ),"), |
| 135 | + CodeTextLine(" title: 'Maria Schmidt',"), |
| 136 | + CodeTextLine( |
| 137 | + " subtitle: 'Polizeioberkommissarin • PN-2024-1234',", |
| 138 | + ), |
| 139 | + CodeTextLine(" ),"), |
| 140 | + CodeTextLine(" ContactListModel("), |
| 141 | + CodeTextLine(" avatar: Avatar("), |
| 142 | + CodeTextLine( |
| 143 | + " initials: Avatar.getInitials('Thomas Müller'),", |
| 144 | + ), |
| 145 | + CodeTextLine(" ),"), |
| 146 | + CodeTextLine(" title: 'Thomas Müller',"), |
| 147 | + CodeTextLine( |
| 148 | + " subtitle: 'Polizeihauptkommissar • PN-2024-5678',", |
| 149 | + ), |
| 150 | + CodeTextLine(" ),"), |
| 151 | + CodeTextLine(" ContactListModel("), |
| 152 | + CodeTextLine(" avatar: Avatar("), |
| 153 | + CodeTextLine(" initials: Avatar.getInitials('Lisa Weber'),"), |
| 154 | + CodeTextLine(" ),"), |
| 155 | + CodeTextLine(" title: 'Lisa Weber',"), |
| 156 | + CodeTextLine( |
| 157 | + " subtitle: 'Polizeikommissarin • PN-2024-9012',", |
| 158 | + ), |
| 159 | + CodeTextLine(" ),"), |
| 160 | + CodeTextLine("]),"), |
| 161 | + ], |
| 162 | + ), |
| 163 | + ], |
| 164 | + ).gap(15).withPadding(vertical: 30), |
| 165 | + ).withPadding(horizontal: 20); |
| 166 | + } |
| 167 | +} |
0 commit comments