2023-04-04 20:28:26 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:outbag_app/backend/room.dart';
|
|
|
|
|
|
|
|
class CategoryChip extends StatelessWidget {
|
|
|
|
final RoomCategory? category;
|
2024-02-23 16:13:15 +01:00
|
|
|
final String server;
|
|
|
|
final String room;
|
2023-04-04 20:28:26 +02:00
|
|
|
|
2024-02-23 16:13:15 +01:00
|
|
|
const CategoryChip(
|
|
|
|
{super.key, required this.server, required this.room, this.category});
|
2023-04-04 20:28:26 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ActionChip(
|
2023-12-22 20:14:36 +01:00
|
|
|
avatar: Icon(Icons.square_rounded,
|
2024-02-23 16:13:15 +01:00
|
|
|
color: category?.color ??
|
|
|
|
RoomCategory.other(server, room, context).color),
|
|
|
|
label: Text(
|
|
|
|
category?.name ?? RoomCategory.other(server, room, context).name),
|
2023-04-04 20:28:26 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|