47 lines
1.1 KiB
Dart
47 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Wiederverwendbarer Avatar mit Initialen und farbigem Rahmen.
|
|
/// Wird im Header (24 px) und in jeder Zeile (26 px) verwendet.
|
|
class AvatarBadge extends StatelessWidget {
|
|
final String initials;
|
|
final Color color;
|
|
final double size;
|
|
|
|
const AvatarBadge({
|
|
super.key,
|
|
required this.initials,
|
|
required this.color,
|
|
this.size = 24,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: size,
|
|
height: size,
|
|
padding: const EdgeInsets.all(1),
|
|
decoration: BoxDecoration(
|
|
color: color,
|
|
borderRadius: BorderRadius.circular(2),
|
|
),
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFF1A1A2E),
|
|
borderRadius: BorderRadius.circular(1),
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
initials,
|
|
style: TextStyle(
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w700,
|
|
height: 1.5,
|
|
color: color,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|