Skip to content

Commit 6808401

Browse files
committed
edits
1 parent 64395ed commit 6808401

File tree

1 file changed

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

1 file changed

+26
-4
lines changed

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ hidden: false
44
---
55

66
> info ""
7-
> The Analytics-Flutter library is currently in public beta and is governed by Segment's [First Access and Beta Preview Terms](https://www.twilio.com/en-us/legal/tos){:target="_blank"}. For more information, see the [Analytics-Flutter GitHub repository](https://github.com/segmentio/analytics_flutter){:target="_blank"}.
7+
> The Analytics-Flutter library is currently in public beta and is governed by Segment's [First Access and Beta Preview Terms](https://www.twilio.com/en-us/legal/tos){:target="_blank"}. For more information, see the [Analytics-Flutter GitHub repository](https://github.com/segmentio/analytics_flutter){:target="_blank"}.
88
9-
Analytics-Flutter enables you to seamlessly add Segment analytics to your Flutter1 app.
9+
> warning "Updated package for pilot users"
10+
> 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.
11+
12+
Analytics-Flutter enables you to seamlessly add Segment analytics to your Flutter app.
1013

1114
### Supported platforms
1215
Analytics-Flutter supports these platforms:
@@ -88,6 +91,25 @@ These are the options you can apply to configure the client:
8891
| `appStateStream`| null | Set this to override the stream of application foreground or background events. |
8992
| `requestFactory`| true | Set this to override the factory to generate HTTP requests. Type: [RequestFactory](https://github.com/segmentio/analytics_flutter/blob/master/packages/core/lib/state.dart#L546){:target="_blank"}.|
9093
94+
### Upgrading from pilot
95+
If you've been using Analytics-Flutter since the pilot phase, follow these steps to use the upgraded version of Analytics-Flutter as Segment renamed the package of the library from `analytics` to `segment_analytics`.
96+
97+
1. Remove the `analytics` package and use `segment_analytics` in your `pubspec.yaml` file.
98+
99+
```diff
100+
- analytics:
101+
- git:
102+
- url: https://github.com/segmentio/analytics_flutter
103+
- ref: main
104+
- path: packages/core
105+
+ segment_analytics: ^1.0.1
106+
```
107+
2. Change the imports from `package:analytics` to `package:segment_analytics` in your dart files.
108+
109+
```diff
110+
- import 'package:analytics/client.dart';
111+
+ import 'package:segment_analytics/client.dart';
112+
```
91113
92114
## Tracking methods
93115
Once you’ve installed the Analytics-Flutter library, you can start collecting data through Segment’s tracking methods:
@@ -181,7 +203,7 @@ analytics.group("some-company", groupTraits: GroupTraits(
181203
{% endcodeexample %}
182204

183205
## Utility methods
184-
The Analytics-Flutter utility methods help you work with plugins fro the analytics timeline. They include:
206+
The Analytics-Flutter utility methods help you work with plugins from the analytics timeline. They include:
185207
* [Alias](#alias)
186208
* [Reset](#reset)
187209
* [Flush](#flush)
@@ -253,7 +275,7 @@ If you don't do this, the old client instance still exists and retains the timer
253275

254276
## Automatic screen tracking
255277

256-
To set up automatic screen tracking, you need to add the analytics navigator observer to your app's navigator observers. For example, if you're using the `MaterialApp` class, add the following:
278+
Automatic screen tracking enables you to track navigation globally, as sending a `screen()` event with each navigation action gets tiresome quickly. To set up automatic screen tracking, you need to add the analytics navigator observer to your app's navigator observers. For example, if you're using the `MaterialApp` class, add the following:
257279

258280
```dart
259281
return MaterialApp(navigatorObservers: [

0 commit comments

Comments
 (0)