Removed unnecessary Shrine hero logic (#5394)

* Removed unnecessary Shrine hero logic
This commit is contained in:
Hans Muller
2016-08-15 14:23:53 -07:00
committed by GitHub
parent 955b3e21f7
commit 6e62df42b6
4 changed files with 5 additions and 12 deletions

View File

@@ -3,7 +3,6 @@
// found in the LICENSE file.
import 'dart:async';
import 'dart:collection' show HashSet;
import 'package:flutter/material.dart';
@@ -265,8 +264,7 @@ class ProductItem extends StatelessWidget {
height: 144.0,
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: new Hero(
tag: productHeroTag,
key: new ObjectKey(product),
tag: product.tag,
child: new Image.asset(product.imageAsset, fit: ImageFit.contain)
)
),
@@ -306,12 +304,8 @@ class _ShrineHomeState extends State<ShrineHome> {
void showOrderPage(Product product) {
final Order order = _shoppingCart[product] ?? new Order(product: product);
final Completer<Order> completer = new Completer<Order>();
final Key productKey = new ObjectKey(product);
final Set<Key> mostValuableKeys = new HashSet<Key>();
mostValuableKeys.add(productKey);
Navigator.push(context, new ShrineOrderRoute(
order: order,
settings: new RouteSettings(mostValuableKeys: mostValuableKeys),
completer: completer,
builder: (BuildContext context) {
return new OrderPage(

View File

@@ -40,7 +40,7 @@ class OrderItem extends StatelessWidget {
width: 248.0,
height: 248.0,
child: new Hero(
tag: productHeroTag,
tag: product.tag,
child: new Image.asset(product.imageAsset, fit: ImageFit.contain)
)
)

View File

@@ -4,8 +4,6 @@
import 'dart:ui' show hashValues;
const String productHeroTag = 'Product';
class Vendor {
const Vendor({
this.name,
@@ -48,6 +46,7 @@ class Product {
final double price;
final Vendor vendor;
String get tag => name; // Unique value for Heroes
String get priceString => '\$${price.floor()}';
bool isValid() {