Skip to content

Commit

Permalink
Copy full badge markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Jan 23, 2025
1 parent f79351e commit 15817d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pub_stats/lib/view/widget/stats/stats_charts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ class StatsCharts extends StatelessWidget {
required String package,
required BadgeType type,
}) {
final hint = type.name.titleCase;
Clipboard.setData(
ClipboardData(
text: 'https://pubstats.dev/badges/packages/$package/$type.svg',
text:
'[![PubStats $hint](https://pubstats.dev/badges/packages/$package/$type.svg)](https://pubstats.dev/packages/$package)',
),
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Badge URL copied to clipboard')),
const SnackBar(content: Text('Badge markdown copied to clipboard')),
);
}

Expand Down

0 comments on commit 15817d9

Please sign in to comment.