copyButton method
Implementation
DefineMTileModifier copyButton({
String? buttonText,
String? copyContent,
double? width,
double? height,
double? radius,
VoidCallback? onCopy,
}) {
final heightResult = height ?? 32.px;
final DefineMTileModifier newModifierValue = this.copyWith(
valueWidgetRight: MButton(
text: buttonText ?? "Copy",
fontSize: 16.px,
width: width,
height: heightResult,
maxHeight: heightResult,
padding: width == null
? EdgeInsets.symmetric(horizontal: 10.px)
: EdgeInsets.zero,
borderRadius: BorderRadius.all(Radius.circular(radius ?? 16.px)),
onTap: () async {
await Clipboard.setData(ClipboardData(text: copyContent ?? ""));
if (onCopy != null) onCopy();
},
),
);
return newModifierValue;
}