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
2d37e086
Unverified
Commit
2d37e086
authored
Sep 28, 2020
by
Jonah Williams
Committed by
GitHub
Sep 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[desktop] default to shrink wrap on desktop platforms (#66754)
parent
3063182e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+12
-1
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+15
-5
sliver_fill_remaining_test.dart
...ages/flutter/test/widgets/sliver_fill_remaining_test.dart
+3
-0
No files found.
packages/flutter/lib/src/material/theme_data.dart
View file @
2d37e086
...
...
@@ -368,7 +368,18 @@ class ThemeData with Diagnosticable {
textTheme
=
defaultTextTheme
.
merge
(
textTheme
);
primaryTextTheme
=
defaultPrimaryTextTheme
.
merge
(
primaryTextTheme
);
accentTextTheme
=
defaultAccentTextTheme
.
merge
(
accentTextTheme
);
materialTapTargetSize
??=
MaterialTapTargetSize
.
padded
;
switch
(
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
fuchsia
:
case
TargetPlatform
.
iOS
:
materialTapTargetSize
??=
MaterialTapTargetSize
.
padded
;
break
;
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
macOS
:
case
TargetPlatform
.
windows
:
materialTapTargetSize
??=
MaterialTapTargetSize
.
shrinkWrap
;
break
;
}
applyElevationOverlayColor
??=
false
;
// Used as the default color (fill color) for RaisedButtons. Computing the
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
2d37e086
...
...
@@ -96,11 +96,21 @@ void main() {
expect
(
darkTheme
.
accentTextTheme
.
headline6
.
color
,
typography
.
white
.
headline6
.
color
);
});
test
(
'Defaults to MaterialTapTargetBehavior.expanded'
,
()
{
final
ThemeData
themeData
=
ThemeData
();
expect
(
themeData
.
materialTapTargetSize
,
MaterialTapTargetSize
.
padded
);
});
testWidgets
(
'Defaults to MaterialTapTargetBehavior.padded on mobile platforms and MaterialTapTargetBehavior.shrinkWrap on desktop'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
themeData
=
ThemeData
(
platform:
defaultTargetPlatform
);
switch
(
defaultTargetPlatform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
fuchsia
:
case
TargetPlatform
.
iOS
:
expect
(
themeData
.
materialTapTargetSize
,
MaterialTapTargetSize
.
padded
);
break
;
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
macOS
:
case
TargetPlatform
.
windows
:
expect
(
themeData
.
materialTapTargetSize
,
MaterialTapTargetSize
.
shrinkWrap
);
break
;
}
},
variant:
TargetPlatformVariant
.
all
());
test
(
'Can control fontFamily default'
,
()
{
final
ThemeData
themeData
=
ThemeData
(
...
...
packages/flutter/test/widgets/sliver_fill_remaining_test.dart
View file @
2d37e086
...
...
@@ -25,6 +25,9 @@ void main() {
Axis
scrollDirection
=
Axis
.
vertical
,
})
{
return
MaterialApp
(
theme:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
padded
,
),
home:
Scaffold
(
body:
CustomScrollView
(
scrollDirection:
scrollDirection
,
...
...
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