Alan Cesar
Alan Cesar

Reputation: 400

Dismissible ListTile text overlay

I would like to have my ListTile content going behind the white background, just like the ListTile.tileColor on swipe.

I don't see this so much as a problem, but I would like to now if there is a way to fix it.

Dismissible ListTile swiping left

My Dismissible widget, with ListTile:


//For testing porpuses, removed some styling.

Dismissible(
  key: UniqueKey(),
  background: Container(
    decoration:
        BoxDecoration(color: cinzaIcone.withOpacity(0.5), borderRadius: BorderRadius.circular(15)),
  ),
  child: ListTile(
    //tileColor: cinza,
    tileColor: Colors.grey,
    dense: true,
    minLeadingWidth: 10,
    shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
    contentPadding: const EdgeInsets.symmetric(horizontal: 10),
    leading: SizedBox(
      width: 1,
      child: Align(
        alignment: Alignment.centerLeft,
        child: Icon(
          Icons.circle,
          color: Colors.orange,
          size: 15,
        ),
      ),
    ),
    title: Text(
      //servico.nome,
      "CONTRAPISO - SOLEIRAS",
      style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: Colors.blue),
    ),
    subtitle: Row(
      children: [
        Text(
          //DateFormat("dd-MM-yyyy").format(servico.dataInicio),
          "12-03-2021",    
          //style: dataServico,
        ),
        Text(
          ' até ',
          //style: dataServico,
        ),
        Text(
          //DateFormat("dd-MM-yyyy").format(servico.dataTermino),
          "17-03-2021",
          //style: dataServico,
        )
      ],
    ),
  ),
)

Upvotes: 2

Views: 776

Answers (1)

Alan Cesar
Alan Cesar

Reputation: 400

After some months, I realized that wrapping Dismissible with ClipRRect widget and passing clipBehavior: Clip.hardEgde solves it.

ClipRRect(
  clipBehavior: Clip.hardEdge,
  child: ...
)

Upvotes: 6

Related Questions