Skip to content

Commit 6011761

Browse files
Migrate to Null Safety Flutter V2 (#205)
* platform interface upgrade * pre-pigeon * convert pigeon * Fix snapshot issue * Pr prep * PR comments * Pr comments * Update flutter_vlc_player/lib/src/vlc_player_controller.dart Co-authored-by: Yuri Prykhodko <[email protected]> Co-authored-by: Yuri Prykhodko <[email protected]>
1 parent d03ada6 commit 6011761

File tree

22 files changed

+1222
-1097
lines changed

22 files changed

+1222
-1097
lines changed

flutter_vlc_player/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 5.0.6
2+
* Support Flutter V2 Null Safety
3+
Credits to Mitch Ross (https://github.com/mitchross)
14
## 5.0.5
25
* Added Vlc Subtitle Styling.
36
* Split ios swift code into multiple files for better readability.

flutter_vlc_player/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939

4040
dependencies {
4141
implementation fileTree(include: ['*.jar'], dir: 'libs')
42-
implementation 'org.videolan.android:libvlc-all:3.3.2'
42+
implementation 'org.videolan.android:libvlc-all:3.3.14'
4343
implementation 'androidx.appcompat:appcompat:1.2.0'
4444
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
4545
implementation 'androidx.annotation:annotation:1.1.0'

flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/FlutterVlcPlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ String getSnapshot() {
624624
Bitmap bitmap = textureView.getBitmap();
625625
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
626626
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
627-
return Base64.encodeToString(outputStream.toByteArray(), Base64.DEFAULT);
627+
return Base64.encodeToString(outputStream.toByteArray(), Base64.NO_WRAP);
628628
}
629629

630630
private void log(String message) {

flutter_vlc_player/android/src/main/java/software/solid/fluttervlcplayer/Messages.java

Lines changed: 198 additions & 195 deletions
Large diffs are not rendered by default.

flutter_vlc_player/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ environment:
88
dependencies:
99
flutter:
1010
sdk: flutter
11-
path_provider: ^1.6.27
11+
path_provider: ^2.0.1
1212

1313

1414
# The following adds the Cupertino Icons font to your application.
1515
# Use with the CupertinoIcons class for iOS style icons.
16-
cupertino_icons: ^0.1.3
16+
cupertino_icons: ^1.0.2
1717

1818
dev_dependencies:
1919
flutter_test:

flutter_vlc_player/ios/Classes/messages.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v0.1.17), do not edit directly.
1+
// Autogenerated from Pigeon (v0.2.0-nullsafety.0), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33
#import <Foundation/Foundation.h>
44
@protocol FlutterBinaryMessenger;

flutter_vlc_player/ios/Classes/messages.m

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

flutter_vlc_player/lib/src/flutter_vlc_player.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import 'vlc_player_platform.dart';
66
class VlcPlayer extends StatefulWidget {
77
final VlcPlayerController controller;
88
final double aspectRatio;
9-
final Widget placeholder;
9+
final Widget? placeholder;
1010

1111
VlcPlayer({
12-
Key key,
12+
Key? key,
1313

1414
/// The [VlcPlayerController] responsible for the video being rendered in
1515
/// this widget.
16-
@required this.controller,
16+
required this.controller,
1717

1818
/// The aspect ratio used to display the video.
1919
/// This MUST be provided, however it could simply be (parentWidth / parentHeight) - where parentWidth and
2020
/// parentHeight are the width and height of the parent perhaps as defined by a LayoutBuilder.
21-
@required this.aspectRatio,
21+
required this.aspectRatio,
2222

2323
/// Before the platform view has initialized, this placeholder will be rendered instead of the video player.
2424
/// This can simply be a [CircularProgressIndicator] (see the example.)
@@ -47,9 +47,9 @@ class _VlcPlayerState extends State<VlcPlayer>
4747
};
4848
}
4949

50-
VoidCallback _listener;
50+
late VoidCallback _listener;
5151

52-
bool _isInitialized;
52+
bool _isInitialized = false;
5353

5454
@override
5555
void initState() {
@@ -88,7 +88,7 @@ class _VlcPlayerState extends State<VlcPlayer>
8888
child: widget.placeholder ?? Container(),
8989
),
9090
Offstage(
91-
offstage: !_isInitialized,
91+
offstage: _isInitialized,
9292
child: vlcPlayerPlatform
9393
.buildView(widget.controller.onPlatformViewCreated),
9494
),

flutter_vlc_player/lib/src/vlc_app_life_cycle_observer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class VlcAppLifeCycleObserver extends Object with WidgetsBindingObserver {
99
final VlcPlayerController _controller;
1010

1111
void initialize() {
12-
WidgetsBinding.instance.addObserver(this);
12+
WidgetsBinding.instance!.addObserver(this);
1313
}
1414

1515
@override
@@ -29,6 +29,6 @@ class VlcAppLifeCycleObserver extends Object with WidgetsBindingObserver {
2929
}
3030

3131
void dispose() {
32-
WidgetsBinding.instance.removeObserver(this);
32+
WidgetsBinding.instance!.removeObserver(this);
3333
}
3434
}

0 commit comments

Comments
 (0)