device_screen_recorder 0.0.4 copy "device_screen_recorder: ^0.0.4" to clipboard
device_screen_recorder: ^0.0.4 copied to clipboard

PlatformAndroid

A Flutter plugin for record the screen. This plug-in requires Android SDK 21+ and iOS 10+

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  bool recording = false;
  String path = '';

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              recording
                  ? OutlinedButton(
                      onPressed: () async {
                        var file = await DeviceScreenRecorder.stopRecordScreen();
                        setState(() {
                          path = file ?? '';
                          recording = false;
                        });
                      },
                      child: Text('Stop'),
                    )
                  : OutlinedButton(
                      onPressed: () async {
                        var status = await DeviceScreenRecorder.startRecordScreen();
                        // var status = await ScreenRecorder.startRecordScreen(name: 'example');
                        setState(() {
                          recording = status ?? false;
                        });
                      },
                      child: Text('Start'),
                    ),
              Text(path)
            ],
          ),
        ),
      ),
    );
  }
}
13
likes
110
pub points
74%
popularity

Publisher

verified publisherkovardin.ru

A Flutter plugin for record the screen. This plug-in requires Android SDK 21+ and iOS 10+

Homepage
Repository

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on device_screen_recorder