Skip to content

Commit

Permalink
[firebase_crashlytics]add missing type parameters and pump min flutte…
Browse files Browse the repository at this point in the history
…r version to 1.5.0 (firebase#1667)
  • Loading branch information
Chris Yang authored May 31, 2019
1 parent a1ffe69 commit 1e90d26
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
5 changes: 5 additions & 0 deletions packages/firebase_crashlytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.4+4

* Add missing template type parameter to `invokeMethod` calls.
* Bump minimum Flutter version to 1.5.0.

## 0.0.4+3

* Migrate our handling of `FlutterErrorDetails` to work on both Flutter stable
Expand Down
34 changes: 9 additions & 25 deletions packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ class Crashlytics {
Trace.format(details.stack).trimRight().split('\n');
final List<Map<String, String>> stackTraceElements =
_getStackTraceElements(stackTraceLines);
final dynamic result =
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
await channel.invokeMethod('Crashlytics#onError', <String, dynamic>{
final dynamic result = await channel
.invokeMethod<dynamic>('Crashlytics#onError', <String, dynamic>{
'exception': details.exceptionAsString(),
// FlutterErrorDetails.context has been migrated from a String to a
// DiagnosticsNode. Coerce it to a String here in a way that will work
Expand All @@ -66,19 +63,15 @@ class Crashlytics {
/// Reports the global value for debug mode.
/// TODO(kroikie): Clarify what this means in context of both Android and iOS.
Future<bool> isDebuggable() async {
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
final bool result = await channel.invokeMethod('Crashlytics#isDebuggable');
final bool result =
await channel.invokeMethod<bool>('Crashlytics#isDebuggable');
return result;
}

/// Returns Crashlytics SDK version.
Future<String> getVersion() async {
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
final String result = await channel.invokeMethod('Crashlytics#getVersion');
final String result =
await channel.invokeMethod<String>('Crashlytics#getVersion');
return result;
}

Expand Down Expand Up @@ -126,30 +119,21 @@ class Crashlytics {
/// Optionally set a end-user's name or username for display within the
/// Crashlytics UI. Please be mindful of end-user's privacy.
Future<void> setUserEmail(String email) async {
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
await channel.invokeMethod(
await channel.invokeMethod<void>(
'Crashlytics#setUserEmail', <String, dynamic>{'email': email});
}

/// Specify a user identifier which will be visible in the Crashlytics UI.
/// Please be mindful of end-user's privacy.
Future<void> setUserIdentifier(String identifier) async {
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
await channel.invokeMethod('Crashlytics#setUserIdentifier',
await channel.invokeMethod<void>('Crashlytics#setUserIdentifier',
<String, dynamic>{'identifier': identifier});
}

/// Specify a user name which will be visible in the Crashlytics UI. Please
/// be mindful of end-user's privacy.
Future<void> setUserName(String name) async {
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
// https://github.com/flutter/flutter/issues/26431
// ignore: strong_mode_implicit_dynamic_method
await channel.invokeMethod(
await channel.invokeMethod<void>(
'Crashlytics#setUserName', <String, dynamic>{'name': name});
}

Expand Down
3 changes: 2 additions & 1 deletion packages/firebase_crashlytics/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: firebase_crashlytics
description: Flutter plugin for Firebase Crashlytics. It reports uncaught errors to the
Firebase console.
version: 0.0.4+3
version: 0.0.4+4
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_crashlytics

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
flutter: ">=1.5.0"

dependencies:
flutter:
Expand Down

0 comments on commit 1e90d26

Please sign in to comment.