Skip to content

Commit 0bd815c

Browse files
author
Ali Abdelfattah
authored
Merge pull request #184 from Instabug/fix/null-safety
Fix/null safety issues
2 parents 5a5c53d + cb71e91 commit 0bd815c

19 files changed

+473
-258
lines changed

.circleci/config.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
background: true
4141
- run:
4242
name: download flutter SDK
43-
command: if ! test -f "~/flutter_sdk.zip"; then curl -o ~/flutter_sdk.zip https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_1.20.4-stable.zip; fi
43+
command: if ! test -f "~/flutter_sdk.zip"; then curl -o ~/flutter_sdk.zip https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_2.2.3-stable.zip; fi
4444
- run:
4545
name: unzip flutter SDK
4646
command: unzip ~/flutter_sdk.zip -d ~
4747
- run: flutter doctor
4848
- run:
4949
name: Flutter build
50-
command: cd ..; flutter build aot
50+
command: cd ..; flutter build apk
5151
- run:
5252
name: Download Android Dependencies
5353
command: ./gradlew androidDependencies
@@ -86,7 +86,7 @@ jobs:
8686
command: sudo gem install cocoapods
8787
- run:
8888
name: download flutter SDK
89-
command: if ! test -f "~/flutter_sdk.zip"; then curl -o ~/flutter_sdk.zip https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_1.20.4-stable.zip; fi
89+
command: if ! test -f "~/flutter_sdk.zip"; then curl -o ~/flutter_sdk.zip https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_2.2.3-stable.zip; fi
9090
- run:
9191
name: unzip flutter SDK
9292
command: unzip ~/flutter_sdk.zip -d ~
@@ -98,9 +98,6 @@ jobs:
9898
- run:
9999
name: Install Pods
100100
command: cd ios && pod install --repo-update
101-
- run:
102-
name: Flutter build
103-
command: flutter build aot
104101
- run:
105102
name: Build and run tests
106103
command: cd ios && xcodebuild -allowProvisioningUpdates -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12 Pro Max,OS=14.3' test | xcpretty

Dangerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ if github.pr_body.length < 3 && git.lines_of_code > 10
88
end
99

1010
if !git.modified_files.include?("CHANGELOG.md") && !declared_trivial
11-
fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/Instabug/Instabug-Flutter/blob/master/CHANGELOG.md).", sticky: false)
11+
warn("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/Instabug/Instabug-Flutter/blob/master/CHANGELOG.md).", sticky: false)
1212
end

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ EXTERNAL SOURCES:
2323
:path: ".symlinks/plugins/instabug_flutter/ios"
2424

2525
SPEC CHECKSUMS:
26-
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
26+
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
2727
Instabug: 28838c071edc50e4f13800e6877645d3b328aab9
2828
instabug_flutter: 65794e9f82acebde599e56cc6a2e74a17b69410e
2929
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
3030

3131
PODFILE CHECKSUM: 082ec096394aa5e2e9254f7b7845847607911bda
3232

33-
COCOAPODS: 1.9.1
33+
COCOAPODS: 1.10.1

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@
607607
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
608608
CLANG_ENABLE_MODULES = YES;
609609
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
610+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
610611
ENABLE_BITCODE = NO;
611612
FRAMEWORK_SEARCH_PATHS = (
612613
"$(inherited)",
@@ -621,7 +622,7 @@
621622
"$(inherited)",
622623
"$(PROJECT_DIR)/Flutter",
623624
);
624-
PRODUCT_BUNDLE_IDENTIFIER = com.example.InstabugSample;
625+
PRODUCT_BUNDLE_IDENTIFIER = com.instabug.InstabugSample;
625626
PRODUCT_NAME = "$(TARGET_NAME)";
626627
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
627628
SWIFT_VERSION = 5.0;
@@ -743,6 +744,7 @@
743744
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
744745
CLANG_ENABLE_MODULES = YES;
745746
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
747+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
746748
ENABLE_BITCODE = NO;
747749
FRAMEWORK_SEARCH_PATHS = (
748750
"$(inherited)",
@@ -757,7 +759,7 @@
757759
"$(inherited)",
758760
"$(PROJECT_DIR)/Flutter",
759761
);
760-
PRODUCT_BUNDLE_IDENTIFIER = com.example.InstabugSample;
762+
PRODUCT_BUNDLE_IDENTIFIER = com.instabug.InstabugSample;
761763
PRODUCT_NAME = "$(TARGET_NAME)";
762764
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
763765
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -773,6 +775,7 @@
773775
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
774776
CLANG_ENABLE_MODULES = YES;
775777
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
778+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
776779
ENABLE_BITCODE = NO;
777780
FRAMEWORK_SEARCH_PATHS = (
778781
"$(inherited)",
@@ -787,7 +790,7 @@
787790
"$(inherited)",
788791
"$(PROJECT_DIR)/Flutter",
789792
);
790-
PRODUCT_BUNDLE_IDENTIFIER = com.example.InstabugSample;
793+
PRODUCT_BUNDLE_IDENTIFIER = com.instabug.InstabugSample;
791794
PRODUCT_NAME = "$(TARGET_NAME)";
792795
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
793796
SWIFT_VERSION = 5.0;
@@ -808,7 +811,7 @@
808811
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
809812
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
810813
CODE_SIGN_STYLE = Automatic;
811-
DEVELOPMENT_TEAM = C3ZD2T892Z;
814+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
812815
GCC_C_LANGUAGE_STANDARD = gnu11;
813816
INFOPLIST_FILE = InstabugSampleTests/Info.plist;
814817
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
@@ -839,7 +842,7 @@
839842
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
840843
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
841844
CODE_SIGN_STYLE = Automatic;
842-
DEVELOPMENT_TEAM = C3ZD2T892Z;
845+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
843846
GCC_C_LANGUAGE_STANDARD = gnu11;
844847
INFOPLIST_FILE = InstabugSampleTests/Info.plist;
845848
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
@@ -869,7 +872,7 @@
869872
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
870873
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
871874
CODE_SIGN_STYLE = Automatic;
872-
DEVELOPMENT_TEAM = C3ZD2T892Z;
875+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
873876
GCC_C_LANGUAGE_STANDARD = gnu11;
874877
INFOPLIST_FILE = InstabugSampleTests/Info.plist;
875878
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
@@ -898,7 +901,7 @@
898901
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
899902
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
900903
CODE_SIGN_STYLE = Automatic;
901-
DEVELOPMENT_TEAM = C3ZD2T892Z;
904+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
902905
GCC_C_LANGUAGE_STANDARD = gnu11;
903906
INFOPLIST_FILE = InstabugSampleUITests/Info.plist;
904907
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
@@ -928,7 +931,7 @@
928931
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
929932
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
930933
CODE_SIGN_STYLE = Automatic;
931-
DEVELOPMENT_TEAM = C3ZD2T892Z;
934+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
932935
GCC_C_LANGUAGE_STANDARD = gnu11;
933936
INFOPLIST_FILE = InstabugSampleUITests/Info.plist;
934937
IPHONEOS_DEPLOYMENT_TARGET = 14.3;
@@ -957,7 +960,7 @@
957960
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
958961
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
959962
CODE_SIGN_STYLE = Automatic;
960-
DEVELOPMENT_TEAM = C3ZD2T892Z;
963+
DEVELOPMENT_TEAM = 56S6Q9SA8U;
961964
GCC_C_LANGUAGE_STANDARD = gnu11;
962965
INFOPLIST_FILE = InstabugSampleUITests/Info.plist;
963966
IPHONEOS_DEPLOYMENT_TARGET = 14.3;

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:instabug_flutter/Surveys.dart';
99

1010
void main() {
1111
FlutterError.onError = (FlutterErrorDetails details) {
12-
Zone.current.handleUncaughtError(details.exception, details.stack);
12+
Zone.current.handleUncaughtError(details.exception, details.stack!);
1313
};
1414

1515
runZonedGuarded(() => runApp(MyApp()), CrashReporting.reportCrash);
@@ -46,7 +46,7 @@ class MyApp extends StatelessWidget {
4646
}
4747

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

5151
// This widget is the home page of your application. It is stateful, meaning
5252
// that it has a State object (defined below) that contains fields that affect

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=2.7.0 <3.0.0"
21+
sdk: ">=2.12.0 <3.0.0"
2222

2323
dependencies:
2424
flutter:

ios/Classes/InstabugFlutterPlugin.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
4343
[inv getReturnValue:&returnVal];
4444
NSObject *resultSet = (__bridge NSObject *)returnVal;
4545
result(resultSet);
46-
} else {
47-
result(nil);
4846
}
4947
}
5048
if (!isImplemented) {

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: 4 additions & 8 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
@@ -38,11 +38,7 @@ class CrashReporting {
3838
/// [StackTrace] stack
3939
static Future<void> reportHandledCrash(dynamic exception,
4040
[StackTrace? stack]) async {
41-
if (stack != null) {
42-
_sendCrash(exception, stack, true);
43-
} else {
44-
_sendCrash(exception, StackTrace.current, true);
45-
}
41+
_sendCrash(exception, stack ?? StackTrace.current, true);
4642
}
4743

4844
static Future<void> _reportUnhandledCrash(
@@ -59,7 +55,7 @@ class CrashReporting {
5955
trace.frames[i].uri.toString(),
6056
trace.frames[i].member,
6157
trace.frames[i].line,
62-
trace.frames[i].column == null ? 0 : trace.frames[i].column!));
58+
trace.frames[i].column ?? 0));
6359
}
6460
final CrashData crashData = CrashData(
6561
exception.toString(), Platform.operatingSystem.toString(), frames);

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) {

pubspec.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: instabug_flutter
2-
version: 10.0.0
2+
version: 9.2.0-nullsafety.0
33
description: >-
4-
Instabug is an in-app feedback and bug reporting tool for mobile apps.
5-
With just a simple shake, your users or beta testers can report bugs or
6-
send in-app feedback and the SDK will capture an environment snapshot of
7-
your user's device including all console logs, server-side network requests
8-
and bug reproduction steps compiling all these details in one organised dashboard
9-
to help you debug and fix bugs faster.
4+
Deliver the best user experience through a comprehensive platform that will
5+
help you uncover, analyze and fix any app performance, quality or stability issues.
106
homepage: https://github.com/Instabug/Instabug-Flutter#readme
117
documentation: https://github.com/Instabug/Instabug-Flutter#readme
128

@@ -19,7 +15,7 @@ dev_dependencies:
1915
build_runner: ^2.0.3
2016
flutter_test:
2117
sdk: flutter
22-
mockito: ^5.0.7
18+
mockito: ^5.0.10
2319

2420
flutter:
2521
plugin:
@@ -32,4 +28,4 @@ flutter:
3228

3329
environment:
3430
sdk: ">=2.12.0 <3.0.0"
35-
flutter: ">=2.0.0 <3.0.0"
31+
flutter: ">=1.17.0 <3.0.0"

0 commit comments

Comments
 (0)