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
4c1f4d14
Unverified
Commit
4c1f4d14
authored
Mar 06, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Mar 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some formatting issues (#28809)
* fix some formatting issues * address review comments * fix indent
parent
01a29b85
Changes
52
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
278 additions
and
240 deletions
+278
-240
home.dart
examples/flutter_gallery/lib/demo/animation/home.dart
+4
-2
cupertino_navigation_demo.dart
...gallery/lib/demo/cupertino/cupertino_navigation_demo.dart
+1
-1
demos.dart
examples/flutter_gallery/lib/gallery/demos.dart
+7
-3
back_button.dart
examples/flutter_gallery/test_memory/back_button.dart
+5
-5
isolate.dart
examples/layers/services/isolate.dart
+9
-9
nav_bar.dart
packages/flutter/lib/src/cupertino/nav_bar.dart
+1
-1
theme.dart
packages/flutter/lib/src/cupertino/theme.dart
+12
-6
bitfield.dart
packages/flutter/lib/src/foundation/bitfield.dart
+1
-1
diagnostics.dart
packages/flutter/lib/src/foundation/diagnostics.dart
+2
-1
button_theme.dart
packages/flutter/lib/src/material/button_theme.dart
+2
-2
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-1
slider.dart
packages/flutter/lib/src/material/slider.dart
+1
-1
continuous_rectangle_border.dart
...flutter/lib/src/painting/continuous_rectangle_border.dart
+1
-1
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+2
-1
sliver.dart
packages/flutter/lib/src/widgets/sliver.dart
+3
-3
app_test.dart
packages/flutter/test/material/app_test.dart
+1
-1
dialog_theme_test.dart
packages/flutter/test/material/dialog_theme_test.dart
+1
-1
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+1
-1
slider_test.dart
packages/flutter/test/material/slider_test.dart
+1
-1
slider_theme_test.dart
packages/flutter/test/material/slider_theme_test.dart
+1
-1
switch_list_tile_test.dart
packages/flutter/test/material/switch_list_tile_test.dart
+1
-1
theme_test.dart
packages/flutter/test/material/theme_test.dart
+40
-20
box_fit_test.dart
packages/flutter/test/painting/box_fit_test.dart
+25
-25
image_stream_test.dart
packages/flutter/test/painting/image_stream_test.dart
+1
-1
cached_intrinsics_test.dart
packages/flutter/test/rendering/cached_intrinsics_test.dart
+8
-4
dynamic_intrinsics_test.dart
packages/flutter/test/rendering/dynamic_intrinsics_test.dart
+8
-4
keyboard_key_test.dart
packages/flutter/test/services/keyboard_key_test.dart
+1
-1
media_query_test.dart
packages/flutter/test/widgets/media_query_test.dart
+74
-74
modal_barrier_test.dart
packages/flutter/test/widgets/modal_barrier_test.dart
+12
-12
sliver_constraints_test.dart
packages/flutter/test/widgets/sliver_constraints_test.dart
+1
-1
slivers_appbar_pinned_test.dart
...ages/flutter/test/widgets/slivers_appbar_pinned_test.dart
+1
-1
translations_test.dart
packages/flutter_localizations/test/translations_test.dart
+1
-1
accessibility.dart
packages/flutter_test/lib/src/accessibility.dart
+3
-3
binding.dart
packages/flutter_test/lib/src/binding.dart
+1
-1
matchers.dart
packages/flutter_test/lib/src/matchers.dart
+9
-9
window.dart
packages/flutter_test/lib/src/window.dart
+1
-1
accessibility_test.dart
packages/flutter_test/test/accessibility_test.dart
+1
-1
window_test.dart
packages/flutter_test/test/window_test.dart
+1
-1
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-1
build_script_generator.dart
...er_tools/lib/src/build_runner/build_script_generator.dart
+1
-1
generate.dart
packages/flutter_tools/lib/src/commands/generate.dart
+1
-1
convert.dart
packages/flutter_tools/lib/src/convert.dart
+1
-1
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+4
-8
flutter_manifest.dart
packages/flutter_tools/lib/src/flutter_manifest.dart
+1
-1
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+2
-1
application_package.dart
...ages/flutter_tools/lib/src/macos/application_package.dart
+8
-8
project.dart
packages/flutter_tools/lib/src/project.dart
+1
-1
build_runner_test.dart
...es/flutter_tools/test/build_runner/build_runner_test.dart
+1
-1
cache_test.dart
packages/flutter_tools/test/cache_test.dart
+1
-1
doctor_test.dart
packages/flutter_tools/test/commands/doctor_test.dart
+1
-1
expression_evaluation_test.dart
...er_tools/test/integration/expression_evaluation_test.dart
+8
-9
compile_test.dart
packages/flutter_tools/test/web/compile_test.dart
+1
-1
No files found.
examples/flutter_gallery/lib/demo/animation/home.dart
View file @
4c1f4d14
...
...
@@ -119,8 +119,10 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
final
double
maxHeight
;
final
Widget
child
;
@override
double
get
minExtent
=>
minHeight
;
@override
double
get
maxExtent
=>
math
.
max
(
maxHeight
,
minHeight
);
@override
double
get
minExtent
=>
minHeight
;
@override
double
get
maxExtent
=>
math
.
max
(
maxHeight
,
minHeight
);
@override
Widget
build
(
BuildContext
context
,
double
shrinkOffset
,
bool
overlapsContent
)
{
...
...
examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart
View file @
4c1f4d14
...
...
@@ -669,7 +669,7 @@ class Tab2ConversationRow extends StatelessWidget {
}
List
<
Widget
>
buildTab2Conversation
()
{
return
<
Widget
>[
return
<
Widget
>[
const
Tab2ConversationRow
(
text:
"My Xanadu doesn't look right"
,
),
...
...
examples/flutter_gallery/lib/gallery/demos.dart
View file @
4c1f4d14
...
...
@@ -8,9 +8,13 @@ import '../demo/all.dart';
import
'icons.dart'
;
class
GalleryDemoCategory
{
const
GalleryDemoCategory
.
_
({
this
.
name
,
this
.
icon
});
@required
final
String
name
;
@required
final
IconData
icon
;
const
GalleryDemoCategory
.
_
({
@required
this
.
name
,
@required
this
.
icon
,
});
final
String
name
;
final
IconData
icon
;
@override
bool
operator
==(
dynamic
other
)
{
...
...
examples/flutter_gallery/test_memory/back_button.dart
View file @
4c1f4d14
...
...
@@ -20,11 +20,11 @@ Future<void> endOfAnimation() async {
int
iteration
=
0
;
class
LifecycleObserver
extends
WidgetsBindingObserver
{
@override
void
didChangeAppLifecycleState
(
AppLifecycleState
state
)
{
debugPrint
(
'==== MEMORY BENCHMARK ====
$state
===='
);
debugPrint
(
'This was lifecycle event number
$iteration
in this instance'
);
}
@override
void
didChangeAppLifecycleState
(
AppLifecycleState
state
)
{
debugPrint
(
'==== MEMORY BENCHMARK ====
$state
===='
);
debugPrint
(
'This was lifecycle event number
$iteration
in this instance'
);
}
}
Future
<
void
>
main
()
async
{
...
...
examples/layers/services/isolate.dart
View file @
4c1f4d14
...
...
@@ -281,15 +281,15 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
}
String
_getStatus
(
CalculationState
state
)
{
switch
(
state
)
{
case
CalculationState
.
loading
:
return
'Loading...'
;
case
CalculationState
.
calculating
:
return
'In Progress'
;
case
CalculationState
.
idle
:
default
:
return
'Idle'
;
}
switch
(
state
)
{
case
CalculationState
.
loading
:
return
'Loading...'
;
case
CalculationState
.
calculating
:
return
'In Progress'
;
case
CalculationState
.
idle
:
default
:
return
'Idle'
;
}
}
void
_updateState
(
String
result
,
double
progress
)
{
...
...
packages/flutter/lib/src/cupertino/nav_bar.dart
View file @
4c1f4d14
...
...
@@ -809,7 +809,7 @@ class _LargeTitleNavigationBarSliverDelegate
@override
bool
shouldRebuild
(
_LargeTitleNavigationBarSliverDelegate
oldDelegate
)
{
return
components
!=
oldDelegate
.
components
return
components
!=
oldDelegate
.
components
||
userMiddle
!=
oldDelegate
.
userMiddle
||
backgroundColor
!=
oldDelegate
.
backgroundColor
||
border
!=
oldDelegate
.
border
...
...
packages/flutter/lib/src/cupertino/theme.dart
View file @
4c1f4d14
...
...
@@ -254,10 +254,16 @@ class _NoDefaultCupertinoThemeData extends CupertinoThemeData {
scaffoldBackgroundColor
,
);
@override
final
Brightness
brightness
;
@override
final
Color
primaryColor
;
@override
final
Color
primaryContrastingColor
;
@override
final
CupertinoTextThemeData
textTheme
;
@override
final
Color
barBackgroundColor
;
@override
final
Color
scaffoldBackgroundColor
;
@override
final
Brightness
brightness
;
@override
final
Color
primaryColor
;
@override
final
Color
primaryContrastingColor
;
@override
final
CupertinoTextThemeData
textTheme
;
@override
final
Color
barBackgroundColor
;
@override
final
Color
scaffoldBackgroundColor
;
}
packages/flutter/lib/src/foundation/bitfield.dart
View file @
4c1f4d14
...
...
@@ -64,4 +64,4 @@ class BitField<T extends dynamic> {
void
reset
([
bool
value
=
false
])
{
_bits
=
value
?
_allOnes
:
_allZeros
;
}
}
\ No newline at end of file
}
packages/flutter/lib/src/foundation/diagnostics.dart
View file @
4c1f4d14
...
...
@@ -1984,7 +1984,8 @@ class DiagnosticableNode<T extends Diagnosticable> extends DiagnosticsNode {
return
_cachedBuilder
;
}
@override
DiagnosticsTreeStyle
get
style
{
@override
DiagnosticsTreeStyle
get
style
{
return
super
.
style
??
_builder
.
defaultDiagnosticsTreeStyle
;
}
...
...
packages/flutter/lib/src/material/button_theme.dart
View file @
4c1f4d14
...
...
@@ -291,12 +291,12 @@ class ButtonThemeData extends Diagnosticable {
EdgeInsetsGeometry
get
padding
{
if
(
_padding
!=
null
)
return
_padding
;
switch
(
textTheme
)
{
switch
(
textTheme
)
{
case
ButtonTextTheme
.
normal
:
case
ButtonTextTheme
.
accent
:
return
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
);
case
ButtonTextTheme
.
primary
:
return
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
);
return
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
);
}
assert
(
false
);
return
EdgeInsets
.
zero
;
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
4c1f4d14
...
...
@@ -350,7 +350,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> {
}
class
_DropdownRoutePage
<
T
>
extends
StatelessWidget
{
const
_DropdownRoutePage
({
const
_DropdownRoutePage
({
Key
key
,
this
.
route
,
this
.
constraints
,
...
...
packages/flutter/lib/src/material/slider.dart
View file @
4c1f4d14
...
...
@@ -1094,4 +1094,4 @@ class _RenderSlider extends RenderBox {
onChanged
((
value
-
_semanticActionUnit
).
clamp
(
0.0
,
1.0
));
}
}
}
\ No newline at end of file
}
packages/flutter/lib/src/painting/continuous_rectangle_border.dart
View file @
4c1f4d14
...
...
@@ -163,4 +163,4 @@ class ContinuousRectangleBorder extends ShapeBorder {
String
toString
()
{
return
'
$runtimeType
(
$side
,
$borderRadius
)'
;
}
}
\ No newline at end of file
}
packages/flutter/lib/src/widgets/framework.dart
View file @
4c1f4d14
...
...
@@ -3416,7 +3416,8 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
}
/// A short, textual description of this element.
@override
String
toStringShort
()
{
@override
String
toStringShort
()
{
return
widget
!=
null
?
'
${widget.toStringShort()}
'
:
'[
$runtimeType
]'
;
}
...
...
packages/flutter/lib/src/widgets/sliver.dart
View file @
4c1f4d14
...
...
@@ -1172,9 +1172,9 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
@override
void
visitChildren
(
ElementVisitor
visitor
)
{
// The toList() is to make a copy so that the underlying list can be modified by
// the visitor:
assert
(!
_childElements
.
values
.
any
((
Element
child
)
=>
child
==
null
));
// The toList() is to make a copy so that the underlying list can be modified by
// the visitor:
assert
(!
_childElements
.
values
.
any
((
Element
child
)
=>
child
==
null
));
_childElements
.
values
.
toList
().
forEach
(
visitor
);
}
...
...
packages/flutter/test/material/app_test.dart
View file @
4c1f4d14
...
...
@@ -285,7 +285,7 @@ void main() {
expect
(
await
result
,
equals
(
'all done'
));
});
testWidgets
(
'Two-step initial route'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Two-step initial route'
,
(
WidgetTester
tester
)
async
{
final
Map
<
String
,
WidgetBuilder
>
routes
=
<
String
,
WidgetBuilder
>{
'/'
:
(
BuildContext
context
)
=>
const
Text
(
'route "/"'
),
'/a'
:
(
BuildContext
context
)
=>
const
Text
(
'route "/a"'
),
...
...
packages/flutter/test/material/dialog_theme_test.dart
View file @
4c1f4d14
...
...
@@ -238,4 +238,4 @@ void main() {
final
RenderParagraph
content
=
_getTextRenderObjectFromDialog
(
tester
,
contentText
);
expect
(
content
.
text
.
style
.
color
,
contentTextStyle
.
color
);
});
}
\ No newline at end of file
}
packages/flutter/test/material/input_decorator_test.dart
View file @
4c1f4d14
...
...
@@ -1114,7 +1114,7 @@ void main() {
expect
(
tester
.
getRect
(
find
.
text
(
'test'
)).
left
,
12.0
);
});
testWidgets
(
'counter text has correct right margin - LTR, dense'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'counter text has correct right margin - LTR, dense'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
buildInputDecorator
(
// isEmpty: false (default)
...
...
packages/flutter/test/material/slider_test.dart
View file @
4c1f4d14
...
...
@@ -1422,4 +1422,4 @@ void main() {
expect
(
await
tester
.
pumpAndSettle
(
const
Duration
(
milliseconds:
100
)),
equals
(
1
));
await
gesture
.
up
();
});
}
\ No newline at end of file
}
packages/flutter/test/material/slider_theme_test.dart
View file @
4c1f4d14
...
...
@@ -760,4 +760,4 @@ Widget _buildApp(
),
),
);
}
\ No newline at end of file
}
packages/flutter/test/material/switch_list_tile_test.dart
View file @
4c1f4d14
...
...
@@ -63,7 +63,7 @@ void main() {
testWidgets
(
'SwitchListTile.adaptive delegates to'
,
(
WidgetTester
tester
)
async
{
bool
value
=
false
;
Widget
buildFrame
(
TargetPlatform
platform
)
{
Widget
buildFrame
(
TargetPlatform
platform
)
{
return
MaterialApp
(
theme:
ThemeData
(
platform:
platform
),
home:
StatefulBuilder
(
...
...
packages/flutter/test/material/theme_test.dart
View file @
4c1f4d14
...
...
@@ -665,26 +665,46 @@ class _TextStyleProxy implements TextStyle {
final
TextStyle
_delegate
;
// Do make sure that all the properties correctly forward to the _delegate.
@override
Color
get
color
=>
_delegate
.
color
;
@override
Color
get
backgroundColor
=>
_delegate
.
backgroundColor
;
@override
String
get
debugLabel
=>
_delegate
.
debugLabel
;
@override
TextDecoration
get
decoration
=>
_delegate
.
decoration
;
@override
Color
get
decorationColor
=>
_delegate
.
decorationColor
;
@override
TextDecorationStyle
get
decorationStyle
=>
_delegate
.
decorationStyle
;
@override
String
get
fontFamily
=>
_delegate
.
fontFamily
;
@override
List
<
String
>
get
fontFamilyFallback
=>
_delegate
.
fontFamilyFallback
;
@override
double
get
fontSize
=>
_delegate
.
fontSize
;
@override
FontStyle
get
fontStyle
=>
_delegate
.
fontStyle
;
@override
FontWeight
get
fontWeight
=>
_delegate
.
fontWeight
;
@override
double
get
height
=>
_delegate
.
height
;
@override
Locale
get
locale
=>
_delegate
.
locale
;
@override
ui
.
Paint
get
foreground
=>
_delegate
.
foreground
;
@override
ui
.
Paint
get
background
=>
_delegate
.
background
;
@override
bool
get
inherit
=>
_delegate
.
inherit
;
@override
double
get
letterSpacing
=>
_delegate
.
letterSpacing
;
@override
TextBaseline
get
textBaseline
=>
_delegate
.
textBaseline
;
@override
double
get
wordSpacing
=>
_delegate
.
wordSpacing
;
@override
List
<
Shadow
>
get
shadows
=>
_delegate
.
shadows
;
@override
Color
get
color
=>
_delegate
.
color
;
@override
Color
get
backgroundColor
=>
_delegate
.
backgroundColor
;
@override
String
get
debugLabel
=>
_delegate
.
debugLabel
;
@override
TextDecoration
get
decoration
=>
_delegate
.
decoration
;
@override
Color
get
decorationColor
=>
_delegate
.
decorationColor
;
@override
TextDecorationStyle
get
decorationStyle
=>
_delegate
.
decorationStyle
;
@override
String
get
fontFamily
=>
_delegate
.
fontFamily
;
@override
List
<
String
>
get
fontFamilyFallback
=>
_delegate
.
fontFamilyFallback
;
@override
double
get
fontSize
=>
_delegate
.
fontSize
;
@override
FontStyle
get
fontStyle
=>
_delegate
.
fontStyle
;
@override
FontWeight
get
fontWeight
=>
_delegate
.
fontWeight
;
@override
double
get
height
=>
_delegate
.
height
;
@override
Locale
get
locale
=>
_delegate
.
locale
;
@override
ui
.
Paint
get
foreground
=>
_delegate
.
foreground
;
@override
ui
.
Paint
get
background
=>
_delegate
.
background
;
@override
bool
get
inherit
=>
_delegate
.
inherit
;
@override
double
get
letterSpacing
=>
_delegate
.
letterSpacing
;
@override
TextBaseline
get
textBaseline
=>
_delegate
.
textBaseline
;
@override
double
get
wordSpacing
=>
_delegate
.
wordSpacing
;
@override
List
<
Shadow
>
get
shadows
=>
_delegate
.
shadows
;
@override
String
toString
({
DiagnosticLevel
minLevel
=
DiagnosticLevel
.
debug
})
=>
...
...
packages/flutter/test/painting/box_fit_test.dart
View file @
4c1f4d14
...
...
@@ -37,37 +37,37 @@ void main() {
}
void
_testZeroAndNegativeSizes
(
BoxFit
fit
)
{
FittedSizes
result
;
FittedSizes
result
;
result
=
applyBoxFit
(
fit
,
const
Size
(-
400.0
,
2000.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(-
400.0
,
2000.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
-
2000.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
-
2000.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(-
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(-
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(
100.0
,
-
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(
100.0
,
-
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
0.0
,
2000.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
0.0
,
2000.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
0.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
0.0
),
const
Size
(
100.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(
0.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(
0.0
,
1000.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(
100.0
,
0.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
result
=
applyBoxFit
(
fit
,
const
Size
(
400.0
,
2000.0
),
const
Size
(
100.0
,
0.0
));
expect
(
result
.
source
,
equals
(
Size
.
zero
));
expect
(
result
.
destination
,
equals
(
Size
.
zero
));
}
packages/flutter/test/painting/image_stream_test.dart
View file @
4c1f4d14
...
...
@@ -103,7 +103,7 @@ void main() {
expect
(
mockCodec
.
numFramesAsked
,
1
);
});
testWidgets
(
'getNextFrame future fails'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'getNextFrame future fails'
,
(
WidgetTester
tester
)
async
{
final
MockCodec
mockCodec
=
MockCodec
();
mockCodec
.
frameCount
=
1
;
final
Completer
<
Codec
>
codecCompleter
=
Completer
<
Codec
>();
...
...
packages/flutter/test/rendering/cached_intrinsics_test.dart
View file @
4c1f4d14
...
...
@@ -8,10 +8,14 @@ import '../flutter_test_alternative.dart';
class
RenderTestBox
extends
RenderBox
{
double
value
=
0.0
;
double
next
()
{
value
+=
1.0
;
return
value
;
}
@override
double
computeMinIntrinsicWidth
(
double
height
)
=>
next
();
@override
double
computeMaxIntrinsicWidth
(
double
height
)
=>
next
();
@override
double
computeMinIntrinsicHeight
(
double
width
)
=>
next
();
@override
double
computeMaxIntrinsicHeight
(
double
width
)
=>
next
();
@override
double
computeMinIntrinsicWidth
(
double
height
)
=>
next
();
@override
double
computeMaxIntrinsicWidth
(
double
height
)
=>
next
();
@override
double
computeMinIntrinsicHeight
(
double
width
)
=>
next
();
@override
double
computeMaxIntrinsicHeight
(
double
width
)
=>
next
();
}
void
main
(
)
{
...
...
packages/flutter/test/rendering/dynamic_intrinsics_test.dart
View file @
4c1f4d14
...
...
@@ -15,10 +15,14 @@ class RenderFixedSize extends RenderBox {
markNeedsLayout
();
}
@override
double
computeMinIntrinsicWidth
(
double
height
)
=>
dimension
;
@override
double
computeMaxIntrinsicWidth
(
double
height
)
=>
dimension
;
@override
double
computeMinIntrinsicHeight
(
double
width
)
=>
dimension
;
@override
double
computeMaxIntrinsicHeight
(
double
width
)
=>
dimension
;
@override
double
computeMinIntrinsicWidth
(
double
height
)
=>
dimension
;
@override
double
computeMaxIntrinsicWidth
(
double
height
)
=>
dimension
;
@override
double
computeMinIntrinsicHeight
(
double
width
)
=>
dimension
;
@override
double
computeMaxIntrinsicHeight
(
double
width
)
=>
dimension
;
@override
void
performLayout
()
{
...
...
packages/flutter/test/services/keyboard_key_test.dart
View file @
4c1f4d14
...
...
@@ -51,4 +51,4 @@ void main() {
expect
(
key1
,
equals
(
key2
));
});
});
}
\ No newline at end of file
}
packages/flutter/test/widgets/media_query_test.dart
View file @
4c1f4d14
...
...
@@ -93,58 +93,58 @@ void main() {
expect
(
copied
.
platformBrightness
,
Brightness
.
dark
);
});
testWidgets
(
'MediaQuery.removePadding removes specified padding'
,
(
WidgetTester
tester
)
async
{
const
Size
size
=
Size
(
2.0
,
4.0
);
const
double
devicePixelRatio
=
2.0
;
const
double
textScaleFactor
=
1.2
;
const
EdgeInsets
padding
=
EdgeInsets
.
only
(
top:
1.0
,
right:
2.0
,
left:
3.0
,
bottom:
4.0
);
const
EdgeInsets
viewInsets
=
EdgeInsets
.
only
(
top:
5.0
,
right:
6.0
,
left:
7.0
,
bottom:
8.0
);
testWidgets
(
'MediaQuery.removePadding removes specified padding'
,
(
WidgetTester
tester
)
async
{
const
Size
size
=
Size
(
2.0
,
4.0
);
const
double
devicePixelRatio
=
2.0
;
const
double
textScaleFactor
=
1.2
;
const
EdgeInsets
padding
=
EdgeInsets
.
only
(
top:
1.0
,
right:
2.0
,
left:
3.0
,
bottom:
4.0
);
const
EdgeInsets
viewInsets
=
EdgeInsets
.
only
(
top:
5.0
,
right:
6.0
,
left:
7.0
,
bottom:
8.0
);
MediaQueryData
unpadded
;
await
tester
.
pumpWidget
(
MediaQuery
(
data:
const
MediaQueryData
(
size:
size
,
devicePixelRatio:
devicePixelRatio
,
textScaleFactor:
textScaleFactor
,
padding:
padding
,
viewInsets:
viewInsets
,
alwaysUse24HourFormat:
true
,
accessibleNavigation:
true
,
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
MediaQuery
.
removePadding
(
context:
context
,
removeLeft:
true
,
removeTop:
true
,
removeRight:
true
,
removeBottom:
true
,
child:
Builder
(
builder:
(
BuildContext
context
)
{
unpadded
=
MediaQuery
.
of
(
context
);
return
Container
();
}
),
);
},
),
)
);
MediaQueryData
unpadded
;
await
tester
.
pumpWidget
(
MediaQuery
(
data:
const
MediaQueryData
(
size:
size
,
devicePixelRatio:
devicePixelRatio
,
textScaleFactor:
textScaleFactor
,
padding:
padding
,
viewInsets:
viewInsets
,
alwaysUse24HourFormat:
true
,
accessibleNavigation:
true
,
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
MediaQuery
.
removePadding
(
context:
context
,
removeLeft:
true
,
removeTop:
true
,
removeRight:
true
,
removeBottom:
true
,
child:
Builder
(
builder:
(
BuildContext
context
)
{
unpadded
=
MediaQuery
.
of
(
context
);
return
Container
();
}
),
);
},
),
)
);
expect
(
unpadded
.
size
,
size
);
expect
(
unpadded
.
devicePixelRatio
,
devicePixelRatio
);
expect
(
unpadded
.
textScaleFactor
,
textScaleFactor
);
expect
(
unpadded
.
padding
,
EdgeInsets
.
zero
);
expect
(
unpadded
.
viewInsets
,
viewInsets
);
expect
(
unpadded
.
alwaysUse24HourFormat
,
true
);
expect
(
unpadded
.
accessibleNavigation
,
true
);
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
size
,
size
);
expect
(
unpadded
.
devicePixelRatio
,
devicePixelRatio
);
expect
(
unpadded
.
textScaleFactor
,
textScaleFactor
);
expect
(
unpadded
.
padding
,
EdgeInsets
.
zero
);
expect
(
unpadded
.
viewInsets
,
viewInsets
);
expect
(
unpadded
.
alwaysUse24HourFormat
,
true
);
expect
(
unpadded
.
accessibleNavigation
,
true
);
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
});
testWidgets
(
'MediaQuery.removeViewInsets removes specified viewInsets'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -201,32 +201,32 @@ void main() {
expect
(
unpadded
.
boldText
,
true
);
});
testWidgets
(
'MediaQuery.textScaleFactorOf'
,
(
WidgetTester
tester
)
async
{
double
outsideTextScaleFactor
;
double
insideTextScaleFactor
;
testWidgets
(
'MediaQuery.textScaleFactorOf'
,
(
WidgetTester
tester
)
async
{
double
outsideTextScaleFactor
;
double
insideTextScaleFactor
;
await
tester
.
pumpWidget
(
Builder
(
builder:
(
BuildContext
context
)
{
outsideTextScaleFactor
=
MediaQuery
.
textScaleFactorOf
(
context
);
return
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
4.0
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
insideTextScaleFactor
=
MediaQuery
.
textScaleFactorOf
(
context
);
return
Container
();
},
),
);
},
),
);
await
tester
.
pumpWidget
(
Builder
(
builder:
(
BuildContext
context
)
{
outsideTextScaleFactor
=
MediaQuery
.
textScaleFactorOf
(
context
);
return
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
4.0
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
insideTextScaleFactor
=
MediaQuery
.
textScaleFactorOf
(
context
);
return
Container
();
},
),
);
},
),
);
expect
(
outsideTextScaleFactor
,
1.0
);
expect
(
insideTextScaleFactor
,
4.0
);
});
expect
(
outsideTextScaleFactor
,
1.0
);
expect
(
insideTextScaleFactor
,
4.0
);
});
testWidgets
(
'MediaQuery.platformBrightnessOf'
,
(
WidgetTester
tester
)
async
{
Brightness
outsideBrightness
;
...
...
packages/flutter/test/widgets/modal_barrier_test.dart
View file @
4c1f4d14
...
...
@@ -217,23 +217,23 @@ void main() {
class
FirstWidget
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
()
{
Navigator
.
pushNamed
(
context
,
'/modal'
);
},
child:
Container
(
child:
const
Text
(
'X'
),
),
);
return
GestureDetector
(
onTap:
()
{
Navigator
.
pushNamed
(
context
,
'/modal'
);
},
child:
Container
(
child:
const
Text
(
'X'
),
),
);
}
}
class
SecondWidget
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
const
ModalBarrier
(
key:
ValueKey
<
String
>(
'barrier'
),
dismissible:
true
,
);
return
const
ModalBarrier
(
key:
ValueKey
<
String
>(
'barrier'
),
dismissible:
true
,
);
}
}
packages/flutter/test/widgets/sliver_constraints_test.dart
View file @
4c1f4d14
...
...
@@ -40,4 +40,4 @@ void main() {
final
RenderSliver
lastRenderSliver
=
renderViewport
.
lastChild
;
expect
(
lastRenderSliver
.
constraints
.
precedingScrollExtent
,
double
.
infinity
);
});
}
\ No newline at end of file
}
packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
View file @
4c1f4d14
...
...
@@ -321,7 +321,7 @@ class TestDelegateThatCanThrow extends SliverPersistentHeaderDelegate {
@override
double
get
minExtent
{
return
shouldThrow
?
throw
FlutterError
(
'Unavailable minExtent'
)
:
100.0
;
return
shouldThrow
?
throw
FlutterError
(
'Unavailable minExtent'
)
:
100.0
;
}
@override
...
...
packages/flutter_localizations/test/translations_test.dart
View file @
4c1f4d14
...
...
@@ -247,7 +247,7 @@ void main() {
expect
(
localizations
is
MaterialLocalizationZh
,
true
);
});
testWidgets
(
'Serbian resolution'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Serbian resolution'
,
(
WidgetTester
tester
)
async
{
Locale
locale
=
const
Locale
.
fromSubtags
(
languageCode:
'sr'
,
scriptCode:
null
,
countryCode:
null
);
expect
(
GlobalMaterialLocalizations
.
delegate
.
isSupported
(
locale
),
isTrue
);
MaterialLocalizations
localizations
=
await
GlobalMaterialLocalizations
.
delegate
.
load
(
locale
);
...
...
packages/flutter_test/lib/src/accessibility.dart
View file @
4c1f4d14
...
...
@@ -137,7 +137,7 @@ class LabeledTapTargetGuideline extends AccessibilityGuideline {
@override
FutureOr
<
Evaluation
>
evaluate
(
WidgetTester
tester
)
{
final
SemanticsNode
root
=
tester
.
binding
.
pipelineOwner
.
semanticsOwner
.
rootSemanticsNode
;
final
SemanticsNode
root
=
tester
.
binding
.
pipelineOwner
.
semanticsOwner
.
rootSemanticsNode
;
Evaluation
traverse
(
SemanticsNode
node
)
{
Evaluation
result
=
const
Evaluation
.
pass
();
node
.
visitChildren
((
SemanticsNode
child
)
{
...
...
@@ -262,8 +262,8 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
return
result
;
final
List
<
int
>
subset
=
_subsetToRect
(
byteData
,
paintBounds
,
image
.
width
,
image
.
height
);
// Node was too far off screen.
if
(
subset
.
isEmpty
)
return
result
;
if
(
subset
.
isEmpty
)
return
result
;
final
_ContrastReport
report
=
_ContrastReport
(
subset
);
final
double
contrastRatio
=
report
.
contrastRatio
();
const
double
delta
=
-
0.01
;
...
...
packages/flutter_test/lib/src/binding.dart
View file @
4c1f4d14
...
...
@@ -1742,4 +1742,4 @@ class _MockHttpHeaders extends HttpHeaders {
@override
String
value
(
String
name
)
=>
null
;
}
\ No newline at end of file
}
packages/flutter_test/lib/src/matchers.dart
View file @
4c1f4d14
...
...
@@ -1327,18 +1327,18 @@ class _RendersOnPhysicalModel extends _MatchRenderObject<RenderPhysicalShape, Re
}
bool
assertRoundedRectangle
(
ShapeBorderClipper
shapeClipper
,
BorderRadius
borderRadius
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
if
(
shapeClipper
.
shape
.
runtimeType
!=
RoundedRectangleBorder
)
return
failWithDescription
(
matchState
,
'had shape border:
${shapeClipper.shape}
'
);
final
RoundedRectangleBorder
border
=
shapeClipper
.
shape
;
if
(
border
.
borderRadius
!=
borderRadius
)
return
failWithDescription
(
matchState
,
'had borderRadius:
${border.borderRadius}
'
);
return
true
;
if
(
shapeClipper
.
shape
.
runtimeType
!=
RoundedRectangleBorder
)
return
failWithDescription
(
matchState
,
'had shape border:
${shapeClipper.shape}
'
);
final
RoundedRectangleBorder
border
=
shapeClipper
.
shape
;
if
(
border
.
borderRadius
!=
borderRadius
)
return
failWithDescription
(
matchState
,
'had borderRadius:
${border.borderRadius}
'
);
return
true
;
}
bool
assertCircle
(
ShapeBorderClipper
shapeClipper
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
if
(
shapeClipper
.
shape
.
runtimeType
!=
CircleBorder
)
return
failWithDescription
(
matchState
,
'had shape border:
${shapeClipper.shape}
'
);
return
true
;
if
(
shapeClipper
.
shape
.
runtimeType
!=
CircleBorder
)
return
failWithDescription
(
matchState
,
'had shape border:
${shapeClipper.shape}
'
);
return
true
;
}
@override
...
...
packages/flutter_test/lib/src/window.dart
View file @
4c1f4d14
...
...
@@ -339,4 +339,4 @@ class TestWindow implements Window {
clearTextScaleFactorTestValue
();
clearViewInsetsTestValue
();
}
}
\ No newline at end of file
}
packages/flutter_test/test/accessibility_test.dart
View file @
4c1f4d14
...
...
@@ -362,7 +362,7 @@ void main() {
});
});
group
(
'Labeled tappable node guideline'
,
()
{
group
(
'Labeled tappable node guideline'
,
()
{
testWidgets
(
'Passes when node is labeled'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
await
tester
.
pumpWidget
(
_boilerplate
(
Semantics
(
...
...
packages/flutter_test/test/window_test.dart
View file @
4c1f4d14
...
...
@@ -253,4 +253,4 @@ class FakeAccessibilityFeatures implements AccessibilityFeatures {
@override
final
bool
reduceMotion
;
}
\ No newline at end of file
}
packages/flutter_tools/lib/src/application_package.dart
View file @
4c1f4d14
...
...
@@ -98,7 +98,7 @@ class AndroidApk extends ApplicationPackage {
return
null
;
}
final
List
<
String
>
aaptArgs
=
<
String
>[
final
List
<
String
>
aaptArgs
=
<
String
>[
aaptPath
,
'dump'
,
'xmltree'
,
...
...
packages/flutter_tools/lib/src/build_runner/build_script_generator.dart
View file @
4c1f4d14
...
...
@@ -279,4 +279,4 @@ class BuildScriptGenerator {
/// Whether [child] specifies that it wants to run before [parent].
bool
_mustRunBefore
(
BuilderDefinition
parent
,
BuilderDefinition
child
)
=>
child
.
runsBefore
.
contains
(
parent
.
key
);
}
\ No newline at end of file
}
packages/flutter_tools/lib/src/commands/generate.dart
View file @
4c1f4d14
...
...
@@ -27,4 +27,4 @@ class GenerateCommand extends FlutterCommand {
await
codeGenerator
.
generate
(
mainPath:
argResults
[
'target'
]);
return
null
;
}
}
\ No newline at end of file
}
packages/flutter_tools/lib/src/convert.dart
View file @
4c1f4d14
...
...
@@ -46,4 +46,4 @@ class Utf8Decoder extends cnv.Utf8Decoder {
}
return
result
;
}
}
\ No newline at end of file
}
packages/flutter_tools/lib/src/devfs.dart
View file @
4c1f4d14
...
...
@@ -386,20 +386,16 @@ class DevFS {
this
.
rootDirectory
,
{
String
packagesFilePath
,
})
:
_operations
=
ServiceProtocolDevFSOperations
(
serviceProtocol
),
_httpWriter
=
_DevFSHttpWriter
(
fsName
,
serviceProtocol
)
{
_packagesFilePath
=
packagesFilePath
??
fs
.
path
.
join
(
rootDirectory
.
path
,
kPackagesFileName
);
}
_httpWriter
=
_DevFSHttpWriter
(
fsName
,
serviceProtocol
),
_packagesFilePath
=
packagesFilePath
??
fs
.
path
.
join
(
rootDirectory
.
path
,
kPackagesFileName
);
DevFS
.
operations
(
this
.
_operations
,
this
.
fsName
,
this
.
rootDirectory
,
{
String
packagesFilePath
,
})
:
_httpWriter
=
null
{
_packagesFilePath
=
packagesFilePath
??
fs
.
path
.
join
(
rootDirectory
.
path
,
kPackagesFileName
);
}
})
:
_httpWriter
=
null
,
_packagesFilePath
=
packagesFilePath
??
fs
.
path
.
join
(
rootDirectory
.
path
,
kPackagesFileName
);
final
DevFSOperations
_operations
;
final
_DevFSHttpWriter
_httpWriter
;
...
...
packages/flutter_tools/lib/src/flutter_manifest.dart
View file @
4c1f4d14
...
...
@@ -435,4 +435,4 @@ void _validateFonts(YamlList fonts, List<String> errors) {
}
}
}
}
\ No newline at end of file
}
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
4c1f4d14
...
...
@@ -39,7 +39,8 @@ class _FuchsiaLogReader extends DeviceLogReader {
FuchsiaDevice
_device
;
ApplicationPackage
_app
;
@override
String
get
name
=>
_device
.
name
;
@override
String
get
name
=>
_device
.
name
;
Stream
<
String
>
_logLines
;
@override
...
...
packages/flutter_tools/lib/src/macos/application_package.dart
View file @
4c1f4d14
...
...
@@ -16,13 +16,13 @@ bool _isBundleDirectory(FileSystemEntity entity) =>
abstract
class
MacOSApp
extends
ApplicationPackage
{
MacOSApp
({
@required
String
projectBundleId
})
:
super
(
id:
projectBundleId
);
/// Creates a new [MacOSApp] from an existing app bundle.
///
/// `applicationBinary` is the path to the framework directory created by an
/// Xcode build. By default, this is located under
/// "~/Library/Developer/Xcode/DerivedData/" and contains an executable
/// which is expected to start the application and send the observatory
/// port over stdout.
/// Creates a new [MacOSApp] from an existing app bundle.
///
/// `applicationBinary` is the path to the framework directory created by an
/// Xcode build. By default, this is located under
/// "~/Library/Developer/Xcode/DerivedData/" and contains an executable
/// which is expected to start the application and send the observatory
/// port over stdout.
factory
MacOSApp
.
fromPrebuiltApp
(
FileSystemEntity
applicationBinary
)
{
final
FileSystemEntityType
entityType
=
fs
.
typeSync
(
applicationBinary
.
path
);
if
(
entityType
==
FileSystemEntityType
.
notFound
)
{
...
...
@@ -71,7 +71,7 @@ abstract class MacOSApp extends ApplicationPackage {
String
get
executable
;
}
class
PrebuiltMacOSApp
extends
MacOSApp
{
class
PrebuiltMacOSApp
extends
MacOSApp
{
PrebuiltMacOSApp
({
@required
this
.
bundleDir
,
@required
this
.
bundleName
,
...
...
packages/flutter_tools/lib/src/project.dart
View file @
4c1f4d14
...
...
@@ -467,7 +467,7 @@ class WebProject {
final
FlutterProject
parent
;
Future
<
void
>
ensureReadyForPlatformSpecificTooling
()
async
{
Future
<
void
>
ensureReadyForPlatformSpecificTooling
()
async
{
/// Generate index.html in build/web. Eventually we could support
/// a custom html under the web sub directory.
final
Directory
outputDir
=
fs
.
directory
(
getWebBuildDirectory
());
...
...
packages/flutter_tools/test/build_runner/build_runner_test.dart
View file @
4c1f4d14
...
...
@@ -33,4 +33,4 @@ void main() {
});
}
class
MockPlatform
extends
Mock
implements
Platform
{}
\ No newline at end of file
class
MockPlatform
extends
Mock
implements
Platform
{}
packages/flutter_tools/test/cache_test.dart
View file @
4c1f4d14
...
...
@@ -162,4 +162,4 @@ class MockFile extends Mock implements File {
class
MockRandomAccessFile
extends
Mock
implements
RandomAccessFile
{}
class
MockCachedArtifact
extends
Mock
implements
CachedArtifact
{}
class
MockInternetAddress
extends
Mock
implements
InternetAddress
{}
class
MockCache
extends
Mock
implements
Cache
{}
\ No newline at end of file
class
MockCache
extends
Mock
implements
Cache
{}
packages/flutter_tools/test/commands/doctor_test.dart
View file @
4c1f4d14
...
...
@@ -212,7 +212,7 @@ void main() {
});
group
(
'doctor with fake validators'
,
()
{
group
(
'doctor with fake validators'
,
()
{
testUsingContext
(
'validate non-verbose output format for run without issues'
,
()
async
{
expect
(
await
FakeQuietDoctor
().
diagnose
(
verbose:
false
),
isTrue
);
expect
(
testLogger
.
statusText
,
equals
(
...
...
packages/flutter_tools/test/integration/expression_evaluation_test.dart
View file @
4c1f4d14
...
...
@@ -144,17 +144,16 @@ Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async {
Future
<
void
>
evaluateComplexExpressions
(
FlutterTestDriver
flutter
)
async
{
final
InstanceRef
res
=
await
flutter
.
evaluateInFrame
(
'new DateTime.now().year'
);
expect
(
res
.
kind
==
InstanceKind
.
kInt
&&
res
.
valueAsString
==
DateTime
.
now
().
year
.
toString
(),
isTrue
);
expect
(
res
.
kind
==
InstanceKind
.
kInt
&&
res
.
valueAsString
==
DateTime
.
now
().
year
.
toString
(),
isTrue
);
}
Future
<
void
>
evaluateComplexReturningExpressions
(
FlutterTestDriver
flutter
)
async
{
final
DateTime
now
=
DateTime
.
now
();
final
InstanceRef
resp
=
await
flutter
.
evaluateInFrame
(
'new DateTime.now()'
);
expect
(
resp
.
classRef
.
name
,
equals
(
'DateTime'
));
// Ensure we got a reasonable approximation. The more accurate we try to
// make this, the more likely it'll fail due to differences in the time
// in the remote VM and the local VM at the time the code runs.
final
InstanceRef
res
=
await
flutter
.
evaluate
(
resp
.
id
,
r'"$year-$month-$day"'
);
expect
(
res
.
valueAsString
,
equals
(
'
${now.year}
-
${now.month}
-
${now.day}
'
));
final
InstanceRef
resp
=
await
flutter
.
evaluateInFrame
(
'new DateTime.now()'
);
expect
(
resp
.
classRef
.
name
,
equals
(
'DateTime'
));
// Ensure we got a reasonable approximation. The more accurate we try to
// make this, the more likely it'll fail due to differences in the time
// in the remote VM and the local VM at the time the code runs.
final
InstanceRef
res
=
await
flutter
.
evaluate
(
resp
.
id
,
r'"$year-$month-$day"'
);
expect
(
res
.
valueAsString
,
equals
(
'
${now.year}
-
${now.month}
-
${now.day}
'
));
}
packages/flutter_tools/test/web/compile_test.dart
View file @
4c1f4d14
...
...
@@ -51,4 +51,4 @@ void main() {
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcess
extends
Mock
implements
Process
{}
\ No newline at end of file
class
MockProcess
extends
Mock
implements
Process
{}
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