mirror of
https://github.com/nini22P/iris.git
synced 2026-06-06 13:56:31 +08:00
33 lines
822 B
Dart
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,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|