mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
JournalList: Implement Hero transition
This was especially challenging because of this bug - https://github.com/flutter/flutter/issues/36220 It's why we need the extra flightShuttleBuilder
This commit is contained in:
@ -150,7 +150,7 @@ class NoteViewer extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
);
|
||||
|
||||
return view;
|
||||
return Hero(tag: note.filePath, child: view);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -51,7 +51,16 @@ class JournalList extends StatelessWidget {
|
||||
var note = notes[i];
|
||||
return IconDismissable(
|
||||
key: ValueKey("JournalList_" + note.filePath),
|
||||
child: _buildRow(context, note, i),
|
||||
child: Hero(
|
||||
tag: note.filePath,
|
||||
child: _buildRow(context, note, i),
|
||||
flightShuttleBuilder: (BuildContext flightContext,
|
||||
Animation<double> animation,
|
||||
HeroFlightDirection flightDirection,
|
||||
BuildContext fromHeroContext,
|
||||
BuildContext toHeroContext) =>
|
||||
Material(child: toHeroContext.widget),
|
||||
),
|
||||
backgroundColor: Colors.red[800],
|
||||
iconData: Icons.delete,
|
||||
onDismissed: (direction) {
|
||||
|
Reference in New Issue
Block a user