setTrackingProfiles static method
- Map<
TrackingProfile, Config> profiles, { - TrackingProfile? initialProfile,
- List<
TrackingProfileRule> rules = const [], - bool enableAutomation = false,
Registers tracking profiles and optional automation rules.
Implementation
static Future<void> setTrackingProfiles(
Map<TrackingProfile, Config> profiles, {
TrackingProfile? initialProfile,
List<TrackingProfileRule> rules = const [],
bool enableAutomation = false,
}) async {
_profileManager ??= TrackingProfileManager(
applyConfig: LocusConfig.setConfig,
events: LocusStreams.events,
);
_profileManager!
..setProfiles(profiles)
..setRules(rules);
if (initialProfile != null) {
await _profileManager!.setProfile(initialProfile);
}
if (enableAutomation) {
_profileManager!.startAutomation();
} else {
_profileManager!.stopAutomation();
}
}