setConfig static method

void setConfig({
  1. Color themeColor = Colors.blue,
  2. String identifier = 'book',
  3. bool nightMode = false,
  4. EpubScrollDirection scrollDirection = EpubScrollDirection.ALLDIRECTIONS,
  5. bool allowSharing = false,
  6. bool enableTts = false,
})

Configure Viewer's with available values

themeColor is the color of the reader scrollDirection uses the EpubScrollDirection enum allowSharing enableTts is an option to enable the inbuilt Text-to-Speech

Implementation

static void setConfig(
    {Color themeColor = Colors.blue,
    String identifier = 'book',
    bool nightMode = false,
    EpubScrollDirection scrollDirection = EpubScrollDirection.ALLDIRECTIONS,
    bool allowSharing = false,
    bool enableTts = false}) async {
  Map<String, dynamic> agrs = {
    "identifier": identifier,
    "themeColor": Util.getHexFromColor(themeColor),
    "scrollDirection": Util.getDirection(scrollDirection),
    "allowSharing": allowSharing,
    'enableTts': enableTts,
    'nightMode': nightMode
  };
  await _channel.invokeMethod('setConfig', agrs);
}