mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Add ADIconButton
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
@ -20,7 +21,6 @@ class CopyButton extends StatelessWidget {
|
||||
Icons.content_copy,
|
||||
size: 18,
|
||||
);
|
||||
const label = kLabelCopy;
|
||||
onPressed() async {
|
||||
await Clipboard.setData(ClipboardData(text: toCopy));
|
||||
sm.hideCurrentSnackBar();
|
||||
@ -31,14 +31,15 @@ class CopyButton extends StatelessWidget {
|
||||
? TextButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
label: const Text(label),
|
||||
label: const Text(kLabelCopy),
|
||||
)
|
||||
: IconButton(
|
||||
tooltip: label,
|
||||
: ADIconButton(
|
||||
icon: Icons.content_copy,
|
||||
iconSize: 18,
|
||||
tooltip: kLabelCopy,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
visualDensity: VisualDensity.compact,
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user