Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
6e62df42
Commit
6e62df42
authored
Aug 15, 2016
by
Hans Muller
Committed by
GitHub
Aug 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unnecessary Shrine hero logic (#5394)
* Removed unnecessary Shrine hero logic
parent
955b3e21
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
12 deletions
+5
-12
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+1
-7
shrine_order.dart
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
+1
-1
shrine_types.dart
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
+1
-2
heroes.dart
packages/flutter/lib/src/widgets/heroes.dart
+2
-2
No files found.
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
6e62df42
...
...
@@ -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
(
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
View file @
6e62df42
...
...
@@ -40,7 +40,7 @@ class OrderItem extends StatelessWidget {
width:
248.0
,
height:
248.0
,
child:
new
Hero
(
tag:
product
HeroT
ag
,
tag:
product
.
t
ag
,
child:
new
Image
.
asset
(
product
.
imageAsset
,
fit:
ImageFit
.
contain
)
)
)
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
View file @
6e62df42
...
...
@@ -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
()
{
...
...
packages/flutter/lib/src/widgets/heroes.dart
View file @
6e62df42
...
...
@@ -387,7 +387,7 @@ class HeroParty {
assert
(
to
==
null
||
to
.
sourceStates
.
length
==
1
);
assert
(
to
==
null
||
to
.
currentTurns
.
floor
()
==
to
.
currentTurns
);
HeroState
targetState
=
to
!=
null
?
to
.
sourceStates
.
elementAt
(
0
)
:
null
;
Set
<
HeroState
>
sourceStates
=
from
!=
null
?
from
.
sourceStates
:
new
HashSet
<
HeroState
>();
Set
<
HeroState
>
sourceStates
=
from
?.
sourceStates
??
new
HashSet
<
HeroState
>();
sourceStates
.
remove
(
targetState
);
Rect
sourceRect
=
from
?.
currentRect
??
to
.
currentRect
.
center
&
Size
.
zero
;
Rect
targetRect
=
to
?.
currentRect
??
from
.
currentRect
.
center
&
Size
.
zero
;
...
...
@@ -545,7 +545,7 @@ class HeroController extends NavigatorObserver {
void
_updateQuest
(
Duration
timeStamp
)
{
if
(
navigator
==
null
)
{
// The navigator
has been removed for
this end-of-frame callback was called.
// The navigator
was removed before
this end-of-frame callback was called.
return
;
}
Set
<
Key
>
mostValuableKeys
=
_getMostValuableKeys
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment