Freekake/lib/components/buildcard_info.dart
2025-03-17 14:54:44 +07:00

81 lines
2.1 KiB
Dart

import 'package:flutter/material.dart';
class BuildcardInfo extends StatelessWidget {
final IconData icon;
final String text;
final double? width; // = 120,
final IconData? extraIcon; //,
final String? extraText; //,
const BuildcardInfo({
super.key,
required this.icon,
required this.text,
required this.width,
this.extraIcon,
this.extraText,
});
@override
Widget build(BuildContext context) {
return Container(
height: 36,
width: width ?? 120,
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 5),
decoration: BoxDecoration(
color: Color.fromARGB(133, 240, 235, 235),
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
// color: Color.fromARGB(255, 214, 213, 121),
blurRadius: 0,
spreadRadius: 0,
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconTheme(
data: IconThemeData(
size: 12,
color: Color.fromARGB(255, 244, 189, 72),
),
child: Icon(icon),
),
SizedBox(width: 4),
Expanded(
child: Text(
text,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: const Color.fromARGB(255, 255, 255, 255),
),
overflow: TextOverflow.ellipsis,
),
),
if (extraIcon != null && extraText != null) ...[
SizedBox(width: 6),
IconTheme(
data: IconThemeData(
size: 18,
color: Color.fromARGB(255, 244, 189, 72),
),
child: Icon(extraIcon),
),
SizedBox(width: 4),
Text(
extraText ?? '',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Color.fromARGB(255, 255, 255, 255),
),
),
],
],
),
);
}
}