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.
fluffychat/lib/pangea/widgets/igc/card_header.dart

58 lines
1.6 KiB
Dart

import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/utils/bot_style.dart';
import 'package:flutter/material.dart';
import '../../../widgets/matrix.dart';
import '../common/bot_face_svg.dart';
class CardHeader extends StatelessWidget {
const CardHeader({
super.key,
required this.text,
required this.botExpression,
this.onClose,
});
final BotExpression botExpression;
final String text;
final void Function()? onClose;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(top: 3.0),
child: BotFace(
width: 50.0,
expression: botExpression,
),
),
const SizedBox(width: 5.0),
Text(
text,
style: BotStyle.text(context),
textAlign: TextAlign.left,
),
const SizedBox(width: 5.0),
CircleAvatar(
backgroundColor: AppConfig.primaryColor.withOpacity(0.1),
child: IconButton(
icon: const Icon(Icons.close_outlined),
onPressed: () {
if (onClose != null) onClose!();
MatrixState.pAnyState.closeOverlay();
},
color: Theme.of(context).brightness == Brightness.dark
? AppConfig.primaryColorLight
: AppConfig.primaryColor,
),
),
],
),
);
}
}