-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to flutter 2 #10
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 2.0.0 | ||
|
||
- Migrate to flutter 2 | ||
|
||
## 1.11.2 | ||
|
||
- Bump and pin version for Android lib to 1.1.1 because of bug | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
// ignore_for_file: lines_longer_than_80_chars | ||
|
||
import 'package:posthog_flutter/src/posthog_web.dart'; | ||
|
||
import 'package:flutter_web_plugins/flutter_web_plugins.dart'; | ||
|
||
// ignore: public_member_api_docs | ||
void registerPlugins(Registrar registrar) { | ||
PosthogWeb.registerWith(registrar); | ||
registrar.registerMessageHandler(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:meta/meta.dart'; | ||
import 'package:posthog_flutter/src/posthog_platform_interface.dart'; | ||
|
||
export 'package:posthog_flutter/src/posthog_observer.dart'; | ||
|
@@ -15,12 +13,12 @@ class Posthog { | |
return _instance; | ||
} | ||
|
||
String currentScreen; | ||
String? currentScreen; | ||
|
||
Future<void> identify({ | ||
@required userId, | ||
Map<String, dynamic> properties, | ||
Map<String, dynamic> options, | ||
required userId, | ||
Map<String, dynamic>? properties, | ||
Map<String, dynamic>? options, | ||
}) { | ||
return _posthog.identify( | ||
userId: userId, | ||
|
@@ -30,9 +28,9 @@ class Posthog { | |
} | ||
|
||
Future<void> capture({ | ||
@required String eventName, | ||
Map<String, dynamic> properties, | ||
Map<String, dynamic> options, | ||
required String eventName, | ||
required Map<String, dynamic> properties, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems to have diverged from lib/src/posthog_method_channel.dart where properties are correctly assigned as optional There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, I'm going to make it nullable instead of required |
||
Map<String, dynamic>? options, | ||
}) { | ||
if (!properties.containsKey('\$screen_name')) { | ||
properties['\$screen_name'] = this.currentScreen; | ||
|
@@ -45,9 +43,9 @@ class Posthog { | |
} | ||
|
||
Future<void> screen({ | ||
@required String screenName, | ||
Map<String, dynamic> properties, | ||
Map<String, dynamic> options, | ||
required String screenName, | ||
Map<String, dynamic>? properties, | ||
Map<String, dynamic>? options, | ||
}) { | ||
if (screenName != '/') { | ||
this.currentScreen = screenName; | ||
|
@@ -60,16 +58,16 @@ class Posthog { | |
} | ||
|
||
Future<void> alias({ | ||
@required String alias, | ||
Map<String, dynamic> options, | ||
required String alias, | ||
Map<String, dynamic>? options, | ||
}) { | ||
return _posthog.alias( | ||
alias: alias, | ||
options: options, | ||
); | ||
} | ||
|
||
Future<String> get getAnonymousId { | ||
Future<String?> get getAnonymousId { | ||
return _posthog.getAnonymousId; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this standard Dart indentation? (I don't know so I'm truly asking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's pretty odd for those who are used to other languages, but it's the default, I even used dart format in this file before saving the changes