Skip to content

Commit 7235133

Browse files
stayseesongpwseg
andauthored
Apply suggestions from code review
Co-authored-by: pwseg <[email protected]>
1 parent 661fe8f commit 7235133

File tree

1 file changed

+6
-6
lines changed
  • src/connections/sources/catalog/libraries/mobile/flutter

1 file changed

+6
-6
lines changed

src/connections/sources/catalog/libraries/mobile/flutter/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ hidden: false
99
> warning "Updated package for pilot users"
1010
> If you've been using Analytics-Flutter since the pilot phase, see [Upgrading from pilot](#upgrading-from-pilot) to use the updated version of Analytics-Flutter.
1111
12-
Analytics-Flutter enables you to seamlessly add Segment analytics to your Flutter app.
12+
Analytics-Flutter lets you add Segment analytics to your Flutter app.
1313

1414
### Supported platforms
1515
Analytics-Flutter supports these platforms:
@@ -383,7 +383,7 @@ You can use these plugins to meet your tracking needs:
383383
384384
## Controlling upload with flush policies
385385
386-
You can use `FlushPolicies` to more granurily control when events upload.
386+
You can use `FlushPolicies` to more granularly control when events upload.
387387
388388
A flush policy defines the strategy for deciding when to flush. This can be on an interval, on a certain time of day, after receiving a certain number of events, or even after receiving a particular event. This gives you more flexibility on when to send events to Segment.
389389
@@ -426,14 +426,14 @@ if (isConnected) {
426426
427427
You can create a custom `FlushPolicy` for your application needs by implementing the `FlushPolicy` interface. You can also extend the `FlushPolicyBase` class that already creates and handles the `shouldFlush` value reset.
428428
429-
A `FlushPolicy` only needs to implement 1 method:
429+
A `FlushPolicy` only needs to implement one method:
430430
- `onEvent(RawEvent event)`: Gets called on every event tracked by your client.
431431
432432
A `FlushPolicy` can optionally implement:
433433
- `reset()`: Calls after a flush is triggered either by your policy, by another policy, or manually.
434434
- `start()`: Executes when the flush policy is enabled and added to the client. This is a good place to start background operations, make async calls, and configure things before execution.
435435
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.
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.
437437
438438
```dart
439439
import 'package:segment_analytics/event.dart';
@@ -502,9 +502,9 @@ LogFactory.logger = CustomLogger();
502502
503503
You can handle analytics client errors through the `errorHandler` option.
504504
505-
The error handler configuration receives a function which gets called whenever an error happens on the analytics client. It receives an Exception, that extends one of the errors from [errors.dart](https://github.com/segmentio/analytics_flutter/blob/main/packages/core/lib/errors.dart){:target="_blank"}.
505+
The error handler configuration receives a function which gets called whenever an error happens on the analytics client. It receives an Exception that extends one of the errors from [errors.dart](https://github.com/segmentio/analytics_flutter/blob/main/packages/core/lib/errors.dart){:target="_blank"}.
506506
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.
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.
508508
509509
```dart
510510
import 'package:segment_analytics/errors.dart';

0 commit comments

Comments
 (0)