You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
Dart
51 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
class CustomRectangleChip extends StatelessWidget {
|
|
final String text;
|
|
final double? height;
|
|
final double? width;
|
|
final Color bgColor;
|
|
final Color textColor;
|
|
final Function() onHistoryItemDeleted;
|
|
final Function() onHistoryItemTapped;
|
|
|
|
const CustomRectangleChip({
|
|
super.key,
|
|
this.bgColor = MyColors.chipColor,
|
|
required this.text,
|
|
this.textColor = MyColors.darkTextColor,
|
|
this.width,
|
|
this.height = 28,
|
|
required this.onHistoryItemDeleted,
|
|
required this.onHistoryItemTapped,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),
|
|
color: bgColor,
|
|
height: height,
|
|
child: Row(
|
|
children: [
|
|
text.toText(fontSize: 15, color: MyColors.darkTextColor),
|
|
8.width,
|
|
Container(
|
|
height: 15,
|
|
width: 15,
|
|
decoration: const BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: MyColors.roundedCrossBgColor,
|
|
),
|
|
child: const Icon(Icons.close, color: MyColors.white, size: 10),
|
|
).onPress(onHistoryItemDeleted),
|
|
],
|
|
),
|
|
).onPress(onHistoryItemTapped);
|
|
}
|
|
}
|