Skip to content

Commit 5bff15e

Browse files
committed
update docs
1 parent b48410e commit 5bff15e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+201
-163
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
.idea/workspace.xml
44
.packages
55
.pub/
6-
6+
.idea
77
build/

.idea/libraries/Dart_SDK.xml

-19
This file was deleted.

.idea/libraries/Flutter_Plugins.xml

-9
This file was deleted.

.idea/modules.xml

-10
This file was deleted.

.idea/runConfigurations/example_lib_main_dart.xml

-6
This file was deleted.

.idea/vcs.xml

-8
This file was deleted.

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
## 0.0.1
1+
## 1.0.0
22

3-
* initial release
3+
- This is our first release! 🎉🎉🎉
4+
Report issues or give us any feedback is appreciated!
5+
- [integration guide](https://developer.mixpanel.com/docs/flutter)
6+
- [full API reference](https://mixpanel.github.io/mixpanel-flutter)

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
<div align="center" style="text-align: center">
3-
<img src="https://github.com/mixpanel/mixpanel-android/blob/assets/mixpanel.png?raw=true" alt="Mixpanel Flutter Library" height="150"/>
3+
<img src="https://github.com/mixpanel/mixpanel-android/blob/assets/mixpanel.png?raw=true" alt="Mixpanel Flutter SDK" height="150"/>
44
</div>
55

66
#####
@@ -17,8 +17,8 @@
1717

1818

1919
# Introduction
20-
Welcome to the official Mixpanel Flutter library.
21-
The Mixpanel Flutter library is an open-source project, and we'd love to see your contributions!
20+
Welcome to the official Mixpanel Flutter SDK.
21+
The Mixpanel Flutter SDK is an open-source project, and we'd love to see your contributions!
2222
We'd also love for you to come and work with us! Check out **[Jobs](https://mixpanel.com/jobs/#openings)** for details
2323

2424
# Quick Start Guide
@@ -48,7 +48,7 @@ import 'package:mixpanel_flutter/mixpanel_flutter.dart';
4848
```
4949
## Integration
5050
### Initialization
51-
To start tracking with the library you must first initialize with your project token. To initialize the library, first add `import 'package:mixpanel_flutter/mixpanel_flutter.dart';` and call `Mixpanel.init(token);` with your project token as it's argument.
51+
To start tracking with the SDK you must first initialize with your project token. To initialize the SDK, first add `import 'package:mixpanel_flutter/mixpanel_flutter.dart';` and call `Mixpanel.init(token);` with your project token as it's argument.
5252
```dart
5353
import 'package:mixpanel_flutter/mixpanel_flutter.dart';
5454
...
@@ -68,7 +68,7 @@ class _YourClassState extends State<YourClass> {
6868
```
6969
Once you've called this method once, you can access `mixpanel` throughout the rest of your application.
7070
### Tracking
71-
Once you've initialized the library, Mixpanel will <a href="https://mixpanel.com/help/questions/articles/which-common-mobile-events-can-mixpanel-collect-on-my-behalf-automatically" target="_blank">automatically collect common mobile events</a>. You can enable/ disable automatic collection through your <a href="https://mixpanel.com/help/questions/articles/how-do-i-enable-common-mobile-events-if-i-have-already-implemented-mixpanel" target="_blank">project settings</a>.
71+
Once you've initialized the SDK, Mixpanel will <a href="https://mixpanel.com/help/questions/articles/which-common-mobile-events-can-mixpanel-collect-on-my-behalf-automatically" target="_blank">automatically collect common mobile events</a>. You can enable/ disable automatic collection through your <a href="https://mixpanel.com/help/questions/articles/how-do-i-enable-common-mobile-events-if-i-have-already-implemented-mixpanel" target="_blank">project settings</a>.
7272
With the `mixpanel` object created in [the last step](#integration) a call to `track` is all you need to send additional events to Mixpanel.
7373
```js
7474
// Track with event-name

docs/__404error.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<header id="title">
2727
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
2828
<ol class="breadcrumbs gt-separated dark hidden-xs">
29-
<li><a href="https://github.com/mixpanel/mixpanel-flutter">mixpanel_flutter package</a></li>
29+
<li><a href="https://mixpanel.com">mixpanel_flutter package</a></li>
3030
</ol>
3131
<div class="self-name">mixpanel_flutter</div>
3232
<form class="search navbar-right" role="search">
@@ -44,7 +44,7 @@
4444
</header>
4545

4646
<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
47-
<li><a href="https://github.com/mixpanel/mixpanel-flutter">mixpanel_flutter package</a></li>
47+
<li><a href="https://mixpanel.com">mixpanel_flutter package</a></li>
4848
</ol>
4949

5050
<h5><span class="package-name">mixpanel_flutter</span> <span class="package-kind">package</span></h5>

docs/index.html

+19-21
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<header id="title">
2727
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
2828
<ol class="breadcrumbs gt-separated dark hidden-xs">
29-
<li><a href="https://github.com/mixpanel/mixpanel-flutter">mixpanel_flutter package</a></li>
29+
<li><a href="https://mixpanel.com">mixpanel_flutter package</a></li>
3030
</ol>
3131
<div class="self-name">mixpanel_flutter</div>
3232
<form class="search navbar-right" role="search">
@@ -44,7 +44,7 @@
4444
</header>
4545

4646
<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
47-
<li><a href="https://github.com/mixpanel/mixpanel-flutter">mixpanel_flutter package</a></li>
47+
<li><a href="https://mixpanel.com">mixpanel_flutter package</a></li>
4848
</ol>
4949

5050
<h5 class="hidden-xs"><span class="package-name">mixpanel_flutter</span> <span class="package-kind">package</span></h5>
@@ -57,7 +57,7 @@ <h5 class="hidden-xs"><span class="package-name">mixpanel_flutter</span> <span c
5757
<div id="dartdoc-main-content" class="main-content">
5858
<section class="desc markdown">
5959
<div align="center" style="text-align: center">
60-
<img src="https://github.com/mixpanel/mixpanel-android/blob/assets/mixpanel.png?raw=true" alt="Mixpanel React Native Library" height="150">
60+
<img src="https://github.com/mixpanel/mixpanel-android/blob/assets/mixpanel.png?raw=true" alt="Mixpanel Flutter SDK" height="150">
6161
</div>
6262
<p>#####</p>
6363
<h1 id="table-of-contents">Table of Contents</h1><!-- MarkdownTOC -->
@@ -72,8 +72,8 @@ <h1 id="table-of-contents">Table of Contents</h1><!-- MarkdownTOC -->
7272
<li><a href="#i-want-to-know-more">I want to know more!</a></li>
7373
</ul><!-- /MarkdownTOC -->
7474
<h1 id="introduction">Introduction</h1>
75-
<p>Welcome to the official Mixpanel Flutter library.
76-
The Mixpanel Flutter library is an open-source project, and we'd love to see your contributions!
75+
<p>Welcome to the official Mixpanel Flutter SDK.
76+
The Mixpanel Flutter SDK is an open-source project, and we'd love to see your contributions!
7777
We'd also love for you to come and work with us! Check out <strong><a href="https://mixpanel.com/jobs/#openings">Jobs</a></strong> for details</p>
7878
<h1 id="quick-start-guide">Quick Start Guide</h1>
7979
<p>Check out our <strong><a href="https://developer.mixpanel.com/docs/flutter">official documentation</a></strong> for more in depth information on installing and using Mixpanel on Flutter.</p>
@@ -85,60 +85,58 @@ <h3 id="prerequisite">Prerequisite</h3>
8585
</ul>
8686
<h3 id="steps">Steps</h3>
8787
<ol>
88-
<li>Depend on it
88+
<li>Depend on it <br>
8989
Add this to your package's pubspec.yaml file:</li>
9090
</ol>
9191
<pre class="language-dart"><code> dependencies:
92-
mixpanel_flutter: ^1.0.0
92+
mixpanel_flutter: ^1.0.0 # set this to your desired version
9393
</code></pre>
9494
<ol start="2">
95-
<li>Install it
96-
You can install packages from the command line:
97-
with Flutter:</li>
95+
<li>Install it <br>
96+
You can install packages from the command line:</li>
9897
</ol>
9998
<pre class="language-dart"><code> $ flutter pub get
10099
</code></pre>
101100
<ol start="3">
102-
<li>Import it
101+
<li>Import it <br>
103102
Now in your Dart code, you can use:</li>
104103
</ol>
105104
<pre class="language-dart"><code>import 'package:mixpanel_flutter/mixpanel_flutter.dart';
106105
</code></pre>
107106
<h2 id="integration">Integration</h2>
108107
<h3 id="initialization">Initialization</h3>
109-
<p>To start tracking with the library you must first initialize with your project token. To initialize the library, first add <code>import 'package:mixpanel_flutter/mixpanel_flutter.dart';</code> and call <code>Mixpanel.init(token);</code> with your project token as it's argument.</p>
108+
<p>To start tracking with the SDK you must first initialize with your project token. To initialize the SDK, first add <code>import 'package:mixpanel_flutter/mixpanel_flutter.dart';</code> and call <code>Mixpanel.init(token);</code> with your project token as it's argument.</p>
110109
<pre class="language-dart"><code class="language-dart">import 'package:mixpanel_flutter/mixpanel_flutter.dart';
111110
...
112111
class _YourClassState extends State&lt;YourClass&gt; {
113-
Mixpanel _mixpanel;
112+
Mixpanel mixpanel;
114113

115114
@override
116115
void initState() {
117-
super.initState();
118-
initMixpanel();
116+
super.initState();
117+
initMixpanel();
119118
}
120119

121120
Future&lt;void&gt; initMixpanel() async {
122-
_mixpanel = await Mixpanel.init("5d9d3df08d1c34a272abf23d892820bf",
123-
optOutTrackingDefault: false);
121+
mixpanel = await Mixpanel.init("Your Mixpanel Token", optOutTrackingDefault: false);
124122
}
125123
...
126124
</code></pre>
127125
<p>Once you've called this method once, you can access <code>mixpanel</code> throughout the rest of your application.</p>
128126
<h3 id="tracking">Tracking</h3>
129-
<p>Once you've initialized the library, Mixpanel will <a href="https://mixpanel.com/help/questions/articles/which-common-mobile-events-can-mixpanel-collect-on-my-behalf-automatically" target="_blank">automatically collect common mobile events</a>. You can enable/ disable automatic collection through your <a href="https://mixpanel.com/help/questions/articles/how-do-i-enable-common-mobile-events-if-i-have-already-implemented-mixpanel" target="_blank">project settings</a>.
127+
<p>Once you've initialized the SDK, Mixpanel will <a href="https://mixpanel.com/help/questions/articles/which-common-mobile-events-can-mixpanel-collect-on-my-behalf-automatically" target="_blank">automatically collect common mobile events</a>. You can enable/ disable automatic collection through your <a href="https://mixpanel.com/help/questions/articles/how-do-i-enable-common-mobile-events-if-i-have-already-implemented-mixpanel" target="_blank">project settings</a>.
130128
With the <code>mixpanel</code> object created in <a href="#integration">the last step</a> a call to <code>track</code> is all you need to send additional events to Mixpanel.</p>
131129
<pre class="language-js"><code class="language-js">// Track with event-name
132130
mixpanel.track('Sent Message');
133131
// Track with event-name and property
134-
mixpanel.track('Plan Selected', properties: {'Plan': 'Premium'});;
132+
mixpanel.track('Plan Selected', properties: {'Plan': 'Premium'});
135133
</code></pre>
136-
<p>You're done! You've successfully integrated the Mixpanel React Native SDK into your app. To stay up to speed on important SDK releases and updates, star or watch our repository on <a href="https://github.com/mixpanel/mixpanel-flutter">Github</a>.</p>
134+
<p>You're done! You've successfully integrated the Mixpanel Flutter SDK into your app. To stay up to speed on important SDK releases and updates, star or watch our repository on <a href="https://github.com/mixpanel/mixpanel-flutter">Github</a>.</p>
137135
<p><a name="i-want-to-know-more"></a></p>
138136
<h1 id="i-want-to-know-more">I want to know more!</h1>
139137
<p>No worries, here are some links that you will find useful:</p>
140138
<ul>
141-
<li><strong><a href="https://github.com/mixpanel/mixpanel-flutter/tree/master/example">Sample app</a></strong></li>
139+
<li><strong><a href="https://github.com/mixpanel/mixpanel-flutter/tree/main/example">Sample app</a></strong></li>
142140
<li><strong><a href="https://developer.mixpanel.com/docs/flutter">Full API Reference</a></strong></li>
143141
</ul>
144142
<p>Have any questions? Reach out to Mixpanel <a href="https://help.mixpanel.com/hc/en-us/requests/new">Support</a> to speak to someone smart, quickly.</p>

docs/mixpanel_flutter/Mixpanel-class.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ <h2>Methods</h2>
216216
</dt>
217217
<dd>
218218
Will return true if the user has opted out from tracking.
219-
return <code>true</code> if user has opted out from tracking. Defaults to false.
219+
return true if user has opted out from tracking. Defaults to false.
220220

221221
</dd>
222222
<dt id="identify" class="callable">

docs/mixpanel_flutter/Mixpanel/addGroup.html

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ <h2><span>Implementation</span></h2>
131131
if (_MixpanelHelper.isValidString(groupKey)) {
132132
_channel.invokeMethod&lt;void&gt;(&#39;addGroup&#39;,
133133
&lt;String, dynamic&gt;{&#39;groupKey&#39;: groupKey, &#39;groupID&#39;: groupID});
134+
} else {
135+
developer.log(&#39;`addGroup` failed: groupKey cannot be blank&#39;,
136+
name: &#39;mixpanel&#39;);
134137
}
135138
}</code></pre>
136139
</section>

docs/mixpanel_flutter/Mixpanel/alias.html

+3
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ <h5>Mixpanel class</h5>
134134
<h2><span>Implementation</span></h2>
135135
<pre class="language-dart"><code class="language-dart">void alias(String alias, String distinctId) {
136136
if (!_MixpanelHelper.isValidString(alias)) {
137+
developer.log(&#39;`alias` failed: alias cannot be blank&#39;, name: &#39;mixpanel&#39;);
137138
return;
138139
}
139140
if (!_MixpanelHelper.isValidString(distinctId)) {
141+
developer.log(&#39;`alias` failed: distinctId cannot be blank&#39;,
142+
name: &#39;mixpanel&#39;);
140143
return;
141144
}
142145
_channel.invokeMethod&lt;void&gt;(

docs/mixpanel_flutter/Mixpanel/deleteGroup.html

+3
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ <h2><span>Implementation</span></h2>
133133
if (_MixpanelHelper.isValidString(groupKey)) {
134134
_channel.invokeMethod&lt;void&gt;(&#39;deleteGroup&#39;,
135135
&lt;String, dynamic&gt;{&#39;groupKey&#39;: groupKey, &#39;groupID&#39;: groupID});
136+
} else {
137+
developer.log(&#39;`deleteGroup` failed: groupKey cannot be blank&#39;,
138+
name: &#39;mixpanel&#39;);
136139
}
137140
}</code></pre>
138141
</section>

docs/mixpanel_flutter/Mixpanel/eventElapsedTime.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ <h5>Mixpanel class</h5>
128128
<h2><span>Implementation</span></h2>
129129
<pre class="language-dart"><code class="language-dart">Future&lt;double&gt; eventElapsedTime(String eventName) async {
130130
if (_MixpanelHelper.isValidString(eventName)) {
131-
return await _channel.invokeMethod&lt;double&gt;(&#39;eventElapsedTime&#39;, &lt;String, dynamic&gt;{&#39;eventName&#39;: eventName});
131+
return await _channel.invokeMethod&lt;double&gt;(
132+
&#39;eventElapsedTime&#39;, &lt;String, dynamic&gt;{&#39;eventName&#39;: eventName});
132133
} else {
133134
return 0;
134135
}

docs/mixpanel_flutter/Mixpanel/hasOptedOutTracking.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ <h5>Mixpanel class</h5>
117117
</section>
118118
<section class="desc markdown">
119119
<p>Will return true if the user has opted out from tracking.
120-
return <code>true</code> if user has opted out from tracking. Defaults to false.</p>
120+
return true if user has opted out from tracking. Defaults to false.</p>
121121
</section>
122122

123123
<section class="summary source-code" id="source">

docs/mixpanel_flutter/Mixpanel/identify.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ <h2><span>Implementation</span></h2>
129129
_channel.invokeMethod&lt;void&gt;(
130130
&#39;identify&#39;, &lt;String, dynamic&gt;{&#39;distinctId&#39;: distinctId});
131131
} else {
132-
developer.log(&#39;cannot identify blank distinct id&#39;, name: &#39;mixpanel&#39;);
132+
developer.log(&#39;`identify` failed: distinctId cannot be blank&#39;,
133+
name: &#39;mixpanel&#39;);
133134
}
134135
}</code></pre>
135136
</section>

docs/mixpanel_flutter/Mixpanel/registerSuperProperties.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ <h5>Mixpanel class</h5>
133133
<section class="summary source-code" id="source">
134134
<h2><span>Implementation</span></h2>
135135
<pre class="language-dart"><code class="language-dart">void registerSuperProperties(Map&lt;String, dynamic&gt; properties) {
136-
_channel.invokeMethod&lt;void&gt;(&#39;registerSuperProperties&#39;,
137-
&lt;String, dynamic&gt;{&#39;properties&#39;: properties});
136+
_channel.invokeMethod&lt;void&gt;(
137+
&#39;registerSuperProperties&#39;, &lt;String, dynamic&gt;{&#39;properties&#39;: properties});
138138
}</code></pre>
139139
</section>
140140

docs/mixpanel_flutter/Mixpanel/registerSuperPropertiesOnce.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ <h5>Mixpanel class</h5>
128128
<section class="summary source-code" id="source">
129129
<h2><span>Implementation</span></h2>
130130
<pre class="language-dart"><code class="language-dart">void registerSuperPropertiesOnce(Map&lt;String, dynamic&gt; properties) {
131-
_channel.invokeMethod&lt;void&gt;(&#39;registerSuperPropertiesOnce&#39;,
132-
&lt;String, dynamic&gt;{&#39;properties&#39;: properties});
131+
_channel.invokeMethod&lt;void&gt;(&#39;registerSuperPropertiesOnce&#39;,
132+
&lt;String, dynamic&gt;{&#39;properties&#39;: properties});
133133
}</code></pre>
134134
</section>
135135

docs/mixpanel_flutter/Mixpanel/removeGroup.html

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ <h2><span>Implementation</span></h2>
131131
if (_MixpanelHelper.isValidString(groupKey)) {
132132
_channel.invokeMethod&lt;void&gt;(&#39;removeGroup&#39;,
133133
&lt;String, dynamic&gt;{&#39;groupKey&#39;: groupKey, &#39;groupID&#39;: groupID});
134+
} else {
135+
developer.log(&#39;`removeGroup` failed: groupKey cannot be blank&#39;,
136+
name: &#39;mixpanel&#39;);
134137
}
135138
}</code></pre>
136139
</section>

docs/mixpanel_flutter/Mixpanel/setGroup.html

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ <h2><span>Implementation</span></h2>
131131
if (_MixpanelHelper.isValidString(groupKey)) {
132132
_channel.invokeMethod&lt;void&gt;(&#39;setGroup&#39;,
133133
&lt;String, dynamic&gt;{&#39;groupKey&#39;: groupKey, &#39;groupID&#39;: groupID});
134+
} else {
135+
developer.log(&#39;`setGroup` failed: groupKey cannot be blank&#39;,
136+
name: &#39;mixpanel&#39;);
134137
}
135138
}</code></pre>
136139
</section>

docs/mixpanel_flutter/Mixpanel/setLoggingEnabled.html

+11-5
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,17 @@ <h5>Mixpanel class</h5>
132132
<section class="summary source-code" id="source">
133133
<h2><span>Implementation</span></h2>
134134
<pre class="language-dart"><code class="language-dart">void setLoggingEnabled(bool loggingEnabled) {
135-
if (Platform.isIOS) {
136-
_channel.invokeMethod&lt;void&gt;(&#39;setLoggingEnabled&#39;,
137-
&lt;String, dynamic&gt;{&#39;loggingEnabled&#39;: loggingEnabled});
138-
}
139-
}</code></pre>
135+
if (Platform.isIOS) {
136+
if (loggingEnabled != null) {
137+
_channel.invokeMethod&lt;void&gt;(&#39;setLoggingEnabled&#39;,
138+
&lt;String, dynamic&gt;{&#39;loggingEnabled&#39;: loggingEnabled});
139+
} else {
140+
developer.log(
141+
&#39;`setLoggingEnabled` failed: loggingEnabled cannot be blank&#39;,
142+
name: &#39;mixpanel&#39;);
143+
}
144+
}
145+
}</code></pre>
140146
</section>
141147

142148
</div> <!-- /.main-content -->

0 commit comments

Comments
 (0)