Lawson  Wehner

Lawson Wehner

1658892060

Flutter_tworasky: Piwik PRO SDK Flutter Wrapper

Piwik PRO SDK Flutter Wrapper

SDK Configuration

Server

  • You need a Piwik PRO account on the cloud or an on-premises setup which your mobile app will communicate with. For details, please visit the Piwik PRO website.
  • Create a new website (or app) in the Piwik PRO web interface.
  • Copy and note the Website ID from “Administration > Websites & apps > Installation” and your server address.

Client

TODO: Add description once the wrapper library is added to pub dev

Configuration

You'll need to configure the tracker before using any other methods - for that you will need the base URL address of your tracking server and website ID (you can find it in Administration > Websites & apps > Installation on the web interface).

await FlutterPiwikProSdk.sharedInstance.configureTracker(baseURL: '01234567-89ab-cdef-0123-456789abcdef', siteId: 'https://your.piwik.pro.server.com');

iOS and Android parameters:

  • String baseURL - base URL of your tracking server
  • String siteId - ID of your website or application

Usage and general info

Every method from the sdk is async, and every method can throw exceptions - for example if you try to use sdk methods without configuring the tracker first - which you can capture using the standard try-catch approach. For example:

try {
    final result =
    await FlutterPiwikProSdk.sharedInstance.trackDownload('http://your.server.com/bonusmap2.zip');
    print(result);
} catch (exception) {
    //handle an exception
}

If a method call is succesful, most of the methods, unless specified, will return a String that describes which method was called, and which parameters were used, for example:

FlutterPiwikProSdk - configureTracker completed with parameters: baseURL: https://your.piwik.pro.server.com, siteId: 01234567-89ab-cdef-0123-456789abcdef

Using Piwik PRO SDK Flutter Wrapper

Data Anonymization

Anonymization is a feature that allows tracking a user’s activity for aggregated data analysis even if the user doesn’t consent to track the data. If a user does not agree to being tracked, he will not be identified as the same person across multiple sessions.

Personal data will not be tracked during the session (i.e. user ID) If the anonymization is enabled, a new visitor ID will be created each time the application starts.

Anonymization is enabled by default.

You can turn the anonymization on and off by calling setAnonymizationState:

await FlutterPiwikProSdk.sharedInstance.setAnonymizationState(true);
  • bool shouldAnonymize - pass true to enable anonymization, or false to disable it.

Tracking Screen Views

The basic functionality of the SDK is Tracking Screen Views which represent the content the user is viewing in the application. To track a screen you only need to provide the name of the screen. This name is internally translated by the SDK to an HTTP URL as the Piwik PRO server uses URLs for tracking views. Additionally, Piwik PRO SDK uses prefixes which are inserted in generated URLs for various types of action(s).

To track screen views you can use the trackScreen method:

    await FlutterPiwikProSdk.sharedInstance.trackScreen(screenName: "menuScreen");

iOS and Android parameters:

  • String path – title of the action being tracked. The appropriate screen path will be generated for this action.

Additional Android only parameters:

  • String? title (optional) – the title of the action being tracked.

Tracking Custom Events

Custom events can be used to track the user’s interaction with various custom components and features of your application, such as playing a song or a video. You can read more about events in the Piwik PRO documentation and ultimate guide to event tracking.

To track custom events you can use the trackCustomEvent method:

await FlutterPiwikProSdk.sharedInstance.trackCustomEvent(
    action: 'test action',
    category: 'test category',
    name: 'test name',
    value: 120);

iOS and Android parameters:

  • String category – this String defines the event category. You may define event categories based on the class of user actions ( e.g. taps, gestures, voice commands), or you may define them based upon the features available in your application (e.g. play, pause, fast forward, etc.).
  • String action – this String defines the specific event action within the category specified. In the example, we are essentially saying that the category of the event is user clicks, and the action is a button click.
  • String? name (optional) – this String defines a label associated with the event. For example, if you have multiple button controls on a screen, you might use the label to specify the specific identifier of a button that was clicked.
  • double? value (optional) – this Float defines a numerical value associated with the event. For example, if you were tracking “Buy” button clicks, you might log the number of items being purchased, or their total cost.

Additional Android only parameters:

  • String? path (optional) - the path under which this event occurred.

Tracking Exceptions

Tracking exceptions allow the measurement of exceptions and errors in your app. Exceptions are tracked on the server in a similar way as screen views, however, URLs internally generated for exceptions always use the fatal or caught prefix.

To track exceptions you can use the trackException method:

await FlutterPiwikProSdk.sharedInstance.trackException(description: "description of an exception", isFatal: false);

iOS and Android parameters:

  • String description – provides the exception message.
  • bool isFatal – true if an exception is fatal.

Tracking Social Interactions

Social interactions such as likes, shares and comments in various social networks can be tracked as below. This is tracked in a similar way as screen views.

To track social interactions you can use the trackSocialInteraction method:

await FlutterPiwikProSdk.sharedInstance.trackSocialInteraction(
    interaction: 'like',
    network: 'Facebook',
    target: 'Dogs');

iOS and Android parameters

  • String interaction – defines the social interaction, e.g. “Like”.
  • String network – defines the social network associated with interaction, e.g. “Facebook”
  • String? target (optional) – the target for which this interaction occurred, e.g. “Dogs”.

Tracking Downloads

You can track downloads initiated by your application by using the trackDownload method:

await FlutterPiwikProSdk.sharedInstance.trackDownload('http://your.server.com/bonusmap2.zip');

iOS and Android parameters

  • String url - URL of the downloaded content.

Tracking Application Installs

You can also track installations of your application. This event is sent to the server only once per application version (additional events won't be sent).

You can track app installs using the trackAppInstall method:

await FlutterPiwikProSdk.sharedInstance.trackAppInstall();

Tracking Outlinks

For tracking outlinks to external websites or other apps opened from your application you can use the trackOutlink method:

await FlutterPiwikProSdk.sharedInstance.trackOutlink('http://great.website.com');

iOS and Android parameters

  • String url - defines the outlink target. HTTPS, HTTP and FTP are valid.

Tracking Search Operations

Tracking search operations allow the measurement of popular keywords used for various search operations performed inside your application. To track them you can use the trackSearch method:

await FlutterPiwikProSdk.sharedInstance.trackSearch(keyword: 'Space', category: "Movies", numberOfHits: 100);

iOS and Android parameters

  • String keyword – the searched query that was used in the app.
  • String category – specify a search category.
  • int? numberOfHits(optional) – we recommend setting the search count to the number of search results displayed on the results page. When keywords are tracked with a count of 0, they will appear in the “No Result Search Keyword” report.

Tracking Content Impressions

You can track the impression of an ad using the trackContentImpression method:

 await FlutterPiwikProSdk.sharedInstance.trackContentImpression(
    contentName: "name",
    piece: 'piece',
    target: 'target');

iOS and Android parameters

  • String contentName – the name of the content, e.g. “Ad Foo Bar”.
  • String? piece (optional) – the actual content. For instance the path to an image, video, audio, any text.
  • String? target (optional) – the target of the content e.g. the URL of a landing page.

Tracking Content Interactions

When a user interacts with an ad by tapping on it, you can track it using the trackContentInteraction method:

await FlutterPiwikProSdk.sharedInstance.trackContentInteraction(
    contentName: "name",
    piece: 'piece',
    target: 'target',
    contentInteraction: 'Clicked really hard');

iOS and Android parameters

  • String contentName – the name of the content, e.g. “Ad Foo Bar”.
  • String? piece (optional) – the actual content. For instance the path to an image, video, audio, any text.
  • String? target (optional) – the target of the content e.g. the URL of a landing page.
  • String? contentInteraction (optional) - a type of interaction that occured, e.g. "tap"

Tracking Goals

Goal tracking is used to measure and improve your business objectives. To track goals, you first need to configure them on the server in your web panel. Goals such as, for example, subscribing to a newsletter can be tracked as below with the goal ID that you will see on the server after configuring the goal and optional revenue. The currency for the revenue can be set in the Piwik PRO Analytics settings. You can read more about goals here To track goals you can use the trackGoal method:

await FlutterPiwikProSdk.sharedInstance.trackGoal(goal: 10, revenue: 102.2);

iOS and Android parameters

  • int goal – a tracking request will trigger a conversion for the goal of the website being tracked with this ID.
  • double? revenue (optional) – a monetary value that has been generated as revenue by goal conversion.

Tracking Ecommerce Transactions

Ecommerce transactions (in-app purchases) can be tracked to help you improve your business strategy. To track a transaction you must provide two required values - the transaction identifier and grandTotal. Optionally, you can also provide values for subTotal, tax, shippingCost, discount and list of purchased items. To track an ecommerce transaction you can use the trackEcommerceTransaction method:

final ecommerceTransactionItems = [
EcommerceTransactionItem(category: 'cat1', sku: 'sku1', name: 'name1', price: 20, quantity: 1),
EcommerceTransactionItem(category: 'cat2', sku: 'sku2', name: 'name2', price: 10, quantity: 1),
EcommerceTransactionItem(category: 'cat3', sku: 'sku3', name: 'name3', price: 30, quantity: 2),
];
await FlutterPiwikProSdk.sharedInstance.trackEcommerceTransaction(
    identifier: "transactionID",
    grandTotal: 100,
    subTotal: 10,
    tax: 5,
    shippingCost: 100,
    discount: 6,
    transactionItems: ecommerceTransactionItems,
);

iOS and Android parameters

  • String identifier – a unique string identifying the order
  • int grandTotal – The total amount of the order, in cents
  • int? subTotal (optional) – the subtotal (net price) for the order, in cents
  • int? tax (optional) – the tax for the order, in cents
  • int? shippingCost (optional) – the shipping for the order, in cents
  • int? discount (optional) – the discount for the order, in cents
  • List<EcommerceTransactionItem>? transactionItems (optional) – the items included in the order

Tracking Campaigns

Tracking campaign URLs created with the online Campaign URL Builder tool allow you to measure how different campaigns (for example with Facebook ads or direct emails) bring traffic to your application. You can register a custom URL schema in your project settings to launch your application when users tap on the campaign link. You can track these URLs from the application delegate as below. The campaign information will be sent to the server together with the next analytics event. More details about campaigns can be found in the documentation. To track a campaign you can use the trackCampaign method:

await FlutterPiwikProSdk.sharedInstance.trackCampaign("http://example.org/offer.html?pk_campaign=Email-SummerDeals&pk_keyword=LearnMore");

iOS and Android parameters

  • String url - the campaign URL. HTTPS, HTTP and FTP are valid - the URL must contain a campaign name and keyword parameters.

Tracking Custom Variables

The feature will soon be disabled. We recommend using custom dimensions instead.

To track custom name-value pairs assigned to your users or screen views, you can use custom variables. A custom variable can have a visit scope, which means that they are assigned to the whole visit of the user or action scope meaning that they are assigned only to the next tracked action such as screen view. It is required for names and values to be encoded in UTF-8. You can add a custom variable using the trackCustomVariable method:

await FlutterPiwikProSdk.sharedInstance.trackCustomVariable(
    index: 1,
    name: 'filter',
    value: 'lcd',
    scope: CustomVariableScope.visit);

iOS and Android parameters

  • int index – a given custom variable name must always be stored in the same “index” per session. For example, if you choose to store the variable name = “Gender” in index = 1 and you record another custom variable in index = 1, then the “Gender” variable will be deleted and replaced with new custom variable stored in index 1. Please note that some of the indexes are already reserved. See Default custom variables section for details.
  • String name – this String defines the name of a specific Custom Variable such as “User type”. Limited to 200 characters.
  • String value – this String defines the value of a specific Custom Variable such as “Customer”. Limited to 200 characters.
  • CustomVariableScope scope – this String allows the specification of the tracking event type - “visit”, “action”, etc. The scope is the value from the enum CustomVariableScope and can be visit or action.

Tracking Custom Dimensions

You can also use custom dimensions to track custom values. Custom dimensions first have to be defined on the server in your web panel. More details about custom dimensions can be found in the documentation You can add a custom dimension using the trackCustomDimension method:

await FlutterPiwikProSdk.sharedInstance.trackCustomDimension(id: 1, value: 'english');

iOS and Android parameters

  • int index – a given custom dimension must always be stored in the same “index” per session, similar to custom variables. In example 1 is our dimension slot.
  • String value – this String defines the value of a specific custom dimension such as “English”. Limited to 200 characters.

Tracking Profile Attributes

Requires Audience Manager

The Audience Manager stores visitors’ profiles, which have data from a variety of sources. One of them can be a mobile application. It is possible to enrich the profiles with more attributes by passing any key-value pair like gender: male, favourite food: Italian, etc. It is recommended to set additional user identifiers such as email or User ID. This will allow the enrichment of existing profiles or merging profiles rather than creating a new profile. For example, if the user visited the website, browsed or filled in a form with his/her email (his data was tracked and profile created in Audience Manager) and, afterwards started using a mobile application, the existing profile will be enriched only if the email was set. Otherwise, a new profile will be created. To set profile attributes you can use the trackProfileAttribute method:

await FlutterPiwikProSdk.sharedInstance.trackProfileAttribute(name: 'food', value: 'chips');

iOS and Android parameters

  • String name – defines profile attribute name (non-null string).
  • String value – defines profile attribute value (non-null string).

Aside from attributes, each event also sends parameters which are retrieved from the tracker instance:

  • WEBSITE_ID – always sent.
  • USER_ID – if set.
  • EMAIL – if set.
  • VISITOR_ID – always sent, ID of the mobile application user, generated by the SDK.
  • DEVICE_ID – Advertising ID that, by default, is fetched automatically when the tracker instance is created (only on Android).

Reading User Profile Attributes

Requires Audience Manager

It is possible to read the attributes of a given profile, however, with some limitations. Due to of security reasons to avoid personal data leakage, it is possible to read only attributes that were enabled for API access (whitelisted) in the Attributes section of Audience Manager. To get user profile attributes you can use the readUserProfileAttributes method:

await FlutterPiwikProSdk.sharedInstance.readUserProfileAttributes()

Returned Value

  • Future<Map<String, String>> - this method returns a Map of key-value pairs, where each pair represent attribute name (key) and value (instead of a usual String that describes which method was called with which parameters)

Checking Audience Membership

Requires Audience Manager

Checking audience membership allows one to check if the user belongs to a specific group of users defined in the audience manger panel based on analytics data and audience manager profile attributes. You can check if a user belongs to a given audience, for example, to display him/her some type of special offer. You can check audience membership using the checkAudienceMembership method:

await FlutterPiwikProSdk.sharedInstance.checkAudienceMembership('audienceId');

iOS and Android parameters

  • String audienceId – ID of the audience (Audience Manager -> Audiences tab)

Returned Value

  • Future<bool> - this method returns a bool value (true if a user is a member of an audience, false otherwise) instead of a usual String that describes which method was called with which parameters.

Advanced usage

User ID

The user ID is an additional, optional non-empty unique string identifying the user (not set by default). It can be, for example, a unique username or user’s email address. If the provided user ID is sent to the analytics part together with the visitor ID (which is always automatically generated by the SDK), it allows the association of events from various platforms (for example iOS and Android) to the same user provided that the same user ID is used on all platforms. You can read more about User ID here. You can set a user id using the setUserId method:

await FlutterPiwikProSdk.sharedInstance.setUserId('testUserId')

iOS and Android parameters

  • String id – any non-empty unique string identifying the user. Passing null will delete the current user ID

User Email Address

The user email address is an another string used for identifying users - a provided user email is sent to the audience manager part when you send the custom profile attribute configured on the audience manager web panel. Similarly to the user ID, it allows the association of data from various platforms (for example iOS and Android) to the same user as long as the same email is used on all platforms.

It is recommended to set the user email to track audience manager profile attributes as it will create a better user profile.

You can set a user email using the setUserEmail method:

await FlutterPiwikProSdk.sharedInstance.setUserEmail('user@email.com');

iOS and Android parameters

  • String email – a string representing an email address

Visitor ID

SDK uses various IDs for tracking the user. The main one is visitor ID, which is internally randomly generated once by the SDK on the first usage and is then stored locally on the device. The visitor ID will never change unless the user removes the application from the device so that all events sent from his device will always be assigned to the same user in the Piwik PRO web panel. When the anonymization is enabled, a new visitor id is generated each time the application is started. We recommend using userID instead of VisitorID. Still, you can set a visitor ID using the setVisitorId method:

await FlutterPiwikProSdk.sharedInstance.setVisitorId('Id');

iOS and Android parameters

  • String id - a string containing a new Visitor ID

Setting Session Timeout

A session represents a set of user’s interactions with your app. By default, Analytics is closing the session after 30 minutes of inactivity, counting from the last recorded event in session and when the user will open up the app again the new session is started. You can configure the tracker to automatically close the session when users have placed your app in the background for a period of time. You can change the session timeout using the setSessionTimeout method:

await FlutterPiwikProSdk.sharedInstance.setSessionTimeout(1000)

iOS and Android parameters

  • int timeoutInMilliseconds - Session timeout in milliseconds. Default: 1800000 (30 minutes)

Setting Dispatch Interval

All tracking events are saved locally and by default. They are automatically sent to the server every 30 seconds. You can change this interval using the setDispatchInterval method:

await FlutterPiwikProSdk.sharedInstance.setDispatchInterval(10000)

iOS and Android parameters

  • int intervalInMilliseconds - Dispatch interval in milliseconds. Default: 30000

Default Custom Variables

The SDK, by default, automatically adds some information in custom variables about the device (index 1), system version (index 2) and app version (index 3). By default, this option is turned on.

In case you need to configure custom variables separately, turn off this option and see the section above about tracking custom variables.

You can disable this behavior using the setIncludeDefaultVariables method:

await FlutterPiwikProSdk.sharedInstance.setIncludeDefaultVariables(false);

iOS and Android parameters

  • bool shouldInclude - a boolean value that removes Default Variables when false

Opt-Out

You can disable all tracking in the application by using the opt-out feature. No events will be sent to the server if the opt-out is set. By default, opt-out is not set and events are tracked. You can opt out of tracking using the optOut method:

await FlutterPiwikProSdk.sharedInstance.optOut(true);

iOS and Android parameters

  • bool shouldOptOut - a boolean value that disables all tracking in the app when set to true.

Dry Run

The SDK provides a dryRun flag that, when set, prevents any data from being sent to Piwik. The dryRun flag should be set whenever you are testing or debugging an implementation and do not want test data to appear in your Piwik reports. You can set set the dry run flag using the dryRun method:

await FlutterPiwikProSdk.sharedInstance.dryRun(true);

iOS and Android parameters

  • bool shouldDryRun - a boolean value that prevents any data being sent to a tracker when set to true

Installing

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add flutter_tworasky

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  flutter_tworasky: ^0.0.1

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:flutter_tworasky/flutter_tworasky.dart';

example/lib/main.dart

// ignore_for_file: avoid_print

import 'package:flutter/material.dart';
import 'package:flutter_tworasky/model/ecommerce_transaction_item.dart';
import 'package:flutter_tworasky/flutter_tworasky.dart';

void main() {
  final _ecommerceTransactionItems = [
    EcommerceTransactionItem(category: 'cat1', sku: 'sku1', name: 'name1', price: 20, quantity: 1),
    EcommerceTransactionItem(category: 'cat2', sku: 'sku2', name: 'name2', price: 10, quantity: 1),
    EcommerceTransactionItem(category: 'cat3', sku: 'sku3', name: 'name3', price: 30, quantity: 2),
  ];
  //Replace with your Tracking Server's values
  const String _siteId = '';
  const String _baseUrl = '';
  final _flutterPiwik = FlutterPiwikProSdk.sharedInstance;

  runApp(MyApp(
    ecommerceTransactionItems: _ecommerceTransactionItems,
    siteId: _siteId,
    baseUrl: _baseUrl,
    flutterPiwik: _flutterPiwik,
  ));
}

class MyApp extends StatelessWidget {
  const MyApp(
      {required this.ecommerceTransactionItems,
      required this.siteId,
      required this.baseUrl,
      required this.flutterPiwik,
      Key? key})
      : super(key: key);

  final List<EcommerceTransactionItem> ecommerceTransactionItems;
  final String siteId;
  final String baseUrl;
  final FlutterPiwikProSdk flutterPiwik;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Padding(
          padding: const EdgeInsets.only(left: 32.0, right: 32.0, bottom: 32.0),
          child: Center(
            child: SingleChildScrollView(
              child: Column(
                children: [
                  _buildTextWidget('Configure Tracker', () async {
                    try {
                      final result =
                          await flutterPiwik.configureTracker(baseURL: baseUrl, siteId: siteId);
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Set Anonymization State True', () async {
                    final result = await flutterPiwik.setAnonymizationState(true);
                    print(result);
                  }),
                  _buildTextWidget(
                    'Track Screen',
                    () async {
                      try {
                        final result =
                            await flutterPiwik.trackScreen(screenName: "test", title: "test title");
                        print(result);
                      } catch (exception) {
                        print(exception);
                      }
                    },
                  ),
                  _buildTextWidget('Track Custom Event', () async {
                    try {
                      final result = await flutterPiwik.trackCustomEvent(
                          action: 'test action',
                          category: 'test category',
                          name: 'test name',
                          path: 'test path',
                          value: 120);
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Track Exception', () async {
                    try {
                      final result = await flutterPiwik.trackException(
                          description: "description of an exception", isFatal: false);
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Track Download', () async {
                    try {
                      final result =
                          await flutterPiwik.trackDownload('http://your.server.com/bonusmap2.zip');
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Track Ecommerce Transaction', () async {
                    final result = await flutterPiwik.trackEcommerceTransaction(
                      identifier: "testId",
                      grandTotal: 100,
                      subTotal: 10,
                      tax: 5,
                      shippingCost: 100,
                      discount: 6,
                      transactionItems: ecommerceTransactionItems,
                    );
                    print(result);
                  }),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }

  Widget _buildTextWidget(String title, VoidCallback? onPressed) {
    return TextButton(
      onPressed: onPressed,
      child: Container(
        child: Text(
          title,
          style: const TextStyle(color: Colors.white),
        ),
        color: Colors.blue,
      ),
    );
  }
}

Original article source at: https://pub.dev/packages/flutter_tworasky 

#flutter #dart #sdk #wrapper 

What is GEEK

Buddha Community

Flutter_tworasky: Piwik PRO SDK Flutter Wrapper

Google's Flutter 1.20 stable announced with new features - Navoki

Flutter Google cross-platform UI framework has released a new version 1.20 stable.

Flutter is Google’s UI framework to make apps for Android, iOS, Web, Windows, Mac, Linux, and Fuchsia OS. Since the last 2 years, the flutter Framework has already achieved popularity among mobile developers to develop Android and iOS apps. In the last few releases, Flutter also added the support of making web applications and desktop applications.

Last month they introduced the support of the Linux desktop app that can be distributed through Canonical Snap Store(Snapcraft), this enables the developers to publish there Linux desktop app for their users and publish on Snap Store.  If you want to learn how to Publish Flutter Desktop app in Snap Store that here is the tutorial.

Flutter 1.20 Framework is built on Google’s made Dart programming language that is a cross-platform language providing native performance, new UI widgets, and other more features for the developer usage.

Here are the few key points of this release:

Performance improvements for Flutter and Dart

In this release, they have got multiple performance improvements in the Dart language itself. A new improvement is to reduce the app size in the release versions of the app. Another performance improvement is to reduce junk in the display of app animation by using the warm-up phase.

sksl_warm-up

If your app is junk information during the first run then the Skia Shading Language shader provides for pre-compilation as part of your app’s build. This can speed it up by more than 2x.

Added a better support of mouse cursors for web and desktop flutter app,. Now many widgets will show cursor on top of them or you can specify the type of supported cursor you want.

Autofill for mobile text fields

Autofill was already supported in native applications now its been added to the Flutter SDK. Now prefilled information stored by your OS can be used for autofill in the application. This feature will be available soon on the flutter web.

flutter_autofill

A new widget for interaction

InteractiveViewer is a new widget design for common interactions in your app like pan, zoom drag and drop for resizing the widget. Informations on this you can check more on this API documentation where you can try this widget on the DartPad. In this release, drag-drop has more features added like you can know precisely where the drop happened and get the position.

Updated Material Slider, RangeSlider, TimePicker, and DatePicker

In this new release, there are many pre-existing widgets that were updated to match the latest material guidelines, these updates include better interaction with Slider and RangeSliderDatePicker with support for date range and time picker with the new style.

flutter_DatePicker

New pubspec.yaml format

Other than these widget updates there is some update within the project also like in pubspec.yaml file format. If you are a flutter plugin publisher then your old pubspec.yaml  is no longer supported to publish a plugin as the older format does not specify for which platform plugin you are making. All existing plugin will continue to work with flutter apps but you should make a plugin update as soon as possible.

Preview of embedded Dart DevTools in Visual Studio Code

Visual Studio code flutter extension got an update in this release. You get a preview of new features where you can analyze that Dev tools in your coding workspace. Enable this feature in your vs code by _dart.previewEmbeddedDevTools_setting. Dart DevTools menu you can choose your favorite page embed on your code workspace.

Network tracking

The updated the Dev tools comes with the network page that enables network profiling. You can track the timings and other information like status and content type of your** network calls** within your app. You can also monitor gRPC traffic.

Generate type-safe platform channels for platform interop

Pigeon is a command-line tool that will generate types of safe platform channels without adding additional dependencies. With this instead of manually matching method strings on platform channel and serializing arguments, you can invoke native class and pass nonprimitive data objects by directly calling the Dartmethod.

There is still a long list of updates in the new version of Flutter 1.2 that we cannot cover in this blog. You can get more details you can visit the official site to know more. Also, you can subscribe to the Navoki newsletter to get updates on these features and upcoming new updates and lessons. In upcoming new versions, we might see more new features and improvements.

You can get more free Flutter tutorials you can follow these courses:

#dart #developers #flutter #app developed #dart devtools in visual studio code #firebase local emulator suite in flutter #flutter autofill #flutter date picker #flutter desktop linux app build and publish on snapcraft store #flutter pigeon #flutter range slider #flutter slider #flutter time picker #flutter tutorial #flutter widget #google flutter #linux #navoki #pubspec format #setup flutter desktop on windows

Terry  Tremblay

Terry Tremblay

1598396940

What is Flutter and why you should learn it?

Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking** Android and iOS** applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).

flutter-mobile-desktop-web-embedded_min

Flutter was officially released in December 2018. Since then, it has gone a much stronger flutter community.

There has been much increase in flutter developers, flutter packages, youtube tutorials, blogs, flutter examples apps, official and private events, and more. Flutter is now on top software repos based and trending on GitHub.

Flutter meaning?

What is Flutter? this question comes to many new developer’s mind.

humming_bird_dart_flutter

Flutter means flying wings quickly, and lightly but obviously, this doesn’t apply in our SDK.

So Flutter was one of the companies that were acquired by **Google **for around $40 million. That company was based on providing gesture detection and recognition from a standard webcam. But later when the Flutter was going to release in alpha version for developer it’s name was Sky, but since Google already owned Flutter name, so they rename it to Flutter.

Where Flutter is used?

Flutter is used in many startup companies nowadays, and even some MNCs are also adopting Flutter as a mobile development framework. Many top famous companies are using their apps in Flutter. Some of them here are

Dream11

Dream11

NuBank

NuBank

Reflectly app

Reflectly app

Abbey Road Studios

Abbey Road Studios

and many more other apps. Mobile development companies also adopted Flutter as a service for their clients. Even I was one of them who developed flutter apps as a freelancer and later as an IT company for mobile apps.

Flutter as a service

#dart #flutter #uncategorized #flutter framework #flutter jobs #flutter language #flutter meaning #flutter meaning in hindi #google flutter #how does flutter work #what is flutter

Lawson  Wehner

Lawson Wehner

1658892060

Flutter_tworasky: Piwik PRO SDK Flutter Wrapper

Piwik PRO SDK Flutter Wrapper

SDK Configuration

Server

  • You need a Piwik PRO account on the cloud or an on-premises setup which your mobile app will communicate with. For details, please visit the Piwik PRO website.
  • Create a new website (or app) in the Piwik PRO web interface.
  • Copy and note the Website ID from “Administration > Websites & apps > Installation” and your server address.

Client

TODO: Add description once the wrapper library is added to pub dev

Configuration

You'll need to configure the tracker before using any other methods - for that you will need the base URL address of your tracking server and website ID (you can find it in Administration > Websites & apps > Installation on the web interface).

await FlutterPiwikProSdk.sharedInstance.configureTracker(baseURL: '01234567-89ab-cdef-0123-456789abcdef', siteId: 'https://your.piwik.pro.server.com');

iOS and Android parameters:

  • String baseURL - base URL of your tracking server
  • String siteId - ID of your website or application

Usage and general info

Every method from the sdk is async, and every method can throw exceptions - for example if you try to use sdk methods without configuring the tracker first - which you can capture using the standard try-catch approach. For example:

try {
    final result =
    await FlutterPiwikProSdk.sharedInstance.trackDownload('http://your.server.com/bonusmap2.zip');
    print(result);
} catch (exception) {
    //handle an exception
}

If a method call is succesful, most of the methods, unless specified, will return a String that describes which method was called, and which parameters were used, for example:

FlutterPiwikProSdk - configureTracker completed with parameters: baseURL: https://your.piwik.pro.server.com, siteId: 01234567-89ab-cdef-0123-456789abcdef

Using Piwik PRO SDK Flutter Wrapper

Data Anonymization

Anonymization is a feature that allows tracking a user’s activity for aggregated data analysis even if the user doesn’t consent to track the data. If a user does not agree to being tracked, he will not be identified as the same person across multiple sessions.

Personal data will not be tracked during the session (i.e. user ID) If the anonymization is enabled, a new visitor ID will be created each time the application starts.

Anonymization is enabled by default.

You can turn the anonymization on and off by calling setAnonymizationState:

await FlutterPiwikProSdk.sharedInstance.setAnonymizationState(true);
  • bool shouldAnonymize - pass true to enable anonymization, or false to disable it.

Tracking Screen Views

The basic functionality of the SDK is Tracking Screen Views which represent the content the user is viewing in the application. To track a screen you only need to provide the name of the screen. This name is internally translated by the SDK to an HTTP URL as the Piwik PRO server uses URLs for tracking views. Additionally, Piwik PRO SDK uses prefixes which are inserted in generated URLs for various types of action(s).

To track screen views you can use the trackScreen method:

    await FlutterPiwikProSdk.sharedInstance.trackScreen(screenName: "menuScreen");

iOS and Android parameters:

  • String path – title of the action being tracked. The appropriate screen path will be generated for this action.

Additional Android only parameters:

  • String? title (optional) – the title of the action being tracked.

Tracking Custom Events

Custom events can be used to track the user’s interaction with various custom components and features of your application, such as playing a song or a video. You can read more about events in the Piwik PRO documentation and ultimate guide to event tracking.

To track custom events you can use the trackCustomEvent method:

await FlutterPiwikProSdk.sharedInstance.trackCustomEvent(
    action: 'test action',
    category: 'test category',
    name: 'test name',
    value: 120);

iOS and Android parameters:

  • String category – this String defines the event category. You may define event categories based on the class of user actions ( e.g. taps, gestures, voice commands), or you may define them based upon the features available in your application (e.g. play, pause, fast forward, etc.).
  • String action – this String defines the specific event action within the category specified. In the example, we are essentially saying that the category of the event is user clicks, and the action is a button click.
  • String? name (optional) – this String defines a label associated with the event. For example, if you have multiple button controls on a screen, you might use the label to specify the specific identifier of a button that was clicked.
  • double? value (optional) – this Float defines a numerical value associated with the event. For example, if you were tracking “Buy” button clicks, you might log the number of items being purchased, or their total cost.

Additional Android only parameters:

  • String? path (optional) - the path under which this event occurred.

Tracking Exceptions

Tracking exceptions allow the measurement of exceptions and errors in your app. Exceptions are tracked on the server in a similar way as screen views, however, URLs internally generated for exceptions always use the fatal or caught prefix.

To track exceptions you can use the trackException method:

await FlutterPiwikProSdk.sharedInstance.trackException(description: "description of an exception", isFatal: false);

iOS and Android parameters:

  • String description – provides the exception message.
  • bool isFatal – true if an exception is fatal.

Tracking Social Interactions

Social interactions such as likes, shares and comments in various social networks can be tracked as below. This is tracked in a similar way as screen views.

To track social interactions you can use the trackSocialInteraction method:

await FlutterPiwikProSdk.sharedInstance.trackSocialInteraction(
    interaction: 'like',
    network: 'Facebook',
    target: 'Dogs');

iOS and Android parameters

  • String interaction – defines the social interaction, e.g. “Like”.
  • String network – defines the social network associated with interaction, e.g. “Facebook”
  • String? target (optional) – the target for which this interaction occurred, e.g. “Dogs”.

Tracking Downloads

You can track downloads initiated by your application by using the trackDownload method:

await FlutterPiwikProSdk.sharedInstance.trackDownload('http://your.server.com/bonusmap2.zip');

iOS and Android parameters

  • String url - URL of the downloaded content.

Tracking Application Installs

You can also track installations of your application. This event is sent to the server only once per application version (additional events won't be sent).

You can track app installs using the trackAppInstall method:

await FlutterPiwikProSdk.sharedInstance.trackAppInstall();

Tracking Outlinks

For tracking outlinks to external websites or other apps opened from your application you can use the trackOutlink method:

await FlutterPiwikProSdk.sharedInstance.trackOutlink('http://great.website.com');

iOS and Android parameters

  • String url - defines the outlink target. HTTPS, HTTP and FTP are valid.

Tracking Search Operations

Tracking search operations allow the measurement of popular keywords used for various search operations performed inside your application. To track them you can use the trackSearch method:

await FlutterPiwikProSdk.sharedInstance.trackSearch(keyword: 'Space', category: "Movies", numberOfHits: 100);

iOS and Android parameters

  • String keyword – the searched query that was used in the app.
  • String category – specify a search category.
  • int? numberOfHits(optional) – we recommend setting the search count to the number of search results displayed on the results page. When keywords are tracked with a count of 0, they will appear in the “No Result Search Keyword” report.

Tracking Content Impressions

You can track the impression of an ad using the trackContentImpression method:

 await FlutterPiwikProSdk.sharedInstance.trackContentImpression(
    contentName: "name",
    piece: 'piece',
    target: 'target');

iOS and Android parameters

  • String contentName – the name of the content, e.g. “Ad Foo Bar”.
  • String? piece (optional) – the actual content. For instance the path to an image, video, audio, any text.
  • String? target (optional) – the target of the content e.g. the URL of a landing page.

Tracking Content Interactions

When a user interacts with an ad by tapping on it, you can track it using the trackContentInteraction method:

await FlutterPiwikProSdk.sharedInstance.trackContentInteraction(
    contentName: "name",
    piece: 'piece',
    target: 'target',
    contentInteraction: 'Clicked really hard');

iOS and Android parameters

  • String contentName – the name of the content, e.g. “Ad Foo Bar”.
  • String? piece (optional) – the actual content. For instance the path to an image, video, audio, any text.
  • String? target (optional) – the target of the content e.g. the URL of a landing page.
  • String? contentInteraction (optional) - a type of interaction that occured, e.g. "tap"

Tracking Goals

Goal tracking is used to measure and improve your business objectives. To track goals, you first need to configure them on the server in your web panel. Goals such as, for example, subscribing to a newsletter can be tracked as below with the goal ID that you will see on the server after configuring the goal and optional revenue. The currency for the revenue can be set in the Piwik PRO Analytics settings. You can read more about goals here To track goals you can use the trackGoal method:

await FlutterPiwikProSdk.sharedInstance.trackGoal(goal: 10, revenue: 102.2);

iOS and Android parameters

  • int goal – a tracking request will trigger a conversion for the goal of the website being tracked with this ID.
  • double? revenue (optional) – a monetary value that has been generated as revenue by goal conversion.

Tracking Ecommerce Transactions

Ecommerce transactions (in-app purchases) can be tracked to help you improve your business strategy. To track a transaction you must provide two required values - the transaction identifier and grandTotal. Optionally, you can also provide values for subTotal, tax, shippingCost, discount and list of purchased items. To track an ecommerce transaction you can use the trackEcommerceTransaction method:

final ecommerceTransactionItems = [
EcommerceTransactionItem(category: 'cat1', sku: 'sku1', name: 'name1', price: 20, quantity: 1),
EcommerceTransactionItem(category: 'cat2', sku: 'sku2', name: 'name2', price: 10, quantity: 1),
EcommerceTransactionItem(category: 'cat3', sku: 'sku3', name: 'name3', price: 30, quantity: 2),
];
await FlutterPiwikProSdk.sharedInstance.trackEcommerceTransaction(
    identifier: "transactionID",
    grandTotal: 100,
    subTotal: 10,
    tax: 5,
    shippingCost: 100,
    discount: 6,
    transactionItems: ecommerceTransactionItems,
);

iOS and Android parameters

  • String identifier – a unique string identifying the order
  • int grandTotal – The total amount of the order, in cents
  • int? subTotal (optional) – the subtotal (net price) for the order, in cents
  • int? tax (optional) – the tax for the order, in cents
  • int? shippingCost (optional) – the shipping for the order, in cents
  • int? discount (optional) – the discount for the order, in cents
  • List<EcommerceTransactionItem>? transactionItems (optional) – the items included in the order

Tracking Campaigns

Tracking campaign URLs created with the online Campaign URL Builder tool allow you to measure how different campaigns (for example with Facebook ads or direct emails) bring traffic to your application. You can register a custom URL schema in your project settings to launch your application when users tap on the campaign link. You can track these URLs from the application delegate as below. The campaign information will be sent to the server together with the next analytics event. More details about campaigns can be found in the documentation. To track a campaign you can use the trackCampaign method:

await FlutterPiwikProSdk.sharedInstance.trackCampaign("http://example.org/offer.html?pk_campaign=Email-SummerDeals&pk_keyword=LearnMore");

iOS and Android parameters

  • String url - the campaign URL. HTTPS, HTTP and FTP are valid - the URL must contain a campaign name and keyword parameters.

Tracking Custom Variables

The feature will soon be disabled. We recommend using custom dimensions instead.

To track custom name-value pairs assigned to your users or screen views, you can use custom variables. A custom variable can have a visit scope, which means that they are assigned to the whole visit of the user or action scope meaning that they are assigned only to the next tracked action such as screen view. It is required for names and values to be encoded in UTF-8. You can add a custom variable using the trackCustomVariable method:

await FlutterPiwikProSdk.sharedInstance.trackCustomVariable(
    index: 1,
    name: 'filter',
    value: 'lcd',
    scope: CustomVariableScope.visit);

iOS and Android parameters

  • int index – a given custom variable name must always be stored in the same “index” per session. For example, if you choose to store the variable name = “Gender” in index = 1 and you record another custom variable in index = 1, then the “Gender” variable will be deleted and replaced with new custom variable stored in index 1. Please note that some of the indexes are already reserved. See Default custom variables section for details.
  • String name – this String defines the name of a specific Custom Variable such as “User type”. Limited to 200 characters.
  • String value – this String defines the value of a specific Custom Variable such as “Customer”. Limited to 200 characters.
  • CustomVariableScope scope – this String allows the specification of the tracking event type - “visit”, “action”, etc. The scope is the value from the enum CustomVariableScope and can be visit or action.

Tracking Custom Dimensions

You can also use custom dimensions to track custom values. Custom dimensions first have to be defined on the server in your web panel. More details about custom dimensions can be found in the documentation You can add a custom dimension using the trackCustomDimension method:

await FlutterPiwikProSdk.sharedInstance.trackCustomDimension(id: 1, value: 'english');

iOS and Android parameters

  • int index – a given custom dimension must always be stored in the same “index” per session, similar to custom variables. In example 1 is our dimension slot.
  • String value – this String defines the value of a specific custom dimension such as “English”. Limited to 200 characters.

Tracking Profile Attributes

Requires Audience Manager

The Audience Manager stores visitors’ profiles, which have data from a variety of sources. One of them can be a mobile application. It is possible to enrich the profiles with more attributes by passing any key-value pair like gender: male, favourite food: Italian, etc. It is recommended to set additional user identifiers such as email or User ID. This will allow the enrichment of existing profiles or merging profiles rather than creating a new profile. For example, if the user visited the website, browsed or filled in a form with his/her email (his data was tracked and profile created in Audience Manager) and, afterwards started using a mobile application, the existing profile will be enriched only if the email was set. Otherwise, a new profile will be created. To set profile attributes you can use the trackProfileAttribute method:

await FlutterPiwikProSdk.sharedInstance.trackProfileAttribute(name: 'food', value: 'chips');

iOS and Android parameters

  • String name – defines profile attribute name (non-null string).
  • String value – defines profile attribute value (non-null string).

Aside from attributes, each event also sends parameters which are retrieved from the tracker instance:

  • WEBSITE_ID – always sent.
  • USER_ID – if set.
  • EMAIL – if set.
  • VISITOR_ID – always sent, ID of the mobile application user, generated by the SDK.
  • DEVICE_ID – Advertising ID that, by default, is fetched automatically when the tracker instance is created (only on Android).

Reading User Profile Attributes

Requires Audience Manager

It is possible to read the attributes of a given profile, however, with some limitations. Due to of security reasons to avoid personal data leakage, it is possible to read only attributes that were enabled for API access (whitelisted) in the Attributes section of Audience Manager. To get user profile attributes you can use the readUserProfileAttributes method:

await FlutterPiwikProSdk.sharedInstance.readUserProfileAttributes()

Returned Value

  • Future<Map<String, String>> - this method returns a Map of key-value pairs, where each pair represent attribute name (key) and value (instead of a usual String that describes which method was called with which parameters)

Checking Audience Membership

Requires Audience Manager

Checking audience membership allows one to check if the user belongs to a specific group of users defined in the audience manger panel based on analytics data and audience manager profile attributes. You can check if a user belongs to a given audience, for example, to display him/her some type of special offer. You can check audience membership using the checkAudienceMembership method:

await FlutterPiwikProSdk.sharedInstance.checkAudienceMembership('audienceId');

iOS and Android parameters

  • String audienceId – ID of the audience (Audience Manager -> Audiences tab)

Returned Value

  • Future<bool> - this method returns a bool value (true if a user is a member of an audience, false otherwise) instead of a usual String that describes which method was called with which parameters.

Advanced usage

User ID

The user ID is an additional, optional non-empty unique string identifying the user (not set by default). It can be, for example, a unique username or user’s email address. If the provided user ID is sent to the analytics part together with the visitor ID (which is always automatically generated by the SDK), it allows the association of events from various platforms (for example iOS and Android) to the same user provided that the same user ID is used on all platforms. You can read more about User ID here. You can set a user id using the setUserId method:

await FlutterPiwikProSdk.sharedInstance.setUserId('testUserId')

iOS and Android parameters

  • String id – any non-empty unique string identifying the user. Passing null will delete the current user ID

User Email Address

The user email address is an another string used for identifying users - a provided user email is sent to the audience manager part when you send the custom profile attribute configured on the audience manager web panel. Similarly to the user ID, it allows the association of data from various platforms (for example iOS and Android) to the same user as long as the same email is used on all platforms.

It is recommended to set the user email to track audience manager profile attributes as it will create a better user profile.

You can set a user email using the setUserEmail method:

await FlutterPiwikProSdk.sharedInstance.setUserEmail('user@email.com');

iOS and Android parameters

  • String email – a string representing an email address

Visitor ID

SDK uses various IDs for tracking the user. The main one is visitor ID, which is internally randomly generated once by the SDK on the first usage and is then stored locally on the device. The visitor ID will never change unless the user removes the application from the device so that all events sent from his device will always be assigned to the same user in the Piwik PRO web panel. When the anonymization is enabled, a new visitor id is generated each time the application is started. We recommend using userID instead of VisitorID. Still, you can set a visitor ID using the setVisitorId method:

await FlutterPiwikProSdk.sharedInstance.setVisitorId('Id');

iOS and Android parameters

  • String id - a string containing a new Visitor ID

Setting Session Timeout

A session represents a set of user’s interactions with your app. By default, Analytics is closing the session after 30 minutes of inactivity, counting from the last recorded event in session and when the user will open up the app again the new session is started. You can configure the tracker to automatically close the session when users have placed your app in the background for a period of time. You can change the session timeout using the setSessionTimeout method:

await FlutterPiwikProSdk.sharedInstance.setSessionTimeout(1000)

iOS and Android parameters

  • int timeoutInMilliseconds - Session timeout in milliseconds. Default: 1800000 (30 minutes)

Setting Dispatch Interval

All tracking events are saved locally and by default. They are automatically sent to the server every 30 seconds. You can change this interval using the setDispatchInterval method:

await FlutterPiwikProSdk.sharedInstance.setDispatchInterval(10000)

iOS and Android parameters

  • int intervalInMilliseconds - Dispatch interval in milliseconds. Default: 30000

Default Custom Variables

The SDK, by default, automatically adds some information in custom variables about the device (index 1), system version (index 2) and app version (index 3). By default, this option is turned on.

In case you need to configure custom variables separately, turn off this option and see the section above about tracking custom variables.

You can disable this behavior using the setIncludeDefaultVariables method:

await FlutterPiwikProSdk.sharedInstance.setIncludeDefaultVariables(false);

iOS and Android parameters

  • bool shouldInclude - a boolean value that removes Default Variables when false

Opt-Out

You can disable all tracking in the application by using the opt-out feature. No events will be sent to the server if the opt-out is set. By default, opt-out is not set and events are tracked. You can opt out of tracking using the optOut method:

await FlutterPiwikProSdk.sharedInstance.optOut(true);

iOS and Android parameters

  • bool shouldOptOut - a boolean value that disables all tracking in the app when set to true.

Dry Run

The SDK provides a dryRun flag that, when set, prevents any data from being sent to Piwik. The dryRun flag should be set whenever you are testing or debugging an implementation and do not want test data to appear in your Piwik reports. You can set set the dry run flag using the dryRun method:

await FlutterPiwikProSdk.sharedInstance.dryRun(true);

iOS and Android parameters

  • bool shouldDryRun - a boolean value that prevents any data being sent to a tracker when set to true

Installing

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add flutter_tworasky

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  flutter_tworasky: ^0.0.1

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:flutter_tworasky/flutter_tworasky.dart';

example/lib/main.dart

// ignore_for_file: avoid_print

import 'package:flutter/material.dart';
import 'package:flutter_tworasky/model/ecommerce_transaction_item.dart';
import 'package:flutter_tworasky/flutter_tworasky.dart';

void main() {
  final _ecommerceTransactionItems = [
    EcommerceTransactionItem(category: 'cat1', sku: 'sku1', name: 'name1', price: 20, quantity: 1),
    EcommerceTransactionItem(category: 'cat2', sku: 'sku2', name: 'name2', price: 10, quantity: 1),
    EcommerceTransactionItem(category: 'cat3', sku: 'sku3', name: 'name3', price: 30, quantity: 2),
  ];
  //Replace with your Tracking Server's values
  const String _siteId = '';
  const String _baseUrl = '';
  final _flutterPiwik = FlutterPiwikProSdk.sharedInstance;

  runApp(MyApp(
    ecommerceTransactionItems: _ecommerceTransactionItems,
    siteId: _siteId,
    baseUrl: _baseUrl,
    flutterPiwik: _flutterPiwik,
  ));
}

class MyApp extends StatelessWidget {
  const MyApp(
      {required this.ecommerceTransactionItems,
      required this.siteId,
      required this.baseUrl,
      required this.flutterPiwik,
      Key? key})
      : super(key: key);

  final List<EcommerceTransactionItem> ecommerceTransactionItems;
  final String siteId;
  final String baseUrl;
  final FlutterPiwikProSdk flutterPiwik;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Padding(
          padding: const EdgeInsets.only(left: 32.0, right: 32.0, bottom: 32.0),
          child: Center(
            child: SingleChildScrollView(
              child: Column(
                children: [
                  _buildTextWidget('Configure Tracker', () async {
                    try {
                      final result =
                          await flutterPiwik.configureTracker(baseURL: baseUrl, siteId: siteId);
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Set Anonymization State True', () async {
                    final result = await flutterPiwik.setAnonymizationState(true);
                    print(result);
                  }),
                  _buildTextWidget(
                    'Track Screen',
                    () async {
                      try {
                        final result =
                            await flutterPiwik.trackScreen(screenName: "test", title: "test title");
                        print(result);
                      } catch (exception) {
                        print(exception);
                      }
                    },
                  ),
                  _buildTextWidget('Track Custom Event', () async {
                    try {
                      final result = await flutterPiwik.trackCustomEvent(
                          action: 'test action',
                          category: 'test category',
                          name: 'test name',
                          path: 'test path',
                          value: 120);
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Track Exception', () async {
                    try {
                      final result = await flutterPiwik.trackException(
                          description: "description of an exception", isFatal: false);
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Track Download', () async {
                    try {
                      final result =
                          await flutterPiwik.trackDownload('http://your.server.com/bonusmap2.zip');
                      print(result);
                    } catch (exception) {
                      print(exception);
                    }
                  }),
                  _buildTextWidget('Track Ecommerce Transaction', () async {
                    final result = await flutterPiwik.trackEcommerceTransaction(
                      identifier: "testId",
                      grandTotal: 100,
                      subTotal: 10,
                      tax: 5,
                      shippingCost: 100,
                      discount: 6,
                      transactionItems: ecommerceTransactionItems,
                    );
                    print(result);
                  }),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }

  Widget _buildTextWidget(String title, VoidCallback? onPressed) {
    return TextButton(
      onPressed: onPressed,
      child: Container(
        child: Text(
          title,
          style: const TextStyle(color: Colors.white),
        ),
        color: Colors.blue,
      ),
    );
  }
}

Original article source at: https://pub.dev/packages/flutter_tworasky 

#flutter #dart #sdk #wrapper 

Punith Raaj

1644991598

The Ultimate Guide To Tik Tok Clone App With Firebase - Ep 2

The Ultimate Guide To Tik Tok Clone App With Firebase - Ep 2
In this video, I'm going to show you how to make a Cool Tik Tok App a new Instagram using Flutter,firebase and visual studio code.

In this tutorial, you will learn how to Upload a Profile Pic to Firestore Data Storage.

🚀 Nice, clean and modern TikTok Clone #App #UI made in #Flutter⚠️

Starter Project : https://github.com/Punithraaj/Flutter_Tik_Tok_Clone_App/tree/Episode1

► Timestamps 
0:00 Intro 0:20 
Upload Profile Screen 
16:35 Image Picker
20:06 Image Cropper 
24:25 Firestore Data Storage Configuration.

⚠️ IMPORTANT: If you want to learn, I strongly advise you to watch the video at a slow speed and try to follow the code and understand what is done, without having to copy the code, and then download it from GitHub.

► Social Media 
GitHub: https://github.com/Punithraaj/Flutter_Tik_Tok_Clone_App.git
LinkedIn: https://www.linkedin.com/in/roaring-r...
Twitter: https://twitter.com/roaringraaj
Facebook: https://www.facebook.com/flutterdartacademy

► Previous Episode : https://youtu.be/QnL3fr-XpC4
► Playlist: https://youtube.com/playlist?list=PL6vcAuTKAaYe_9KQRsxTsFFSx78g1OluK

I hope you liked it, and don't forget to like,comment, subscribe, share this video with your friends, and star the repository on GitHub!
⭐️ Thanks for watching the video and for more updates don't forget to click on the notification. 
⭐️Please comment your suggestion for my improvement. 
⭐️Remember to like, subscribe, share this video, and star the repo on Github :)

Hope you enjoyed this video!
If you loved it, you can Buy me a coffee : https://www.buymeacoffee.com/roaringraaj

LIKE & SHARE & ACTIVATE THE BELL Thanks For Watching :-)
 
https://youtu.be/F_GgZVD4sDk

#flutter tutorial - tiktok clone with firebase #flutter challenge @tiktokclone #fluttertutorial firebase #flutter firebase #flutter pageview #morioh #flutter

Punith Raaj

1640672627

Flutter Hotel Booking UI - Book your Stay At A New Hotel With Flutter - Ep1

https://youtu.be/-tHUmjIkGJ4
Flutter Hotel Booking UI - Book your Stay At A New Hotel With Flutter - Ep1
#flutter #fluttertravelapp #hotelbookingui #flutter ui design 

In this video, I'm going to show you how to make a Cool Hotel Booking App using Flutter and visual studio code. 

In this tutorial, you will learn how to create a Splash Screen and Introduction Screen, how to implement a SmoothPageIndicator in Flutter. 

🚀 Nice, clean and modern Hotel Booking #App #UI made in #Flutter 

⚠️ IMPORTANT: If you want to learn, I strongly advise you to watch the video at a slow speed and try to follow the code and understand what is done, without having to copy the code, and then download it from GitHub. 

► Social Media 

    GitHub: https://github.com/Punithraaj 

    LinkedIn: https://www.linkedin.com/in/roaring-r...

    Twitter: https://twitter.com/roaringraaj

    Facebook: https://www.facebook.com/flutterdartacademy

I hope you liked it, and don't forget to like,comment, subscribe, share this video with your friends, and star the repository on GitHub! 

⭐️ Thanks for watching the video and for more updates don't forget to click on the notification.⭐️Please comment your suggestion for my improvement. ⭐️Remember to like, subscribe, share this video, and star the repo on Github :)Hope you enjoyed this video! If you loved it, you can Buy me a coffee : https://www.buymeacoffee.com/roaringraaj

#flutter riverpod #flutter travel app #appointment app flutter #morioh