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/common/bot_face_svg.dart

38 lines
986 B
Dart

// Flutter imports:
import 'package:flutter/material.dart';
enum BotExpression { surprised, right, addled, left, down, shocked }
class BotFace extends StatelessWidget {
const BotFace({
Key? key,
required this.width,
required this.expression,
this.forceColor,
}) : super(key: key);
final double width;
final Color? forceColor;
final BotExpression expression;
@override
Widget build(BuildContext context) {
return Image.asset(
'assets/pangea/bot_faces/${expression.toString().split('.').last}.png',
// 'assets/pangea/bot_faces/surprised.png',
width: width,
height: width,
// color: forceColor ??
// (Theme.of(context).brightness == Brightness.light
// ? Theme.of(context).colorScheme.primary
// : Theme.of(context).colorScheme.primary),
);
}
}
// extension ParseToString on BotExpressions {
// String toShortString() {
// return toString().split('.').last;
// }
// }