mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
17 lines
518 B
Dart
17 lines
518 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:fladder/screens/shared/fladder_snackbar.dart';
|
|
import 'package:fladder/util/localization_helper.dart';
|
|
|
|
extension ClipboardHelper on BuildContext {
|
|
Future<void> copyToClipboard(String value, {String? customMessage}) async {
|
|
await Clipboard.setData(ClipboardData(text: value));
|
|
if (mounted) {
|
|
fladderSnackbar(
|
|
this,
|
|
title: customMessage ?? localized.copiedToClipboard,
|
|
);
|
|
}
|
|
}
|
|
}
|