-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
d: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
Steps to Reproduce
When navigating from a list view which displays the below CollectionPhoto to the CollectionDetails screen, the Hero animation is not shown. However, when I press the back button from the CollectionDetails page, the animation shows the image moving back into the list.
class CollectionPhoto extends StatelessWidget {
CollectionPhoto({ Key key, this.imageName, this.collectionId, }) : super(key: key);
final String imageName;
final String collectionId;
@override
Widget build(BuildContext context) {
return new Material(
color: Colors.transparent,
child: new InkWell(
onTap: () {
Application.router.navigateTo(context, '/collections/$collectionId', transition: TransitionType.native);
},
child: new Hero(
tag: '$collectionId-image',
child: new Image.network(URLS.getCollectionImageURL(imageName)),
)
)
);
}
}class CollectionDetails extends StatelessWidget {
CollectionDetails({ Key key, this.id }) : super(key: key);
final String id;
@override
Widget build(BuildContext context) {
return new StreamBuilder(
stream: Firestore.instance.collection('collections')
.document(id)
.snapshots,
builder: (context, snapshot) {
if (!snapshot.hasData) return new Text('Loading...');
return new Scaffold(
appBar: new AppBar(
title: new Text(snapshot.data.data['name']),
),
body: new Hero(
tag: '$id-image',
child: new Image.network(URLS.getCollectionImageURL(snapshot.data.data['imageName'])),
)
);
},
);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
d: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.