nank1ro / flutter-shadcn-ui

shadcn-ui ported in Flutter. Awesome UI components for Flutter, fully customizable.
https://mariuti.com/shadcn-ui
MIT License
926 stars 56 forks source link

`backgroundColor` is ignored by `ShadInputTheme` #111

Closed joshmossas closed 2 months ago

joshmossas commented 2 months ago

Steps to reproduce

  1. Create a ShadApp with a custom ShadInputTheme that has the background color changed

I've created a minimal reproduction here: https://github.com/joshmossas/shadcn_reproduction

Expected results

The background color of ShadInput should match the backgroundColor set in ShadInputTheme

Actual results

The background color does not change. Additionally there is no parameter on ShadInput to manually change the background color.

Platform

Linux, Android, Web

Code sample

A minimal reproduction can be found here https://github.com/joshmossas/shadcn_reproduction

Screenshots or Video

Screenshots / Video demonstration https://github.com/user-attachments/assets/9c348e3a-0ac8-47ca-9ec1-db29f80f8eb8

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.3, on Pop!_OS 22.04 LTS 6.9.3-76060903-generic, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2024.1) [✓] IntelliJ IDEA Community Edition (version 2024.1) [✓] VS Code (version 1.91.1) [✓] Connected device (3 available) [✓] Network resources • No issues found! ```
joshmossas commented 2 months ago

Okay so I just figured out that I can set the background by overriding the decoration property

ShadThemeData(
  inputTheme: ShadInputTheme(
    decoration: ShadDecoration(
      color: Colors.white,
    ),
  ),
);

So then what is the purpose of the backgroundColor property? Should it just be ignored?

nank1ro commented 2 months ago

The backgroundColor parameter is a typo, I will remove it in the next version. It's correct how you did with the decoration. Thanks for the nice issue ✌️