How do i add shadow or bottom margin in dropdownlist in flutter?

Viewed 511

I want to add shadow or margin to the bottom of text so user can see distinctly different tiles in it. How do i go about that?

1 Answers

You can add the text as a child to a Container and then set it's border according to your need.

DropdownMenuItem(
  child: Container(
    child: Row(
      children: <Widget>[
        Icon(Icons.exit_to_app),
        SizedBox(
          width: 8,
        ),
        Text('Logout'),
      ],
    ),
    decoration: BoxDecoration(
      border: Border(
        bottom: BorderSide(
          color: Colors.black87,
          width: 1.0,
        ),
      ),
    ),
  ),
);

Dartpad link. Output:

Shows a dropdown list item with bottom border

Related