Skip to content

Commit

Permalink
Future<void>
Browse files Browse the repository at this point in the history
  • Loading branch information
luizeof committed Jan 12, 2020
1 parent 9d5d978 commit e53fbdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Send App Screen info to Mautic.
**Method Definition:**

```dart
void trackScreen(String screenPath, [String screenName]) async;
Future<void> trackScreen(String screenPath, [String screenName]) async;
```

| Property | Type | Required | Description |
Expand Down Expand Up @@ -127,7 +127,7 @@ Send App Event info to Mautic.
**Method Definition:**

```dart
void trackEvent(String eventKey, String eventName, String screenPath, [String screenName]) async;
Future<void> trackEvent(String eventKey, String eventName, String screenPath, [String screenName]) async;
```

| Property | Type | Required | Description |
Expand Down
14 changes: 7 additions & 7 deletions lib/src/mautic_tracking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MauticTracking {
}

/// Make Request to Tracking
void _makeRequest({Map<String, String> params}) async {
Future<void> _makeRequest({Map<String, String> params}) async {
if (email != null) {
params.addEntries({MapEntry('email', email)});
}
Expand Down Expand Up @@ -126,7 +126,7 @@ class MauticTracking {
/// // Track the App Start
/// await trackAppStart();
/// ```
void trackAppStart() async {
Future<void> trackAppStart() async {
await _makeRequest(
params: {
'page_url': 'app_started',
Expand All @@ -149,7 +149,7 @@ class MauticTracking {
/// // Send Screen Path and Timeline Name
/// trackScreen('view_contact', 'View Contact Info');
/// ```
void trackScreen(String screenPath, [String screenName]) async {
Future<void> trackScreen(String screenPath, [String screenName]) async {
if (screenName == null) {
await _makeRequest(
params: {
Expand Down Expand Up @@ -182,7 +182,7 @@ class MauticTracking {
/// // Sent Event Key, Evebt Label, Screen Path and Screen Name
/// trackEvent('change_password', 'Change User Password', 'user_info', 'User Info');
/// ```
void trackEvent(
Future<void> trackEvent(
String eventKey,
String eventName,
String screenPath, [
Expand All @@ -206,7 +206,7 @@ class MauticTracking {
}

/// Modify Contact Tags
void _changeTag(Set<String> _tags, {bool addOperation = true}) async {
Future<void> _changeTag(Set<String> _tags, {bool addOperation = true}) async {
_tags = _tags
.map(
(item) => (addOperation) ? item : '-$item',
Expand All @@ -228,7 +228,7 @@ class MauticTracking {
/// // Sent Event Key, Event Label and Screen Path
/// addTag({'tag1', 'tag2'});
/// ```
void addTag(Set<String> _tags) async {
Future<void> addTag(Set<String> _tags) async {
await _changeTag(_tags);
}

Expand All @@ -240,7 +240,7 @@ class MauticTracking {
/// // Sent Event Key, Event Label and Screen Path
/// removeTag({'tag1', 'tag2'});
/// ```
void removeTag(Set<String> _tags) async {
Future<void> removeTag(Set<String> _tags) async {
await _changeTag(_tags, addOperation: false);
}
}

0 comments on commit e53fbdb

Please sign in to comment.