RemoteConfig class abstract

Remote configuration fetched from the server.

Represents the bot configuration as stored on the server, which may have different field names than the local configuration.

Available extensions
Annotations
  • @freezed

Constructors

RemoteConfig({required LocalizedText name, @JsonKey.new(name: 'welcome_message') required LocalizedText welcomeMessage, @JsonKey.new(name: 'system_instruction') required LocalizedText systemInstruction, @JsonKey.new(name: 'default_locale') @Default.new('en') String defaultLocale, @JsonKey.new(name: 'supported_locales') @Default.new(['en']) List<String> supportedLocales, String? fontFamily, String? color, String? avatar, @JsonKey.new(name: 'fab_configuration') FabConfiguration? fabConfiguration})
const
factory
RemoteConfig.fromJson(Map<String, Object?> json)
factory

Properties

avatar String?
Avatar URL or data from server.
no setterinherited
color String?
Primary color setting from server.
no setterinherited
copyWith → $RemoteConfigCopyWith<RemoteConfig>
Create a copy of RemoteConfig with the given fields replaced by the non-null parameter values.
no setterinherited
defaultLocale String
Default locale from server
no setterinherited
fabConfiguration FabConfiguration?
FAB configuration from server.
no setterinherited
fontFamily String?
Font family setting from server.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
name LocalizedText
Bot display name from server (localized).
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedLocales List<String>
Supported locales from server
no setterinherited
systemInstruction LocalizedText
System instructions from server (localized).
no setterinherited
welcomeMessage LocalizedText
Welcome message from server configuration (localized).
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_RemoteConfig value)) → TResult

Available on RemoteConfig, provided by the RemoteConfigPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_RemoteConfig value)?) → TResult?

Available on RemoteConfig, provided by the RemoteConfigPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_RemoteConfig value)?, {required TResult orElse()}) → TResult

Available on RemoteConfig, provided by the RemoteConfigPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(LocalizedText name, LocalizedText welcomeMessage, LocalizedText systemInstruction, String defaultLocale, List<String> supportedLocales, String? fontFamily, String? color, String? avatar, FabConfiguration? fabConfiguration)?, {required TResult orElse()}) → TResult

Available on RemoteConfig, provided by the RemoteConfigPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this RemoteConfig to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(LocalizedText name, LocalizedText welcomeMessage, LocalizedText systemInstruction, String defaultLocale, List<String> supportedLocales, String? fontFamily, String? color, String? avatar, FabConfiguration? fabConfiguration)) → TResult

Available on RemoteConfig, provided by the RemoteConfigPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(LocalizedText name, LocalizedText welcomeMessage, LocalizedText systemInstruction, String defaultLocale, List<String> supportedLocales, String? fontFamily, String? color, String? avatar, FabConfiguration? fabConfiguration)?) → TResult?

Available on RemoteConfig, provided by the RemoteConfigPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited