Skip to content

Commit 1ffb21e

Browse files
Update platformVersion return type to nullable
1 parent 5a5c53d commit 1ffb21e

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

lib/BugReporting.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class BugReporting {
2828
static Function? _onDismissCallback;
2929
static const MethodChannel _channel = MethodChannel('instabug_flutter');
3030

31-
static Future<String> get platformVersion async =>
32-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
31+
static Future<String?> get platformVersion async =>
32+
await _channel.invokeMethod<String>('getPlatformVersion');
3333

3434
static Future<dynamic> _handleMethod(MethodCall call) async {
3535
switch (call.method) {

lib/Chats.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'package:flutter/services.dart';
77
class Chats {
88
static const MethodChannel _channel = MethodChannel('instabug_flutter');
99

10-
static Future<String> get platformVersion async =>
11-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
10+
static Future<String?> get platformVersion async =>
11+
await _channel.invokeMethod<String>('getPlatformVersion');
1212

1313
@deprecated
1414

lib/CrashReporting.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import 'package:stack_trace/stack_trace.dart';
1313
class CrashReporting {
1414
static const MethodChannel _channel = MethodChannel('instabug_flutter');
1515
static bool enabled = true;
16-
static Future<String> get platformVersion async =>
17-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
16+
static Future<String?> get platformVersion async =>
17+
await _channel.invokeMethod<String>('getPlatformVersion');
1818

1919
///Enables and disables Enables and disables automatic crash reporting.
2020
/// [boolean] isEnabled

lib/FeatureRequests.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ enum ActionType { requestNewFeature, addCommentToFeature }
99
class FeatureRequests {
1010
static const MethodChannel _channel = MethodChannel('instabug_flutter');
1111

12-
static Future<String> get platformVersion async =>
13-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
12+
static Future<String?> get platformVersion async =>
13+
await _channel.invokeMethod<String>('getPlatformVersion');
1414

1515
///Shows the UI for feature requests list
1616
static Future<void> show() async {

lib/Instabug.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ enum ReproStepsMode { enabled, disabled, enabledWithNoScreenshots }
9090
class Instabug {
9191
static const MethodChannel _channel = MethodChannel('instabug_flutter');
9292

93-
static Future<String> get platformVersion async =>
94-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
93+
static Future<String?> get platformVersion async =>
94+
await _channel.invokeMethod<String>('getPlatformVersion');
9595

9696
/// Starts the SDK.
9797
/// This is the main SDK method that does all the magic. This is the only

lib/InstabugLog.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'package:flutter/services.dart';
77
class InstabugLog {
88
static const MethodChannel _channel = MethodChannel('instabug_flutter');
99

10-
static Future<String> get platformVersion async =>
11-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
10+
static Future<String?> get platformVersion async =>
11+
await _channel.invokeMethod<String>('getPlatformVersion');
1212

1313
/// Appends a log [message] to Instabug internal log
1414
/// These logs are then sent along the next uploaded report.

lib/NetworkLogger.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import 'package:instabug_flutter/models/network_data.dart';
88
class NetworkLogger {
99
static const MethodChannel _channel = MethodChannel('instabug_flutter');
1010

11-
static Future<String> get platformVersion async =>
12-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
11+
static Future<String?> get platformVersion async =>
12+
await _channel.invokeMethod<String>('getPlatformVersion');
1313

1414
static Future<bool?> networkLog(NetworkData data) async {
1515
final params = <dynamic>[data.toMap()];

lib/Replies.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class Replies {
1111
static Function? _unreadRepliesCountCallback;
1212
static const MethodChannel _channel = MethodChannel('instabug_flutter');
1313

14-
static Future<String> get platformVersion async =>
15-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
14+
static Future<String?> get platformVersion async =>
15+
await _channel.invokeMethod<String>('getPlatformVersion');
1616

1717
static Future<dynamic> _handleMethod(MethodCall call) async {
1818
switch (call.method) {

lib/Surveys.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Surveys {
1212
static Function? _hasRespondedToSurveyCallback;
1313
static const MethodChannel _channel = MethodChannel('instabug_flutter');
1414

15-
static Future<String> get platformVersion async =>
16-
(await _channel.invokeMethod<String>('getPlatformVersion'))!;
15+
static Future<String?> get platformVersion async =>
16+
await _channel.invokeMethod<String>('getPlatformVersion');
1717

1818
static Future<dynamic> _handleMethod(MethodCall call) async {
1919
switch (call.method) {

0 commit comments

Comments
 (0)