Giter VIP home page Giter VIP logo

Comments (5)

darshankawar avatar darshankawar commented on May 12, 2024 1

@frrahat
I think it is occuring because the app background is white and then you are trying to add variants of white color which won't be noticeable, as white on white will be indistinguishable.
I added backgroundColor to Scaffold which then seems to render the white variant as shown below:

Screenshot 2024-04-23 at 11 42 35 AM
home: Scaffold(
        backgroundColor: Colors.yellow,
        body: Column(
          children: [
            ListTile(

See if above helps in your case or not.

from flutter.

storm265 avatar storm265 commented on May 12, 2024

@frrahat, according to fluter docs : tileColor - defines the background color of ListTile when [selected] is false.
If you want see changes you should set enabled: false. By default enabled is true;
To see changes, add this line for every ListTile widget, and don’t forget hot restart:

          ListTile(
              title: Text('ListTile with white12 background'),
              tileColor: Colors.white12,
              // add this
              enabled: false,
            ),

from flutter.

darshankawar avatar darshankawar commented on May 12, 2024

@frrahat
Check above and see if it helps in your case further or not.

from flutter.

frrahat avatar frrahat commented on May 12, 2024

Hi @storm265 @darshankawar this doesn't solve the issue. I set ListTile.enabled: false for all the ListTile items and just makes the LitTile items looks disabled as per the documentation: https://api.flutter.dev/flutter/material/ListTile/enabled.html

bool enabled
final
Whether this list tile is interactive.

If false, this list tile is styled with the disabled color from the current Theme and the onTap and onLongPress callbacks are inoperative.

Sharing the output in the screenshot below:
image

Did I understand the suggestion correclty?
Also, FYI, I found this issue for variations for Colors.white so far. Other colors like Colors.black* works fine without setting any extra attribute.

Tried with Colors.black* and that works as expected:

Code with Colors.black*
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: Column(
          children: [
            SizedBox(height: 50),
            ListTile(
              textColor: Colors.white,
              title: const Text('ListTile with black87 background'),
              tileColor: Colors.black87,
            ),
            ListTile(
              textColor: Colors.white,
              title: const Text('ListTile with black45 background'),
              tileColor: Colors.black45,
            ),
            ListTile(
              textColor: Colors.white,
              title: const Text('ListTile with black26 background'),
              tileColor: Colors.black26,
            ),
            ListTile(
              textColor: Colors.white,
              title: const Text('ListTile with black background'),
              tileColor: Colors.black,
            ),
          ],
        ),
      ),
    ),
  );
}

Screenshot:
image

from flutter.

frrahat avatar frrahat commented on May 12, 2024

That kind of makes sense. Thank you @darshankawar . We can close the issue.

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.