blob: 5f992268473f9c91b1a2e8df0c394d6d10e46392 [file] [log] [blame]
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:telemetry/telemetry.dart';
/// An implementation of [Analytics] that's appropriate to use when analytics
/// have not been enabled.
class NoopAnalytics extends Analytics {
@override
String? get applicationName => null;
@override
String? get applicationVersion => null;
@override
bool get enabled => false;
@override
set enabled(bool value) {
// Ignored
}
@override
Stream<Map<String, dynamic>> get onSend async* {
// Ignored
}
@override
void close() {
// Ignored
}
@override
getSessionValue(String param) {
// Ignored
}
@override
dynamic noSuchMethod(Invocation invocation) {
throw UnimplementedError();
}
@override
Future sendEvent(String category, String action,
{String? label, int? value, Map<String, String>? parameters}) async {
// Ignored
}
@override
Future sendException(String description, {bool? fatal}) async {
// Ignored
}
@override
Future sendScreenView(String viewName,
{Map<String, String>? parameters}) async {
// Ignored
}
@override
Future sendSocial(String network, String action, String target) async {
// Ignored
}
@override
Future sendTiming(String variableName, int time,
{String? category, String? label}) async {
// Ignored
}
@override
void setSessionValue(String param, value) {
// Ignored
}
@override
Future waitForLastPing({Duration? timeout}) async {
// Ignored
}
}