Skip to content

Commit e5d732b

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 0b25006 + 12346a3 commit e5d732b

12 files changed

Lines changed: 467 additions & 363 deletions

lib/routes/route_config.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:police_flutter_template/routes/route_names.dart';
55
import 'package:police_flutter_template/screens/auth/auth_not_initialized_screen.dart';
66
import 'package:police_flutter_template/screens/components/alerts/alerts_screen.dart';
77
import 'package:police_flutter_template/screens/components/buttons/buttons_screen.dart';
8+
import 'package:police_flutter_template/screens/components/cards/cards_screen.dart';
89
import 'package:police_flutter_template/screens/error_pages/internal_server_error_screen.dart';
910
import 'package:police_flutter_template/screens/error_pages/not_found_screen.dart';
1011
import 'package:police_flutter_template/screens/home/home_screen.dart';
@@ -185,6 +186,15 @@ class RouteConfig {
185186
),
186187
],
187188
),
189+
StatefulShellBranch(
190+
routes: [
191+
GoRoute(
192+
name: RouteNames.cards,
193+
path: RouteNames.cardsUrl,
194+
builder: (context, state) => CardsScreen(),
195+
),
196+
],
197+
),
188198
],
189199
),
190200
],

lib/routes/route_names.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,10 @@ class RouteNames {
5252

5353
/// URL path for the alerts demo route (e.g. `/alerts`).
5454
static const String alertsUrl = '/$alerts';
55+
56+
/// Route name for the "cards" component showcase/demo screen.
57+
static const String cards = "cards";
58+
59+
/// URL path for the cards demo route (e.g. `/cards`).
60+
static const String cardsUrl = '/$cards';
5561
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
}

lib/screens/widgets/error_pages/internal_server_error_card.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import 'package:flutter_bloc/flutter_bloc.dart';
22
import 'package:go_router/go_router.dart';
3-
import 'package:shadcn_flutter/shadcn_flutter.dart' hide IconContainer;
3+
import 'package:shadcn_flutter/shadcn_flutter.dart';
44

55
import '../../../extensions/text_extensions.dart';
66
import '../../../settings/error_settings.dart';
77
import '../../../theme/cubit/theme_cubit.dart';
8-
import '../icon_container.dart';
98

109
/// A reusable card widget for displaying an "Internal Server Error" (HTTP 500) page section.
1110
///
@@ -85,11 +84,13 @@ class InternalServerErrorCard extends StatelessWidget {
8584
child: Column(
8685
children: [
8786
IconContainer(
88-
color: Colors.red[100],
89-
darkColor: Colors.red[900].withAlpha(50),
90-
icon: LucideIcons.serverCrash,
91-
iconColor: Colors.red[600],
92-
iconDarkColor: Colors.red[400],
87+
icon: Icon(LucideIcons.serverCrash, size: 48),
88+
backgroundColor: isDarkMode
89+
? Colors.red[900].withAlpha(50)
90+
: Colors.red[100],
91+
iconColor: isDarkMode ? Colors.red[400] : Colors.red[600],
92+
borderRadius: BorderRadius.circular(999),
93+
padding: EdgeInsets.all(24),
9394
),
9495
Gap(24),
9596
Text('500').bold.x8Large.setColors(

lib/screens/widgets/error_pages/not_authorized_card.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import 'package:flutter_bloc/flutter_bloc.dart';
22
import 'package:go_router/go_router.dart';
3-
import 'package:shadcn_flutter/shadcn_flutter.dart' hide IconContainer;
3+
import 'package:shadcn_flutter/shadcn_flutter.dart';
44

55
import '../../../extensions/text_extensions.dart';
66
import '../../../settings/error_settings.dart';
77
import '../../../theme/cubit/theme_cubit.dart';
8-
import '../icon_container.dart';
98

109
/// A reusable card widget for displaying a "Not Authorized" (HTTP 403) page section.
1110
///
@@ -78,11 +77,13 @@ class NotAuthorizedCard extends StatelessWidget {
7877
child: Column(
7978
children: [
8079
IconContainer(
81-
color: Colors.orange[100],
82-
darkColor: Colors.orange[900].withAlpha(100),
83-
icon: LucideIcons.shieldAlert,
84-
iconColor: Colors.orange[600],
85-
iconDarkColor: Colors.orange[400],
80+
icon: Icon(LucideIcons.shieldAlert, size: 48),
81+
backgroundColor: isDarkMode
82+
? Colors.orange[900].withAlpha(100)
83+
: Colors.orange[100],
84+
iconColor: isDarkMode ? Colors.orange[400] : Colors.orange[600],
85+
borderRadius: BorderRadius.circular(999),
86+
padding: EdgeInsets.all(24),
8687
),
8788
Gap(24),
8889
Text('403').bold.x8Large.setColors(

lib/screens/widgets/error_pages/not_found_card.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import 'package:flutter_bloc/flutter_bloc.dart';
22
import 'package:go_router/go_router.dart';
33
import 'package:police_flutter_template/extensions/text_extensions.dart';
4-
import 'package:police_flutter_template/screens/widgets/icon_container.dart';
54
import 'package:police_flutter_template/settings/error_settings.dart';
6-
import 'package:shadcn_flutter/shadcn_flutter.dart' hide IconContainer;
5+
import 'package:shadcn_flutter/shadcn_flutter.dart';
76

87
import '../../../theme/cubit/theme_cubit.dart';
98

@@ -79,11 +78,13 @@ class NotFoundCard extends StatelessWidget {
7978
child: Column(
8079
children: [
8180
IconContainer(
82-
color: Colors.blue[100],
83-
darkColor: Colors.blue[900].withAlpha(100),
84-
icon: LucideIcons.fileQuestion,
85-
iconColor: Colors.blue[900],
86-
iconDarkColor: Colors.blue[400],
81+
icon: Icon(LucideIcons.fileQuestion, size: 48),
82+
backgroundColor: isDarkMode
83+
? Colors.blue[900].withAlpha(100)
84+
: Colors.blue[100],
85+
iconColor: isDarkMode ? Colors.blue[400] : Colors.blue[900],
86+
borderRadius: BorderRadius.circular(999),
87+
padding: EdgeInsets.all(24),
8788
),
8889
Gap(24),
8990
Text('404').bold.x8Large.setColors(

lib/screens/widgets/icon_container.dart

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)