Files
iris/lib/widgets/chip.dart
2025-09-16 20:48:19 +08:00

33 lines
822 B
Dart

import 'package:flutter/material.dart';
class Chip extends StatelessWidget {
final String text;
final bool primary;
const Chip({super.key, required this.text, this.primary = false});
@override
Widget build(BuildContext context) {
return Container(
height: 20,
decoration: BoxDecoration(
color: primary
? Theme.of(context).colorScheme.inversePrimary
: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8),
),
padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Center(
child: Text(
text,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
);
}
}