An open API service indexing awesome lists of open source software.

https://github.com/code-vedas/cv-native-client

Native client for accessing native implementation of functions in Flutter
https://github.com/code-vedas/cv-native-client

Last synced: about 2 months ago
JSON representation

Native client for accessing native implementation of functions in Flutter

Awesome Lists containing this project

README

          

# CV Native Client

Flutter plugin for CV Native Client.
This plugin allows you to access Native API's of platform.

## Usage

To use this plugin, add `cv_native_client` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).

### Installation

Add this to your package's pubspec.yaml file:

```yaml
dependencies:
cv_native_client: ^1.0.1
```

### Example

```dart
import 'package:cv_native_client/cv_native_client.dart';

// Get platform version
String platformVersion = await CvNativeClient.getPlatformVersion();

// Get clipboard data mime types
final List mimeTypes = await CvNativeClient.getClipboardDataMimeTypes();
log('Clipboard mime types: $mimeTypes');

// Get clipboard Data
final CvClipboardData? clipboardData = await CvNativeClient.getClipboardData();
log('Clipboard text: ${clipboardData?.plainText}');
log('Clipboard html: ${clipboardData?.htmlText}');

// Set clipboard Data
await CvNativeClient.setClipboardData(CvClipboardData(plainText: 'Hello World!', htmlText: 'Hello World!'));
```