Skip to content

Install the Flutter SDK

This guide walks you through installing and configuring the MarkTag Flutter SDK in your project.


Installation

1. Install the package

From your project root, add the SDK using your preferred command:

bash
flutter pub add marktag
bash
dart pub add marktag

You can also add the dependency manually via pub.dev/packages/marktag.

2. Import the SDK

Import the MarkTag SDK in your application code:

dart
import 'package:marktag/marktag.dart';

3. Initialize the SDK

Initialize MarkTag in your main() function before calling runApp(). Ensure Flutter bindings are initialized first:

dart
void main() {
  WidgetsFlutterBinding.ensureInitialized();
  Marktag.instance.init(tag: 'your-domain.com', enableLogging: true);
  runApp(const MyApp());
}
  • Replace 'your-domain.com' with the tag value from your MarkTag project settings.
  • Set enableLogging to false to disable debug logs in production.

INFO

Default events (like on the web) are not supported in the mobile SDK.