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
6ec3f3b7
Unverified
Commit
6ec3f3b7
authored
Oct 08, 2021
by
Ian Hickson
Committed by
GitHub
Oct 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extensions (#91453)
parent
61a0add2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
navigation_bar.dart
packages/flutter/lib/src/material/navigation_bar.dart
+9
-9
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+3
-7
No files found.
packages/flutter/lib/src/material/navigation_bar.dart
View file @
6ec3f3b7
...
...
@@ -307,7 +307,7 @@ class NavigationDestination extends StatelessWidget {
_StatusTransitionWidgetBuilder
(
animation:
animation
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
animation
.
isForwardOrCompleted
return
_isForwardOrCompleted
(
animation
)
?
selectedIconWidget
:
unselectedIconWidget
;
},
...
...
@@ -329,7 +329,7 @@ class NavigationDestination extends StatelessWidget {
upperLimit:
1
,
child:
Text
(
label
,
style:
animation
.
isForwardOrCompleted
style:
_isForwardOrCompleted
(
animation
)
?
effectiveSelectedLabelTextStyle
:
effectiveUnselectedLabelTextStyle
,
),
...
...
@@ -566,7 +566,7 @@ class _NavigationIndicator extends StatelessWidget {
animation:
animation
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
_SelectableAnimatedBuilder
(
isSelected:
animation
.
isForwardOrCompleted
,
isSelected:
_isForwardOrCompleted
(
animation
)
,
duration:
const
Duration
(
milliseconds:
100
),
alwaysDoFullAnimation:
true
,
builder:
(
BuildContext
context
,
Animation
<
double
>
fadeAnimation
)
{
...
...
@@ -725,7 +725,7 @@ class _NavigationBarDestinationSemantics extends StatelessWidget {
animation:
destinationInfo
.
selectedAnimation
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
Semantics
(
selected:
destinationInfo
.
selectedAnimation
.
isForwardOrCompleted
,
selected:
_isForwardOrCompleted
(
destinationInfo
.
selectedAnimation
)
,
container:
true
,
child:
child
,
);
...
...
@@ -1154,9 +1154,9 @@ class _CurvedAnimationBuilderState extends State<_CurvedAnimationBuilder> {
}
}
///
Convenience static extensions on Animation.
extension
_AnimationUtils
on
Animation
<
double
>
{
/// Returns `true` if this animation is ticking forward, or has completed,
/// based on [status].
bool
get
isForwardOrCompleted
=>
status
==
AnimationStatus
.
forward
||
status
==
AnimationStatus
.
completed
;
///
Returns `true` if this animation is ticking forward, or has completed,
/// based on [status].
bool
_isForwardOrCompleted
(
Animation
<
double
>
animation
)
{
return
animation
.
status
==
AnimationStatus
.
forward
||
animation
.
status
==
AnimationStatus
.
completed
;
}
packages/flutter/test/widgets/image_resolution_test.dart
View file @
6ec3f3b7
...
...
@@ -15,10 +15,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'../image_data.dart'
;
ByteData
testByteData
(
double
scale
)
=>
ByteData
(
8
)..
setFloat64
(
0
,
scale
);
extension
on
ByteData
{
double
get
scale
=>
getFloat64
(
0
);
}
double
scaleOf
(
ByteData
data
)
=>
data
.
getFloat64
(
0
);
const
String
testManifest
=
'''
{
...
...
@@ -89,9 +86,8 @@ class TestAssetImage extends AssetImage {
ImageStreamCompleter
load
(
AssetBundleImageKey
key
,
DecoderCallback
decode
)
{
late
ImageInfo
imageInfo
;
key
.
bundle
.
load
(
key
.
name
).
then
<
void
>((
ByteData
data
)
{
final
ByteData
testData
=
data
;
final
ui
.
Image
image
=
images
[
testData
.
scale
]!;
assert
(
image
!=
null
,
'Expected
${testData.scale}
to have a key in
$images
'
);
final
ui
.
Image
image
=
images
[
scaleOf
(
data
)]!;
assert
(
image
!=
null
,
'Expected
${scaleOf(data)}
to have a key in
$images
'
);
imageInfo
=
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
});
return
FakeImageStreamCompleter
(
...
...
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