1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter Slidable - How to set height of slidable

Discussão em 'Mobile' iniciado por Stack, Outubro 1, 2024 às 12:13.

  1. Stack

    Stack Membro Participativo

    I am developing Flutter app and I added Slidable, which is working well for me. Only problem I have is with its height. I am unable to set height of Slidable to be same as my card, sending image below. I need that red part to be same height as my white card. I tried to increase size of my Card, but it increase size for Slidable as well.

    Here is my code:

    return Scaffold(
    body: Stack(
    children: [
    Padding(
    padding: const EdgeInsets.symmetric(horizontal: 6.0),
    child: Column(
    children: <Widget>[
    Flexible(
    child: Column(
    children: [
    Expanded(
    child: ListView.builder(
    itemCount: notes.length,
    itemBuilder: (context, index) {
    final note = notes[index];
    return Slidable(
    endActionPane: ActionPane(
    extentRatio: 0.35,
    motion: const ScrollMotion(),
    children: [
    SlidableAction(
    onPressed: (BuildContext context) {
    showDialog(
    context: context,
    builder: (BuildContext context) {
    return DeleteConfirmationDialog(
    noteId: note.id);
    },
    ).then((result) {
    if (result == 'OK') {
    _deleteNote(note.id);
    }
    });
    },
    borderRadius: BorderRadius.circular(12),
    backgroundColor: Colors.red,
    foregroundColor: Colors.white,
    icon: Icons.delete_outline,
    label: 'Vymazať',
    ),
    ],
    ),
    child: HomeCard(
    note: note,
    onTap: () => _navigateAndUpdateNote(note),
    ),
    );
    },
    ),
    ),
    ],
    )),
    ],
    ),
    ),
    ],
    ),
    );


    [​IMG]

    Continue reading...

Compartilhe esta Página