mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-06 15:21:21 +08:00
JournalList: Swipe actions show a delete icon
Also changed the color to Red to make it very clear that the note is being deleted.
This commit is contained in:
@ -51,7 +51,28 @@ class JournalList extends StatelessWidget {
|
||||
return Dismissible(
|
||||
key: ValueKey("JournalList_" + note.filePath),
|
||||
child: _buildRow(context, note, i),
|
||||
background: Container(color: Theme.of(context).accentColor),
|
||||
background: Container(
|
||||
color: Colors.red[700],
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(16.0, 0.0, 0.0, 0.0),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
secondaryBackground: Container(
|
||||
color: Colors.red[700],
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(0.0, 0.0, 16.0, 0.0),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
onDismissed: (direction) {
|
||||
final stateContainer = StateContainer.of(context);
|
||||
stateContainer.removeNote(note);
|
||||
|
Reference in New Issue
Block a user