flutter_screen_recording 1.0.10

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

flutter_screen_recording #

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

Getting Started #

This plugin can be used for record the screen on Android and iOS devices.

  1. For start the recording
bool started = FlutterScreenRecording.startRecordScreen(videoName);

Or

bool started = FlutterScreenRecording.startRecordScreenAndAudio(videoName);
  1. For stop the recording
String path = FlutterScreenRecording.stopRecordScreen;

Android #

Flutter_Screen_Recorder do not request permissions necessary. You can use Permission_handler, a permissions plugin for Flutter. Require and add the following permissions in your manifest:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

iOS #

You only need add the permission message on the Info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>Save video in gallery</string>
<key>NSMicrophoneUsageDescription</key>
<string>Save audio in video</string>

1.0.10 #

  • Update docs

1.0.9 #

  • iOS bug fixed

1.0.8 #

  • Update Doc

1.0.7 #

  • Add fun startRecordScreenAndAudio in Android

1.0.6 #

  • Some Android bug fixed

1.0.5 #

  • Android devices compatibility

1.0.4 #

  • Included permission controller
  • Bug fixed

1.0.2 #

  • ImagePicker conflict fixed
  • Remove HBRecorder.

example/lib/main.dart

import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_screen_recording/flutter_screen_recording.dart';
import 'package:quiver/async.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:open_file/open_file.dart';

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

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

class _MyAppState extends State<MyApp> {
  bool recording = false;
  int _time = 0;

  requestPermissions() async {
    await PermissionHandler().requestPermissions([
      PermissionGroup.storage,
      PermissionGroup.photos,
      PermissionGroup.microphone,
    ]);
  }

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

  void startTimer() {
    CountdownTimer countDownTimer = new CountdownTimer(
      new Duration(seconds: 1000),
      new Duration(seconds: 1),
    );

    var sub = countDownTimer.listen(null);
    sub.onData((duration) {
      setState(() => _time++);
    });

    sub.onDone(() {
      print("Done");
      sub.cancel();
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Screen Recording'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text('Time: $_time\n'),
            !recording
                ? Center(
                    child: RaisedButton(
                      child: Text("Record Screen"),
                      onPressed: () => startScreenRecord(false),
                    ),
                  )
                : Container(),
            !recording
                ? Center(
                    child: RaisedButton(
                      child: Text("Record Screen & audio"),
                      onPressed: () => startScreenRecord(true),
                    ),
                  )
                : Center(
                    child: RaisedButton(
                      child: Text("Stop Record"),
                      onPressed: () => stopScreenRecord(),
                    ),
                  )
          ],
        ),
      ),
    );
  }

  startScreenRecord(bool audio) async {
    bool start = false;

    if (audio) {
      start = await FlutterScreenRecording.startRecordScreenAndAudio("Title");
    } else {
      start = await FlutterScreenRecording.startRecordScreen("Title");
    }

    if (start) {
      setState(() => recording = !recording);
    }

    return start;
  }

  stopScreenRecord() async {
    String path = await FlutterScreenRecording.stopRecordScreen;
    setState(() {
      recording = !recording;
    });
    print("Opening video");
    print(path);
//    OpenFile.open(path);
    File screenFile = File(path);
    var aux = await screenFile.delete();
    print("aux");
    print(aux);
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_screen_recording: ^1.0.10

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_screen_recording/flutter_screen_recording.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
79
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:flutter_screen_recording/flutter_screen_recording.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:flutter_screen_recording/flutter_screen_recording.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:flutter_screen_recording/flutter_screen_recording.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:flutter_screen_recording/flutter_screen_recording.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • flutter_screen_recording that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

6 out of 6 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/flutter_screen_recording.dart.

Run flutter format to format lib/flutter_screen_recording.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test