| Index: packages/usage/example/ga.dart
|
| diff --git a/packages/usage/example/ga.dart b/packages/usage/example/ga.dart
|
| index ad64249fff1c97c61e0099f13030623b225d86f0..dcd91106b02b1c1c29712b6952c8906625881be4 100644
|
| --- a/packages/usage/example/ga.dart
|
| +++ b/packages/usage/example/ga.dart
|
| @@ -2,12 +2,14 @@
|
| // 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.
|
|
|
| -/// A simple command-line app to hand-test the usage library.
|
| +/**
|
| + * A simple command-line app to hand-test the usage library.
|
| + */
|
| library usage_ga;
|
|
|
| import 'package:usage/usage_io.dart';
|
|
|
| -main(List args) async {
|
| +void main(List args) {
|
| final String DEFAULT_UA = 'UA-55029513-1';
|
|
|
| if (args.isEmpty) {
|
| @@ -19,17 +21,18 @@ main(List args) async {
|
|
|
| String ua = args.isEmpty ? DEFAULT_UA : args.first;
|
|
|
| - Analytics ga = new AnalyticsIO(ua, 'ga_test', '3.0');
|
| -
|
| - await ga.sendScreenView('home');
|
| - await ga.sendScreenView('files');
|
| - await ga
|
| - .sendException('foo error:\n${sanitizeStacktrace(StackTrace.current)}');
|
| - await ga.sendTiming('writeDuration', 123);
|
| - await ga.sendEvent('create', 'consoleapp', label: 'Console App');
|
| - print('pinged ${ua}');
|
| -
|
| - await ga.waitForLastPing();
|
| -
|
| - ga.close();
|
| + Analytics ga = new AnalyticsIO(ua, 'ga_test', '1.0');
|
| + ga.optIn = true;
|
| +
|
| + ga.sendScreenView('home').then((_) {
|
| + return ga.sendScreenView('files');
|
| + }).then((_) {
|
| + return ga.sendException('foo exception, line 123:56');
|
| + }).then((_) {
|
| + return ga.sendTiming('writeDuration', 123);
|
| + }).then((_) {
|
| + return ga.sendEvent('create', 'consoleapp', label: 'Console App');
|
| + }).then((_) {
|
| + print('pinged ${ua}');
|
| + });
|
| }
|
|
|