fromKey static method
Builds a logo from a snake_case payment method key such as pay_shap.
Renders fallback (or an empty SizedBox) if the key is unknown.
Implementation
static Widget fromKey(
String key, {
double? width,
double? height,
BoxFit fit = BoxFit.contain,
bool onDark = false,
String? semanticsLabel,
Widget? fallback,
}) {
final method = PeachPaymentMethod.fromKey(key);
if (method == null) {
return fallback ?? SizedBox(width: width, height: height);
}
return PeachPaymentMethodLogo(
method,
width: width,
height: height,
fit: fit,
onDark: onDark,
semanticsLabel: semanticsLabel,
);
}