Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit ce3b264

Browse files
author
Emmanuel Garcia
authored
[video_player_platform_interface] Migrate to null safety (#3159)
1 parent b1fb69e commit ce3b264

File tree

11 files changed

+201
-164
lines changed

11 files changed

+201
-164
lines changed

packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v0.1.7), do not edit directly.
1+
// Autogenerated from Pigeon (v0.1.12), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33

44
package io.flutter.plugins.videoplayer;
@@ -597,7 +597,7 @@ static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
597597
private static HashMap wrapError(Exception exception) {
598598
HashMap<String, Object> errorMap = new HashMap<>();
599599
errorMap.put("message", exception.toString());
600-
errorMap.put("code", null);
600+
errorMap.put("code", exception.getClass().getSimpleName());
601601
errorMap.put("details", null);
602602
return errorMap;
603603
}

packages/video_player/video_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.7), do not edit directly.
1+
// Autogenerated from Pigeon (v0.1.12), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33
#import <Foundation/Foundation.h>
44
@protocol FlutterBinaryMessenger;

packages/video_player/video_player/ios/Classes/messages.m

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v0.1.7), do not edit directly.
1+
// Autogenerated from Pigeon (v0.1.12), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33
#import "messages.h"
44
#import <Flutter/Flutter.h>
@@ -7,6 +7,7 @@
77
#error File requires ARC to be enabled.
88
#endif
99

10+
#ifndef __clang_analyzer__
1011
static NSDictionary *wrapResult(NSDictionary *result, FlutterError *error) {
1112
NSDictionary *errorDict = (NSDictionary *)[NSNull null];
1213
if (error) {
@@ -59,9 +60,9 @@ + (FLTTextureMessage *)fromMap:(NSDictionary *)dict {
5960
return result;
6061
}
6162
- (NSDictionary *)toMap {
62-
return [NSDictionary
63-
dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]),
64-
@"textureId", nil];
63+
return
64+
[NSDictionary dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]),
65+
@"textureId", nil];
6566
}
6667
@end
6768

@@ -112,10 +113,9 @@ + (FLTLoopingMessage *)fromMap:(NSDictionary *)dict {
112113
}
113114
- (NSDictionary *)toMap {
114115
return [NSDictionary
115-
dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]),
116-
@"textureId",
117-
(self.isLooping != nil ? self.isLooping : [NSNull null]),
118-
@"isLooping", nil];
116+
dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId",
117+
(self.isLooping ? self.isLooping : [NSNull null]), @"isLooping",
118+
nil];
119119
}
120120
@end
121121

@@ -134,9 +134,8 @@ + (FLTVolumeMessage *)fromMap:(NSDictionary *)dict {
134134
}
135135
- (NSDictionary *)toMap {
136136
return [NSDictionary
137-
dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]),
138-
@"textureId", (self.volume != nil ? self.volume : [NSNull null]),
139-
@"volume", nil];
137+
dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId",
138+
(self.volume ? self.volume : [NSNull null]), @"volume", nil];
140139
}
141140
@end
142141

@@ -155,9 +154,8 @@ + (FLTPlaybackSpeedMessage *)fromMap:(NSDictionary *)dict {
155154
}
156155
- (NSDictionary *)toMap {
157156
return [NSDictionary
158-
dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]),
159-
@"textureId", (self.speed != nil ? self.speed : [NSNull null]),
160-
@"speed", nil];
157+
dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId",
158+
(self.speed ? self.speed : [NSNull null]), @"speed", nil];
161159
}
162160
@end
163161

@@ -176,10 +174,9 @@ + (FLTPositionMessage *)fromMap:(NSDictionary *)dict {
176174
}
177175
- (NSDictionary *)toMap {
178176
return [NSDictionary
179-
dictionaryWithObjectsAndKeys:(self.textureId != nil ? self.textureId : [NSNull null]),
180-
@"textureId",
181-
(self.position != nil ? self.position : [NSNull null]),
182-
@"position", nil];
177+
dictionaryWithObjectsAndKeys:(self.textureId ? self.textureId : [NSNull null]), @"textureId",
178+
(self.position ? self.position : [NSNull null]), @"position",
179+
nil];
183180
}
184181
@end
185182

@@ -194,7 +191,7 @@ + (FLTMixWithOthersMessage *)fromMap:(NSDictionary *)dict {
194191
}
195192
- (NSDictionary *)toMap {
196193
return [NSDictionary
197-
dictionaryWithObjectsAndKeys:(self.mixWithOthers != nil ? self.mixWithOthers : [NSNull null]),
194+
dictionaryWithObjectsAndKeys:(self.mixWithOthers ? self.mixWithOthers : [NSNull null]),
198195
@"mixWithOthers", nil];
199196
}
200197
@end
@@ -365,3 +362,4 @@ void FLTVideoPlayerApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTVi
365362
}
366363
}
367364
}
365+
#endif

packages/video_player/video_player_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.0-nullsafety
2+
3+
* Migrate to null safety.
4+
15
## 2.2.0
26

37
* Added option to set the video playback speed on the video controller.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: ../../../analysis_options.yaml
2+
analyzer:
3+
enable-experiment:
4+
- non-nullable

0 commit comments

Comments
 (0)