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

outdated

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: Atchou chwiya!'),
                  RaisedButton(
                    child: Text('Copy to Clipboard'),
                    onPressed: () {
                      FlutterClipboardManager.copyToClipBoard("Atchou chwiya!")
                          .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: () {
                      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
82%
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