toJson method

Map<String, dynamic> toJson()

Converts the GiphyTheme instance to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'preset': preset?.toString().split('.').last,
    'handleBarColor': handleBarColor?.value,
    'emojiDrawerGradientBottomColor': emojiDrawerGradientBottomColor?.value,
    'emojiDrawerGradientTopColor': emojiDrawerGradientTopColor?.value,
    'emojiDrawerScrollIndicatorStyle': emojiDrawerScrollIndicatorStyle != null
        ? GiphyIndicatorStyleExtension.toStringValue(
            emojiDrawerScrollIndicatorStyle!)
        : null,
    'emojiDrawerSeparatorColor': emojiDrawerSeparatorColor?.value,
    'searchBackButtonColor': searchBackButtonColor?.value,
    'searchBarBackgroundColor': searchBarBackgroundColor?.value,
    'searchBarCornerRadius': searchBarCornerRadius,
    'searchBarPadding': searchBarPadding,
    'searchPlaceholderTextColor': searchPlaceholderTextColor?.value,
    'searchTextColor': searchTextColor?.value,
    'suggestionCellBackgroundColor': suggestionCellBackgroundColor?.value,
    'suggestionCellTextColor': suggestionCellTextColor?.value,
    'tabBarBackgroundAlpha': tabBarBackgroundAlpha,
    'tabBarSwitchDefaultColor': tabBarSwitchDefaultColor?.value,
    'tabBarSwitchSelectedColor': tabBarSwitchSelectedColor?.value,
    'avatarPlaceholderColor': avatarPlaceholderColor?.value,
    'confirmationBackButtonColor': confirmationBackButtonColor?.value,
    'confirmationSelectButtonColor': confirmationSelectButtonColor?.value,
    'confirmationSelectButtonTextColor':
        confirmationSelectButtonTextColor?.value,
    'confirmationViewOnGiphyColor': confirmationViewOnGiphyColor?.value,
    'usernameColor': usernameColor?.value,
    'backgroundColorForLoadingCells': backgroundColorForLoadingCells?.value,
    'cellCornerRadius': cellCornerRadius,
    'fixedSizeCells': fixedSizeCells,
    'stickerBackgroundColor': stickerBackgroundColor?.value,
    'keyboardAppearance': keyboardAppearance != null
        ? GiphyKeyboardAppearanceExtension.toStringValue(keyboardAppearance!)
        : null,
    'backgroundColor': backgroundColor?.value,
    'defaultTextColor': defaultTextColor?.value,
    'dialogOverlayBackgroundColor': dialogOverlayBackgroundColor?.value,
    'retryButtonBackgroundColor': retryButtonBackgroundColor?.value,
    'retryButtonTextColor': retryButtonTextColor?.value,
  };
}