Skip to main content

Flutter SDK best practice

Mobile application performance is critical to your business. Our technology is focused on improving your customer's experience with your app. As such, screen performance is a core component of our solutions. To boost engagement and conversion rates, we employ several approaches to minimize screen load times.

Initializing with Fonts

note

This functionality is supported from version 4.2.0 of the Rokt Flutter SDK.

Instead of or in addition to supplying your desired fonts on One Platform, you may choose to utilize the fonts already bundled with your application. This carries the advantage of removing the potential for fonts to be downloaded at initialization time, reducing network utilization and the chances of download errors.

You must provide the font postscript names and filepaths if you wish the utilize this functionality. The postscript names should match those being used in your layout, please check with your account manager if you are unsure.

note

Your fonts should be defined in your pubspec.yaml to utilize this functionality. You should pass the same filepath as defined in your pubspec.yaml for each font. See https://docs.flutter.dev/cookbook/design/fonts#declare-the-font-in-the-pubspecyaml-file for more details.

import 'package:rokt_sdk/rokt_sdk.dart';

RoktSdk.initialize('222', appVersion: '1.0.0', fontFilePathMap: {"Arial-Bold": "fonts/Arial-Bold.ttf"});

Using App Configurations

Applications can now send configuration settings from their own application environment. This allows Rokt SDK to use application custom configurations instead of relying solely on system defaults.

// if application supports only Light Mode.
RoktConfig roktConfig =
RoktConfig(colorMode: ColorMode.light);
RoktSdk.execute(
// other params,
roktConfig: roktConfig,
)

ColorMode object

ValueDescription
lightApplication is in Light Mode
darkApplication is in Dark Mode
systemApplication defaults to System Color Mode

For more information see how-to section.

Was this article helpful?