mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +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),
|
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];
|
var note = notes[i];
|
||||||
return IconDismissable(
|
return IconDismissable(
|
||||||
key: ValueKey("JournalList_" + note.filePath),
|
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],
|
backgroundColor: Colors.red[800],
|
||||||
iconData: Icons.delete,
|
iconData: Icons.delete,
|
||||||
onDismissed: (direction) {
|
onDismissed: (direction) {
|
||||||
|
Reference in New Issue
Block a user