skip to Main Content

I using flutter_native_splash: ^2.4.0, and give proper parameter for light and dark mode backgound color, but its not change

I write this code:

 flutter_native_splash:
   image: assets/uShop_logo.png
   color: "#ffffff"
   color_dark: "#ffffff"
   image_dark: assets/uShop_logo.png
   icon_background_color: "#ffffff"
   android: true
   ios: true
   fullscreen: true
   web: false


   android_12:
     image: assets/uShop_logo.png
     icon_background_color: "#ffffff"
     image_dark: assets/uShop_logo.png
     icon_background_color_dark: "#ffffff"
     color: "#ffffff"
     color_dark: "#ffffff"

2

Answers


  1. You can simply do this as it is mentioned here :

    flutter_native_splash:
      color: "#ffffff"
      image: "assets/logo.png"
      color_dark: "#121212"
      image_dark: "assets/logo.png"
    
    Login or Signup to reply.
  2. Add this code in pubSpace.yaml file

      flutter_native_splash:
      image: assets/uShop_logo.png
      color: "#ffffff"
      color_dark: "#000000"  # Changed to differentiate from light mode
      image_dark: assets/uShop_logo.png
      icon_background_color: "#ffffff"
      android: true
      ios: true
      fullscreen: true
      web: false
    
      android_12:
        image: assets/uShop_logo.png
        icon_background_color: "#ffffff"
        image_dark: assets/uShop_logo.png
        icon_background_color_dark: "#ffffff"
        color: "#ffffff"
        color_dark: "#000000"  # Changed to differentiate from light mode
    

    Make sure you provide distinct colors for color_dark to verify the difference between light and dark modes.

    Then after run this command to apply new change.

    flutter pub run flutter_native_splash:create
    

    Then after Run this command to apply change.

    flutter clean
    flutter pub get
    flutter run
    

    Then after verify your device them set in dark mode.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search