[firebase_performance] Fix invokeMethod formatting that caused a bug with Dart code obfuscation (#1874)
* Fix invokeMethod formatting that caused a bug with Dart code obfuscation
diff --git a/packages/firebase_performance/CHANGELOG.md b/packages/firebase_performance/CHANGELOG.md
index 57b64e7..f906a5d 100644
--- a/packages/firebase_performance/CHANGELOG.md
+++ b/packages/firebase_performance/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.3.0+3
+
+* Fix bug that caused `invokeMethod` to fail with Dart code obfuscation
+
## 0.3.0+2
* Fix bug preventing this plugin from working with hot restart.
diff --git a/packages/firebase_performance/lib/src/firebase_performance.dart b/packages/firebase_performance/lib/src/firebase_performance.dart
index e2498ec..0ecad74 100644
--- a/packages/firebase_performance/lib/src/firebase_performance.dart
+++ b/packages/firebase_performance/lib/src/firebase_performance.dart
@@ -37,7 +37,7 @@
/// does not reflect whether instrumentation is enabled/disabled.
Future<bool> isPerformanceCollectionEnabled() {
return channel.invokeMethod<bool>(
- '$FirebasePerformance#isPerformanceCollectionEnabled',
+ 'FirebasePerformance#isPerformanceCollectionEnabled',
<String, dynamic>{'handle': _handle},
);
}
@@ -48,7 +48,7 @@
/// application. By default, performance monitoring is enabled.
Future<void> setPerformanceCollectionEnabled(bool enable) {
return channel.invokeMethod<void>(
- '$FirebasePerformance#setPerformanceCollectionEnabled',
+ 'FirebasePerformance#setPerformanceCollectionEnabled',
<String, dynamic>{'handle': _handle, 'enable': enable},
);
}
@@ -62,7 +62,7 @@
final int handle = _nextHandle++;
FirebasePerformance.channel.invokeMethod<void>(
- '$FirebasePerformance#newTrace',
+ 'FirebasePerformance#newTrace',
<String, dynamic>{'handle': _handle, 'traceHandle': handle, 'name': name},
);
@@ -74,7 +74,7 @@
final int handle = _nextHandle++;
FirebasePerformance.channel.invokeMethod<void>(
- '$FirebasePerformance#newHttpMetric',
+ 'FirebasePerformance#newHttpMetric',
<String, dynamic>{
'handle': _handle,
'httpMetricHandle': handle,
diff --git a/packages/firebase_performance/lib/src/http_metric.dart b/packages/firebase_performance/lib/src/http_metric.dart
index c0b27bb..704b36c 100644
--- a/packages/firebase_performance/lib/src/http_metric.dart
+++ b/packages/firebase_performance/lib/src/http_metric.dart
@@ -59,7 +59,7 @@
_httpResponseCode = httpResponseCode;
FirebasePerformance.channel.invokeMethod<void>(
- '$HttpMetric#httpResponseCode',
+ 'HttpMetric#httpResponseCode',
<String, dynamic>{
'handle': _handle,
'httpResponseCode': httpResponseCode,
@@ -76,7 +76,7 @@
_requestPayloadSize = requestPayloadSize;
FirebasePerformance.channel.invokeMethod<void>(
- '$HttpMetric#requestPayloadSize',
+ 'HttpMetric#requestPayloadSize',
<String, dynamic>{
'handle': _handle,
'requestPayloadSize': requestPayloadSize,
@@ -93,7 +93,7 @@
_responseContentType = responseContentType;
FirebasePerformance.channel.invokeMethod<void>(
- '$HttpMetric#responseContentType',
+ 'HttpMetric#responseContentType',
<String, dynamic>{
'handle': _handle,
'responseContentType': responseContentType,
@@ -110,7 +110,7 @@
_responsePayloadSize = responsePayloadSize;
FirebasePerformance.channel.invokeMethod<void>(
- '$HttpMetric#responsePayloadSize',
+ 'HttpMetric#responsePayloadSize',
<String, dynamic>{
'handle': _handle,
'responsePayloadSize': responsePayloadSize,
@@ -129,7 +129,7 @@
_hasStarted = true;
return FirebasePerformance.channel.invokeMethod<void>(
- '$HttpMetric#start',
+ 'HttpMetric#start',
<String, dynamic>{'handle': _handle},
);
}
@@ -147,7 +147,7 @@
_hasStopped = true;
return FirebasePerformance.channel.invokeMethod<void>(
- '$HttpMetric#stop',
+ 'HttpMetric#stop',
<String, dynamic>{'handle': _handle},
);
}
diff --git a/packages/firebase_performance/lib/src/performance_attributes.dart b/packages/firebase_performance/lib/src/performance_attributes.dart
index 77d4f18..020b61a 100644
--- a/packages/firebase_performance/lib/src/performance_attributes.dart
+++ b/packages/firebase_performance/lib/src/performance_attributes.dart
@@ -48,7 +48,7 @@
_attributes[name] = value;
return FirebasePerformance.channel.invokeMethod<void>(
- '$PerformanceAttributes#putAttribute',
+ 'PerformanceAttributes#putAttribute',
<String, dynamic>{
'handle': _handle,
'name': name,
@@ -66,7 +66,7 @@
_attributes.remove(name);
return FirebasePerformance.channel.invokeMethod<void>(
- '$PerformanceAttributes#removeAttribute',
+ 'PerformanceAttributes#removeAttribute',
<String, dynamic>{'handle': _handle, 'name': name},
);
}
@@ -85,7 +85,7 @@
}
return FirebasePerformance.channel.invokeMapMethod<String, String>(
- '$PerformanceAttributes#getAttributes',
+ 'PerformanceAttributes#getAttributes',
<String, dynamic>{'handle': _handle},
);
}
diff --git a/packages/firebase_performance/lib/src/trace.dart b/packages/firebase_performance/lib/src/trace.dart
index cf8e1fb..43efb25 100644
--- a/packages/firebase_performance/lib/src/trace.dart
+++ b/packages/firebase_performance/lib/src/trace.dart
@@ -52,7 +52,7 @@
_hasStarted = true;
return FirebasePerformance.channel.invokeMethod<void>(
- '$Trace#start',
+ 'Trace#start',
<String, dynamic>{'handle': _handle},
);
}
@@ -70,7 +70,7 @@
_hasStopped = true;
return FirebasePerformance.channel.invokeMethod<void>(
- '$Trace#stop',
+ 'Trace#stop',
<String, dynamic>{'handle': _handle},
);
}
@@ -88,7 +88,7 @@
_metrics.putIfAbsent(name, () => 0);
_metrics[name] += value;
return FirebasePerformance.channel.invokeMethod<void>(
- '$Trace#incrementMetric',
+ 'Trace#incrementMetric',
<String, dynamic>{'handle': _handle, 'name': name, 'value': value},
);
}
@@ -103,7 +103,7 @@
_metrics[name] = value;
return FirebasePerformance.channel.invokeMethod<void>(
- '$Trace#setMetric',
+ 'Trace#setMetric',
<String, dynamic>{'handle': _handle, 'name': name, 'value': value},
);
}
@@ -116,7 +116,7 @@
if (_hasStopped) return Future<int>.value(_metrics[name] ?? 0);
return FirebasePerformance.channel.invokeMethod<int>(
- '$Trace#getMetric',
+ 'Trace#getMetric',
<String, dynamic>{'handle': _handle, 'name': name},
);
}
diff --git a/packages/firebase_performance/pubspec.yaml b/packages/firebase_performance/pubspec.yaml
index 0a8f3bd..01ab9f3 100644
--- a/packages/firebase_performance/pubspec.yaml
+++ b/packages/firebase_performance/pubspec.yaml
@@ -4,7 +4,7 @@
iOS.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_performance
-version: 0.3.0+2
+version: 0.3.0+3
dependencies:
flutter: