fluffychat/lib/pangea/morphs/morph_icon.dart
wcjord d773347d6e
Morph-repo-2 (#1681)
* feat(morphs): repo for getting lang-specific list of morphs

* integrated repo into use of morph features and tags

* generated

* merged with previous push

* generated

* generated

* chore: fix .env file path

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com>
Co-authored-by: ggurdin <ggurdin@gmail.com>
2025-02-03 12:21:29 -05:00

37 lines
1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:fluffychat/pangea/common/widgets/customized_svg.dart';
import 'package:fluffychat/pangea/morphs/get_icon_for_morph_feature.dart';
import 'package:fluffychat/pangea/morphs/get_svg_link.dart';
import 'package:fluffychat/utils/color_value.dart';
class MorphIcon extends StatelessWidget {
const MorphIcon({
super.key,
required this.morphFeature,
required this.morphTag,
});
final String morphFeature;
final String? morphTag;
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
return CustomizedSvg(
svgUrl: getMorphSvgLink(
morphFeature: morphFeature,
morphTag: morphTag,
context: context,
),
colorReplacements: theme.brightness == Brightness.dark
? {
"white": theme.cardColor.hexValue.toString(),
"black": "white",
}
: {},
errorIcon: Icon(getIconForMorphFeature(morphFeature)),
);
}
}