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

Package to take screenshots in different ways and be able to share them in png format with other applications

example/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Take Screenshot Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  final TakeScreenshotController _takeScreenshotController = TakeScreenshotController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter TakeScreenshot Page'),
      ),
      body: TakeScreenshot(
        controller: _takeScreenshotController,
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'Take your screenshot',
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () async {
          try {
            final pngBytes = await _takeScreenshotController.captureAsPngBytes();
            print(pngBytes);
          } on Exception catch (e) {
            print(e);
          }
        },
        child: Icon(Icons.add),
      ),
    );
  }
}
4
likes
140
points
54
downloads

Publisher

unverified uploader

Weekly Downloads

Package to take screenshots in different ways and be able to share them in png format with other applications

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path_provider, pedantic, share_plus

More

Packages that depend on take_screenshot