Correct copy to clipboard
This commit is contained in:
parent
42c04840b8
commit
3c27d9f250
|
|
@ -8,12 +8,14 @@ class IconText extends StatelessWidget {
|
||||||
this.icon,
|
this.icon,
|
||||||
this.style,
|
this.style,
|
||||||
this.alignment,
|
this.alignment,
|
||||||
|
this.copyToClipboard = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
final TextStyle style;
|
final TextStyle style;
|
||||||
final MainAxisAlignment alignment;
|
final MainAxisAlignment alignment;
|
||||||
|
final bool copyToClipboard;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -24,14 +26,19 @@ class IconText extends StatelessWidget {
|
||||||
Icon(icon, color: style?.color),
|
Icon(icon, color: style?.color),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: CopyToClipboard(
|
child: copyToClipboard
|
||||||
value: text,
|
? CopyToClipboard(
|
||||||
child: Text(
|
value: text,
|
||||||
text ?? '',
|
child: Text(
|
||||||
style: style,
|
text ?? '',
|
||||||
overflow: TextOverflow.ellipsis,
|
style: style,
|
||||||
),
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
))
|
||||||
|
: Text(
|
||||||
|
text ?? '',
|
||||||
|
style: style,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -376,6 +376,7 @@ class _ClientViewFullwidthState extends State<ClientViewFullwidth>
|
||||||
IconText(
|
IconText(
|
||||||
text: client.privateNotes,
|
text: client.privateNotes,
|
||||||
icon: Icons.lock,
|
icon: Icons.lock,
|
||||||
|
copyToClipboard: true,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,7 @@ class _VendorViewFullwidthState extends State<VendorViewFullwidth>
|
||||||
IconText(
|
IconText(
|
||||||
text: vendor.privateNotes,
|
text: vendor.privateNotes,
|
||||||
icon: Icons.lock,
|
icon: Icons.lock,
|
||||||
|
copyToClipboard: true,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue