UIPasteboard

pub package

A Flutter plugin to interact with UIPasteboard on iOS.

Get Started

Add the following in the dependencies section of your pubspec.yaml:

dependencies:
  uipasteboard: <latest version>
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // the plugin only works on iOS
  if (Platform.isIOS) {
    final pasteboard = UIPasteboard();
    final hasUrl = await pasteboard.hasURLs();
    // Check if the pasteboard has a URL, to avoid asking for permission dialogs.
    if (hasUrl) {
      // Get the URL from the pasteboard
      final url = await pasteboard.getURL();
      print(url);
    }
  }
}

Libraries

uipasteboard