Skip to content

Dark Night Mode Support

Takashi Kawasaki edited this page Dec 12, 2024 · 1 revision

PdfViewer does not have any native dark (or night) mode support but it can be easily implemented using ColorFiltered widget:

ColorFiltered(
  colorFilter: ColorFilter.mode(Colors.white, darkMode ? BlendMode.difference : BlendMode.dst),
  child: PdfViewer.file(filePath, ...),
),

The trick is originally introduced by pckimlong.