You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final analytics = createClient(Configuration(/*...*/, flushPolicies: [
388
375
CountFlushPolicy(10),
@@ -427,8 +414,8 @@ A `FlushPolicy` can optionally implement:
427
414
The `FlushPolicy` should have a `shouldFlush` boolean value. When this is set to true, the client attempts to upload events. Each policy should reset this value to `false` according to its own logic, although it's pretty common to do it inside the `reset` method.
class FlushOnScreenEventsPolicy extends FlushPolicy {
434
421
@@ -454,7 +441,7 @@ class FlushOnScreenEventsPolicy extends FlushPolicy {
454
441
By default, any logging is done through the standard Flutter logging mechanism. To customize logging, you can build your own logger, which must implement the `LogTarget` mixin. For example:
455
442
456
443
```dart
457
-
import 'package:analytics/logger.dart';
444
+
import 'package:segment_analytics/logger.dart';
458
445
459
446
void customDebugLog(String msg) {
460
447
// ...
@@ -498,7 +485,7 @@ The error handler configuration receives a function which gets called whenever a
498
485
You can use this error handling to trigger different behaviors in the client when a problem occurs. For example if the client gets rate limited, you could use the error handler to swap flush policies to be less aggressive.
499
486
500
487
```dart
501
-
import 'package:analytics/errors.dart';
488
+
import 'package:segment_analytics/errors.dart';
502
489
503
490
//...
504
491
@@ -526,7 +513,7 @@ final analytics = createClient(Configuration(writeKey),
526
513
Plugins can also report errors to the handler by using the [`.error`](https://github.com/segmentio/analytics_flutter/blob/main/packages/core/lib/analytics.dart#L52){:target="_blank"} functionof the analytics client. Segment recommends you to use the `PluginError`for consistency, and to attach the `innerError` with the actual exception that was hit.
0 commit comments