flutter_clipboard_manager 0.0.2 copy "flutter_clipboard_manager: ^0.0.2" to clipboard
flutter_clipboard_manager: ^0.0.2 copied to clipboard

A new flutter plugin project.

example/lib/main.dart

import 'package:flutter/material.dart';
//import 'package:flutter_clipboard_manager/flutter_clipboard_manager.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter clipboard manager example app'),
        ),
        body: Builder(
          builder: (context) {
            return Center(
              child: Column(
                children: <Widget>[
                  Text('Your coupon is: Clipboard content!'),
                  RaisedButton(
                    child: Text('Copy to Clipboard'),
                    onPressed: () {
                      final snackBar = SnackBar(
                          content: Text('Copied to Clipboard'),
                          action: SnackBarAction(
                            label: 'Okey',
                            onPressed: () {},
                          ),
                        );
                        Scaffold.of(context).showSnackBar(snackBar);
                      // FlutterClipboardManager.copyToClipBoard(
                      //         "Clipboard content!")
                      //     .then((result) {
                      //   final snackBar = SnackBar(
                      //     content: Text('Copied to Clipboard'),
                      //     action: SnackBarAction(
                      //       label: 'Okey',
                      //       onPressed: () {},
                      //     ),
                      //   );
                      //   Scaffold.of(context).showSnackBar(snackBar);
                      // });
                    },
                  ),
                  RaisedButton(
                    child: Text('Copy from Clipboard'),
                    onPressed: () {
                      final snackBar = SnackBar(
                          content: Text('Clipboard data: Clipboard content!'),
                          action: SnackBarAction(
                            label: 'Okey',
                            onPressed: () {},
                          ),
                        );
                        Scaffold.of(context).showSnackBar(snackBar);
                      // FlutterClipboardManager.copyFromClipBoard()
                      //     .then((result) {
                      //   final snackBar = SnackBar(
                      //     content: Text('Clipboard data: $result'),
                      //     action: SnackBarAction(
                      //       label: 'Okey',
                      //       onPressed: () {},
                      //     ),
                      //   );
                      //   Scaffold.of(context).showSnackBar(snackBar);
                      // });
                    },
                  )
                ],
              ),
            );
          },
        ),
      ),
    );
  }
}
14
likes
30
pub points
83%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_clipboard_manager