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
Show 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 {
...
@@ -307,7 +307,7 @@ class NavigationDestination extends StatelessWidget {
_StatusTransitionWidgetBuilder
(
_StatusTransitionWidgetBuilder
(
animation:
animation
,
animation:
animation
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
animation
.
isForwardOrCompleted
return
_isForwardOrCompleted
(
animation
)
?
selectedIconWidget
?
selectedIconWidget
:
unselectedIconWidget
;
:
unselectedIconWidget
;
},
},
...
@@ -329,7 +329,7 @@ class NavigationDestination extends StatelessWidget {
...
@@ -329,7 +329,7 @@ class NavigationDestination extends StatelessWidget {
upperLimit:
1
,
upperLimit:
1
,
child:
Text
(
child:
Text
(
label
,
label
,
style:
animation
.
isForwardOrCompleted
style:
_isForwardOrCompleted
(
animation
)
?
effectiveSelectedLabelTextStyle
?
effectiveSelectedLabelTextStyle
:
effectiveUnselectedLabelTextStyle
,
:
effectiveUnselectedLabelTextStyle
,
),
),
...
@@ -566,7 +566,7 @@ class _NavigationIndicator extends StatelessWidget {
...
@@ -566,7 +566,7 @@ class _NavigationIndicator extends StatelessWidget {
animation:
animation
,
animation:
animation
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
_SelectableAnimatedBuilder
(
return
_SelectableAnimatedBuilder
(
isSelected:
animation
.
isForwardOrCompleted
,
isSelected:
_isForwardOrCompleted
(
animation
)
,
duration:
const
Duration
(
milliseconds:
100
),
duration:
const
Duration
(
milliseconds:
100
),
alwaysDoFullAnimation:
true
,
alwaysDoFullAnimation:
true
,
builder:
(
BuildContext
context
,
Animation
<
double
>
fadeAnimation
)
{
builder:
(
BuildContext
context
,
Animation
<
double
>
fadeAnimation
)
{
...
@@ -725,7 +725,7 @@ class _NavigationBarDestinationSemantics extends StatelessWidget {
...
@@ -725,7 +725,7 @@ class _NavigationBarDestinationSemantics extends StatelessWidget {
animation:
destinationInfo
.
selectedAnimation
,
animation:
destinationInfo
.
selectedAnimation
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
Semantics
(
return
Semantics
(
selected:
destinationInfo
.
selectedAnimation
.
isForwardOrCompleted
,
selected:
_isForwardOrCompleted
(
destinationInfo
.
selectedAnimation
)
,
container:
true
,
container:
true
,
child:
child
,
child:
child
,
);
);
...
@@ -1154,9 +1154,9 @@ class _CurvedAnimationBuilderState extends State<_CurvedAnimationBuilder> {
...
@@ -1154,9 +1154,9 @@ class _CurvedAnimationBuilderState extends State<_CurvedAnimationBuilder> {
}
}
}
}
///
Convenience static extensions on Animation.
///
Returns `true` if this animation is ticking forward, or has completed,
extension
_AnimationUtils
on
Animation
<
double
>
{
/// based on [status].
/// Returns `true` if this animation is ticking forward, or has completed,
bool
_isForwardOrCompleted
(
Animation
<
double
>
animation
)
{
/// based on [status].
return
animation
.
status
==
AnimationStatus
.
forward
bool
get
isForwardOrCompleted
=>
status
==
AnimationStatus
.
forward
||
status
==
AnimationStatus
.
completed
;
||
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';
...
@@ -15,10 +15,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'../image_data.dart'
;
import
'../image_data.dart'
;
ByteData
testByteData
(
double
scale
)
=>
ByteData
(
8
)..
setFloat64
(
0
,
scale
);
ByteData
testByteData
(
double
scale
)
=>
ByteData
(
8
)..
setFloat64
(
0
,
scale
);
double
scaleOf
(
ByteData
data
)
=>
data
.
getFloat64
(
0
);
extension
on
ByteData
{
double
get
scale
=>
getFloat64
(
0
);
}
const
String
testManifest
=
'''
const
String
testManifest
=
'''
{
{
...
@@ -89,9 +86,8 @@ class TestAssetImage extends AssetImage {
...
@@ -89,9 +86,8 @@ class TestAssetImage extends AssetImage {
ImageStreamCompleter
load
(
AssetBundleImageKey
key
,
DecoderCallback
decode
)
{
ImageStreamCompleter
load
(
AssetBundleImageKey
key
,
DecoderCallback
decode
)
{
late
ImageInfo
imageInfo
;
late
ImageInfo
imageInfo
;
key
.
bundle
.
load
(
key
.
name
).
then
<
void
>((
ByteData
data
)
{
key
.
bundle
.
load
(
key
.
name
).
then
<
void
>((
ByteData
data
)
{
final
ByteData
testData
=
data
;
final
ui
.
Image
image
=
images
[
scaleOf
(
data
)]!;
final
ui
.
Image
image
=
images
[
testData
.
scale
]!;
assert
(
image
!=
null
,
'Expected
${scaleOf(data)}
to have a key in
$images
'
);
assert
(
image
!=
null
,
'Expected
${testData.scale}
to have a key in
$images
'
);
imageInfo
=
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
imageInfo
=
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
});
});
return
FakeImageStreamCompleter
(
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