Install
Learn to install Tealium for Flutter.
Tealium for Flutter allows you to use the Tealium native mobile libraries for Android or iOS in your Flutter application.
Requirements
- Flutter application development framework
- IDE such as Android Studio or VS Code
- Flutter plugin installed on the IDE
Sample Apps
To help to familiarize yourself with our library, the tracking methods, and best practice implementation, explore the Tealium for Flutter sample apps.
Install
To install the Tealium library for Flutter:
-
In your Flutter app project, update the
pubspec.yaml
file to add the Tealium Flutter plugin dependency as follows:dependencies: flutter: sdk: flutter tealium: '1.0.0'
-
To pull the Tealium Flutter plugin dependency in your project, run the following command:
flutter pub get
-
Import the Dart code to your project:
import tealium/tealium.dart
Use The Tealium APIs in your Flutter project.
Initialize
Initialize the Tealium instance with the initialize()
method, as shown in the following example:
var teal = Tealium.initialize("ACCOUNT", "PROFILE", "ENVIRONMENT", null, null);
The initializeCustom()
method initialize the Tealium instance with all initialization options, as shown in the following example:
var teal = Tealium.initializeCustom("ACCOUNT", "PROFILE", "ENVIRONMENT", null, null,
"INSTANCE", true, null, null, null, true);
See the Flutter API to learn more about initialization options.
This page was last updated: March 15, 2024