Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn00 committed Aug 1, 2024
1 parent 788b328 commit e81b326
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 25 deletions.
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

* Add support transparency.
* Updated the example project to last flutter changes.

## [0.2.1]

* `Exporter` class exposes now `frames`.
* Bump `image` dependency to ^4.0.17
* Bump `image` dependency to ^4.2.0

## [0.2.0]

Expand Down Expand Up @@ -34,7 +31,6 @@
* Better Readme
* Some more configuration options


## [0.0.1]

* Initial draft. Pretty WIP and highly experimental
15 changes: 15 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include: package:flutter_lints/flutter.yaml
analyzer:
errors:
missing_required_param: error
missing_return: error
todo: ignore

linter:
rules:
one_member_abstracts: false
prefer_relative_imports: true
always_use_package_imports: false
omit_local_variable_types: false
directives_ordering: true

4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -24,7 +24,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
const MyHomePage({super.key, required this.title});

final String title;

Expand Down
2 changes: 1 addition & 1 deletion example/lib/sample_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:math';
import 'package:flutter/material.dart';

class SampleAnimation extends StatefulWidget {
const SampleAnimation({Key? key}) : super(key: key);
const SampleAnimation({super.key});

@override
State<SampleAnimation> createState() => _SampleAnimationState();
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ version: 1.0.0+1


environment:
sdk: ">=2.12.0 <3.0.0"
flutter: '>=3.4.0-34.1.pre'
sdk: '>=3.0.0 <4.0.0'
flutter: '>=3.10.0'

dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
cupertino_icons: ^1.0.8
screen_recorder:
path: ../

Expand Down
4 changes: 2 additions & 2 deletions lib/screen_recorder.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
library screenrecorder;

export 'src/screen_recorder.dart';
export 'src/frame.dart';
export 'src/exporter.dart';
export 'src/frame.dart';
export 'src/screen_recorder.dart';
6 changes: 3 additions & 3 deletions lib/src/exporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:ui' as ui show ImageByteFormat;

import 'package:flutter/foundation.dart';
import 'package:image/image.dart' as image;
import 'package:screen_recorder/src/frame.dart';
import 'frame.dart';

class Exporter {
final List<Frame> _frames = [];
Expand Down Expand Up @@ -44,7 +44,7 @@ class Exporter {
if (bytesImage != null) {
bytesImages.add(RawFrame(16, bytesImage));
} else {
print('Skipped frame while enconding');
debugPrint('Skipped frame while enconding');
}
}
return bytesImages;
Expand All @@ -71,7 +71,7 @@ class Exporter {
final decodedImage = image.decodePng(iAsBytes);

if (decodedImage == null) {
print('Skipped frame while enconding');
debugPrint('Skipped frame while enconding');
continue;
}
decodedImage.frameDuration = frame.durationInMillis;
Expand Down
14 changes: 7 additions & 7 deletions lib/src/screen_recorder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:ui' as ui show Image;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:screen_recorder/src/exporter.dart';
import 'package:screen_recorder/src/frame.dart';
import 'exporter.dart';
import 'frame.dart';

class ScreenRecorderController {
ScreenRecorderController({
Expand Down Expand Up @@ -73,12 +73,12 @@ class ScreenRecorderController {
try {
final image = capture();
if (image == null) {
print('capture returned null');
debugPrint('capture returned null');
return;
}
_exporter.onNewFrame(Frame(timestamp, image));
} catch (e) {
print(e.toString());
debugPrint(e.toString());
}
_binding.addPostFrameCallback(postFrameCallback);
}
Expand All @@ -92,14 +92,14 @@ class ScreenRecorderController {
}

class ScreenRecorder extends StatelessWidget {
ScreenRecorder({
Key? key,
const ScreenRecorder({
super.key,
required this.child,
required this.controller,
required this.width,
required this.height,
this.background = Colors.transparent,
}) : super(key: key);
});

/// The child which should be recorded.
final Widget child;
Expand Down
10 changes: 8 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ issue_tracker: https://github.com/ueman/screenrecorder/issues
funding:
- https://github.com/sponsors/ueman
- https://www.buymeacoffee.com/jonasuekoetter
topics:
- gif
- recording
- screen
- video

environment:
sdk: ">=2.12.0 <3.0.0"
flutter: '>=3.4.0-34.1.pre'
sdk: '>=3.0.0 <4.0.0'
flutter: '>=3.10.0'

dependencies:
flutter:
Expand All @@ -19,3 +24,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0

0 comments on commit e81b326

Please sign in to comment.