updateTheme method

dynamic updateTheme({
  1. required EpubTheme theme,
})

Implementation

updateTheme({required EpubTheme theme}) async {
  String? foregroundColor = theme.foregroundColor?.toHex();
  String customCss = theme.customCss != null
      ? Utils.encodeMap(theme.customCss!)
      : "null";
  await webViewController?.evaluateJavascript(
    source: 'updateTheme("","$foregroundColor", $customCss)',
  );
}