Skip to content

Commit cffa31d

Browse files
committed
use the imported js
1 parent d7d4e6a commit cffa31d

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

assets/mixpanel.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/analytics.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MixpanelManager {
55

66
static Future<Mixpanel> init() async {
77
if (_instance == null) {
8-
_instance = await Mixpanel.init("Your Mixpanel Token",
8+
_instance = await Mixpanel.init("5d9d3df08d1c34a272abf23d892820bf",
99
optOutTrackingDefault: false);
1010
}
1111
return _instance!;

example/pubspec.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.8.1"
10+
version: "2.5.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -28,7 +28,7 @@ packages:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.3.1"
31+
version: "1.2.0"
3232
clock:
3333
dependency: transitive
3434
description:
@@ -92,7 +92,7 @@ packages:
9292
name: meta
9393
url: "https://pub.dartlang.org"
9494
source: hosted
95-
version: "1.7.0"
95+
version: "1.3.0"
9696
mixpanel_flutter:
9797
dependency: "direct main"
9898
description:
@@ -118,7 +118,7 @@ packages:
118118
name: source_span
119119
url: "https://pub.dartlang.org"
120120
source: hosted
121-
version: "1.8.1"
121+
version: "1.8.0"
122122
stack_trace:
123123
dependency: transitive
124124
description:
@@ -153,7 +153,7 @@ packages:
153153
name: test_api
154154
url: "https://pub.dartlang.org"
155155
source: hosted
156-
version: "0.4.2"
156+
version: "0.2.19"
157157
typed_data:
158158
dependency: transitive
159159
description:

example/web/index.html

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
This is a placeholder for base href that will be replaced by the value of
1515
the `--base-href` argument provided to `flutter build`.
1616
-->
17-
<base href="$FLUTTER_BASE_HREF">
17+
<base href="/">
1818

1919
<meta charset="UTF-8">
2020
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
@@ -28,16 +28,17 @@
2828

2929
<title>mixpanel_flutter_example</title>
3030
<link rel="manifest" href="manifest.json">
31-
<script type="text/javascript">
32-
(function(f,b){if(!b.__SV){var e,g,i,h;window.mixpanel=b;b._i=[];b.init=function(e,f,c){function g(a,d){var b=d.split(".");2==b.length&&(a=a[b[0]],d=b[1]);a[d]=function(){a.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var a=b;"undefined"!==typeof c?a=b[c]=[]:c="mixpanel";a.people=a.people||[];a.toString=function(a){var d="mixpanel";"mixpanel"!==c&&(d+="."+c);a||(d+=" (stub)");return d};a.people.toString=function(){return a.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" ");
33-
for(h=0;h<i.length;h++)g(a,i[h]);var j="set set_once union unset remove delete".split(" ");a.get_group=function(){function b(c){d[c]=function(){call2_args=arguments;call2=[c].concat(Array.prototype.slice.call(call2_args,0));a.push([e,call2])}}for(var d={},e=["get_group"].concat(Array.prototype.slice.call(arguments,0)),c=0;c<j.length;c++)b(j[c]);return d};b._i.push([e,f,c])};b.__SV=1.2;e=f.createElement("script");e.type="text/javascript";e.async=!0;e.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?
34-
MIXPANEL_CUSTOM_LIB_URL:"file:"===f.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";g=f.getElementsByTagName("script")[0];g.parentNode.insertBefore(e,g)}})(document,window.mixpanel||[]);
35-
</script>
31+
<script src="./assets/packages/mixpanel_flutter/assets/mixpanel.js"></script>
3632
</head>
3733
<body>
3834
<!-- This script installs service_worker.js to provide PWA functionality to
3935
application. For more information, see:
4036
https://developers.google.com/web/fundamentals/primers/service-workers -->
37+
38+
<p id="RipVanWinkle">
39+
RipVanWinkle paragraph.
40+
</p>
41+
4142
<script>
4243
var serviceWorkerVersion = null;
4344
var scriptLoaded = false;

pubspec.lock

+8-15
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.8.1"
31+
version: "2.5.0"
3232
boolean_selector:
3333
dependency: transitive
3434
description:
@@ -49,7 +49,7 @@ packages:
4949
name: charcode
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "1.3.1"
52+
version: "1.2.0"
5353
cli_util:
5454
dependency: transitive
5555
description:
@@ -121,13 +121,6 @@ packages:
121121
description: flutter
122122
source: sdk
123123
version: "0.0.0"
124-
frontend_server_client:
125-
dependency: transitive
126-
description:
127-
name: frontend_server_client
128-
url: "https://pub.dartlang.org"
129-
source: hosted
130-
version: "2.1.2"
131124
glob:
132125
dependency: transitive
133126
description:
@@ -183,7 +176,7 @@ packages:
183176
name: meta
184177
url: "https://pub.dartlang.org"
185178
source: hosted
186-
version: "1.7.0"
179+
version: "1.3.0"
187180
mime:
188181
dependency: transitive
189182
description:
@@ -197,7 +190,7 @@ packages:
197190
name: node_preamble
198191
url: "https://pub.dartlang.org"
199192
source: hosted
200-
version: "2.0.1"
193+
version: "1.4.13"
201194
package_config:
202195
dependency: transitive
203196
description:
@@ -286,7 +279,7 @@ packages:
286279
name: source_span
287280
url: "https://pub.dartlang.org"
288281
source: hosted
289-
version: "1.8.1"
282+
version: "1.8.0"
290283
stack_trace:
291284
dependency: transitive
292285
description:
@@ -321,21 +314,21 @@ packages:
321314
name: test
322315
url: "https://pub.dartlang.org"
323316
source: hosted
324-
version: "1.17.10"
317+
version: "1.16.5"
325318
test_api:
326319
dependency: transitive
327320
description:
328321
name: test_api
329322
url: "https://pub.dartlang.org"
330323
source: hosted
331-
version: "0.4.2"
324+
version: "0.2.19"
332325
test_core:
333326
dependency: transitive
334327
description:
335328
name: test_core
336329
url: "https://pub.dartlang.org"
337330
source: hosted
338-
version: "0.4.0"
331+
version: "0.3.15"
339332
typed_data:
340333
dependency: transitive
341334
description:

pubspec.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ dev_dependencies:
2020
test: ^1.16.5
2121

2222
flutter:
23+
assets:
24+
- assets/mixpanel.js
25+
2326
plugin:
2427
platforms:
2528
android:

0 commit comments

Comments
 (0)