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
d5b64806
Unverified
Commit
d5b64806
authored
Feb 01, 2019
by
Hans Muller
Committed by
GitHub
Feb 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Material.border type is now BorderRadiusGeometry (#27376)
parent
cdddec74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
material.dart
packages/flutter/lib/src/material/material.dart
+5
-3
material_test.dart
packages/flutter/test/material/material_test.dart
+35
-0
No files found.
packages/flutter/lib/src/material/material.dart
View file @
d5b64806
...
...
@@ -257,14 +257,16 @@ class Material extends StatefulWidget {
/// The default value is [kThemeChangeDuration].
final
Duration
animationDuration
;
/// If non-null, the corners of this box are rounded by this [BorderRadius].
/// If non-null, the corners of this box are rounded by this
/// [BorderRadiusGeometry] value.
///
/// Otherwise, the corners specified for the current [type] of material are
/// used.
///
/// If [shape] is non null then the border radius is ignored.
///
/// Must be null if [type] is [MaterialType.circle].
final
BorderRadius
borderRadius
;
final
BorderRadius
Geometry
borderRadius
;
/// The ink controller from the closest instance of this class that
/// encloses the given context.
...
...
@@ -292,7 +294,7 @@ class Material extends StatefulWidget {
textStyle
?.
debugFillProperties
(
properties
,
prefix:
'textStyle.'
);
properties
.
add
(
DiagnosticsProperty
<
ShapeBorder
>(
'shape'
,
shape
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
bool
>(
'borderOnForeground'
,
borderOnForeground
,
defaultValue:
true
));
properties
.
add
(
EnumProperty
<
BorderRadius
>(
'borderRadius'
,
borderRadius
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
BorderRadiusGeometry
>(
'borderRadius'
,
borderRadius
,
defaultValue:
null
));
}
/// The default radius of an ink splash in logical pixels.
...
...
packages/flutter/test/material/material_test.dart
View file @
d5b64806
...
...
@@ -56,6 +56,41 @@ class PaintRecorder extends CustomPainter {
}
void
main
(
)
{
testWidgets
(
'default Material debugFillProperties'
,
(
WidgetTester
tester
)
async
{
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
const
Material
().
debugFillProperties
(
builder
);
final
List
<
String
>
description
=
builder
.
properties
.
where
((
DiagnosticsNode
node
)
=>
!
node
.
isFiltered
(
DiagnosticLevel
.
info
))
.
map
((
DiagnosticsNode
node
)
=>
node
.
toString
())
.
toList
();
expect
(
description
,
<
String
>[
'type: canvas'
]);
});
testWidgets
(
'Material implements debugFillProperties'
,
(
WidgetTester
tester
)
async
{
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
const
Material
(
type:
MaterialType
.
canvas
,
color:
Color
(
0xFFFFFFFF
),
textStyle:
TextStyle
(
color:
Color
(
0xff00ff00
)),
borderRadius:
BorderRadiusDirectional
.
all
(
Radius
.
circular
(
10
)),
).
debugFillProperties
(
builder
);
final
List
<
String
>
description
=
builder
.
properties
.
where
((
DiagnosticsNode
node
)
=>
!
node
.
isFiltered
(
DiagnosticLevel
.
info
))
.
map
((
DiagnosticsNode
node
)
=>
node
.
toString
())
.
toList
();
expect
(
description
,
<
String
>[
'type: canvas'
,
'color: Color(0xffffffff)'
,
'textStyle.inherit: true'
,
'textStyle.color: Color(0xff00ff00)'
,
'borderRadius: BorderRadiusDirectional.circular(10.0)'
]);
});
testWidgets
(
'LayoutChangedNotification test'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Material
(
...
...
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