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: [
410
397
CountFlushPolicy(10),
@@ -449,8 +436,8 @@ A `FlushPolicy` can optionally implement:
449
436
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 {
456
443
@@ -476,7 +463,7 @@ class FlushOnScreenEventsPolicy extends FlushPolicy {
476
463
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:
477
464
478
465
```dart
479
-
import 'package:analytics/logger.dart';
466
+
import 'package:segment_analytics/logger.dart';
480
467
481
468
void customDebugLog(String msg) {
482
469
// ...
@@ -520,7 +507,7 @@ The error handler configuration receives a function which gets called whenever a
520
507
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.
521
508
522
509
```dart
523
-
import 'package:analytics/errors.dart';
510
+
import 'package:segment_analytics/errors.dart';
524
511
525
512
//...
526
513
@@ -548,7 +535,7 @@ final analytics = createClient(Configuration(writeKey),
548
535
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"} function of 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