|
1 | 1 | # cv_native_client_example
|
2 | 2 |
|
3 |
| -Demonstrates how to use the cv_native_client plugin. |
| 3 | +Demo app for `cv_native_client` plugin. |
4 | 4 |
|
5 |
| -## Getting Started |
| 5 | +## Usage |
6 | 6 |
|
7 |
| -This project is a starting point for a Flutter application. |
| 7 | +To use this plugin, add `cv_native_client` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). |
8 | 8 |
|
9 |
| -A few resources to get you started if this is your first Flutter project: |
| 9 | +### Installation |
10 | 10 |
|
11 |
| -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) |
12 |
| -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) |
| 11 | +Add this to your package's pubspec.yaml file: |
13 | 12 |
|
14 |
| -For help getting started with Flutter development, view the |
15 |
| -[online documentation](https://docs.flutter.dev/), which offers tutorials, |
16 |
| -samples, guidance on mobile development, and a full API reference. |
| 13 | +```yaml |
| 14 | +dependencies: |
| 15 | + cv_native_client: ^1.0.1 |
| 16 | +``` |
| 17 | +
|
| 18 | +### Example |
| 19 | +
|
| 20 | +```dart |
| 21 | +import 'package:cv_native_client/cv_native_client.dart'; |
| 22 | + |
| 23 | +// Get platform version |
| 24 | +String platformVersion = await CvNativeClient.getPlatformVersion(); |
| 25 | + |
| 26 | +// Get clipboard data mime types |
| 27 | +final List<CvClipboardMimeType> mimeTypes = await CvNativeClient.getClipboardDataMimeTypes(); |
| 28 | +log('Clipboard mime types: $mimeTypes'); |
| 29 | + |
| 30 | +// Get clipboard Data |
| 31 | +final CvClipboardData? clipboardData = await CvNativeClient.getClipboardData(); |
| 32 | +log('Clipboard text: ${clipboardData?.plainText}'); |
| 33 | +log('Clipboard html: ${clipboardData?.htmlText}'); |
| 34 | + |
| 35 | +// Set clipboard Data |
| 36 | +await CvNativeClient.setClipboardData(CvClipboardData(plainText: 'Hello World!', htmlText: '<b>Hello World!</b>')); |
| 37 | +``` |
0 commit comments