From e53fbdb30c582ed79e7fbeb2539435fb58eee977 Mon Sep 17 00:00:00 2001 From: Luiz Eduardo Date: Sun, 12 Jan 2020 13:12:37 -0300 Subject: [PATCH] Future --- README.md | 4 ++-- lib/src/mautic_tracking.dart | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2978d67..036d9cc 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ Send App Screen info to Mautic. **Method Definition:** ```dart -void trackScreen(String screenPath, [String screenName]) async; +Future trackScreen(String screenPath, [String screenName]) async; ``` | Property | Type | Required | Description | @@ -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 trackEvent(String eventKey, String eventName, String screenPath, [String screenName]) async; ``` | Property | Type | Required | Description | diff --git a/lib/src/mautic_tracking.dart b/lib/src/mautic_tracking.dart index c15bcdd..fbcbdf4 100644 --- a/lib/src/mautic_tracking.dart +++ b/lib/src/mautic_tracking.dart @@ -69,7 +69,7 @@ class MauticTracking { } /// Make Request to Tracking - void _makeRequest({Map params}) async { + Future _makeRequest({Map params}) async { if (email != null) { params.addEntries({MapEntry('email', email)}); } @@ -126,7 +126,7 @@ class MauticTracking { /// // Track the App Start /// await trackAppStart(); /// ``` - void trackAppStart() async { + Future trackAppStart() async { await _makeRequest( params: { 'page_url': 'app_started', @@ -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 trackScreen(String screenPath, [String screenName]) async { if (screenName == null) { await _makeRequest( params: { @@ -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 trackEvent( String eventKey, String eventName, String screenPath, [ @@ -206,7 +206,7 @@ class MauticTracking { } /// Modify Contact Tags - void _changeTag(Set _tags, {bool addOperation = true}) async { + Future _changeTag(Set _tags, {bool addOperation = true}) async { _tags = _tags .map( (item) => (addOperation) ? item : '-$item', @@ -228,7 +228,7 @@ class MauticTracking { /// // Sent Event Key, Event Label and Screen Path /// addTag({'tag1', 'tag2'}); /// ``` - void addTag(Set _tags) async { + Future addTag(Set _tags) async { await _changeTag(_tags); } @@ -240,7 +240,7 @@ class MauticTracking { /// // Sent Event Key, Event Label and Screen Path /// removeTag({'tag1', 'tag2'}); /// ``` - void removeTag(Set _tags) async { + Future removeTag(Set _tags) async { await _changeTag(_tags, addOperation: false); } }