flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.08k stars 27.21k forks source link

flutter_markdown blockquoteDecoration does not respect dark theme #82020

Open lff5 opened 3 years ago

lff5 commented 3 years ago

Hello

blockquote background does not respect dark theme. It has hardcoded color: Colors.blue.shade100 see https://github.com/flutter/packages/blob/master/packages/flutter_markdown/lib/src/style_sheet.dart lines 118-121:

      blockquoteDecoration: BoxDecoration(
        color: Colors.blue.shade100,
        borderRadius: BorderRadius.circular(2.0),
      ),

I guess code to reproduce the issue and further comments are not needed because everything is obvious from the code. Even my flutter doctor doesn't matter because the code block above is from current master branch.

darshankawar commented 3 years ago
flutter doctor -v ``` [✓] Flutter (Channel master, 2.3.0-1.0.pre.242, on Mac OS X 10.15.4 19E2269 darwin-x64, locale en-GB) • Flutter version 2.3.0-1.0.pre.242 at /Users/dhs/documents/fluttersdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 3ab799bbc9 (2 hours ago), 2021-05-06 19:49:02 -0700 • Engine revision f57e986aa8 • Dart version 2.14.0 (build 2.14.0-74.0.dev) [!] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 ! CocoaPods 1.9.3 out of date (1.10.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] VS Code (version 1.55.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.21.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93 ! Doctor found issues in 1 category. dhs@Dhss-MacBook-Pro ~ % ```
narumi147 commented 3 years ago

In dark mode, light blue background and white foreground style is somehow hard to read.

antonio-gravity commented 3 years ago

I have similar problem and i want to change the color of the box. That blue in my applications is terrible. Any idea?

deakjahn commented 10 months ago

@antonio-gravity Sure (not that after two years it could be topical but others might still need it, considering that it's still not fixed, even if it's a no-brainer):

  Markdown(
    styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)).copyWith(
      blockquoteDecoration: BoxDecoration(
        color: Theme.of(context).colorScheme.secondaryContainer,
        borderRadius: BorderRadius.circular(2.0),
      ),
    ),

Actually, that's exactly what should be done in the original code...