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
1d53378b
Unverified
Commit
1d53378b
authored
Jun 14, 2022
by
Pierre-Louis
Committed by
GitHub
Jun 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reland #105109 (#105588)
parent
c8578570
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
5 deletions
+24
-5
dialog_template.dart
dev/tools/gen_defaults/lib/dialog_template.dart
+3
-0
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+9
-4
dialog_theme.dart
packages/flutter/lib/src/material/dialog_theme.dart
+10
-1
dialog_theme_test.dart
packages/flutter/test/material/dialog_theme_test.dart
+2
-0
No files found.
dev/tools/gen_defaults/lib/dialog_template.dart
View file @
1d53378b
...
@@ -34,6 +34,9 @@ class _TokenDefaultsM3 extends DialogTheme {
...
@@ -34,6 +34,9 @@ class _TokenDefaultsM3 extends DialogTheme {
@override
@override
TextStyle? get contentTextStyle =>
${textStyle("md.comp.dialog.supporting-text")}
;
TextStyle? get contentTextStyle =>
${textStyle("md.comp.dialog.supporting-text")}
;
@override
EdgeInsetsGeometry? get actionsPadding => const EdgeInsets.only(left: 24.0, right: 24.0, bottom: 24.0);
}
}
'''
;
'''
;
}
}
packages/flutter/lib/src/material/dialog.dart
View file @
1d53378b
...
@@ -555,11 +555,10 @@ class AlertDialog extends StatelessWidget {
...
@@ -555,11 +555,10 @@ class AlertDialog extends StatelessWidget {
if
(
actions
!=
null
)
{
if
(
actions
!=
null
)
{
final
double
spacing
=
(
buttonPadding
?.
horizontal
??
16
)
/
2
;
final
double
spacing
=
(
buttonPadding
?.
horizontal
??
16
)
/
2
;
final
EdgeInsetsGeometry
effetiveActionsPadding
=
(
actionsPadding
??
EdgeInsets
.
zero
).
add
(
theme
.
useMaterial3
?
const
EdgeInsets
.
only
(
left:
24.0
,
right:
24.0
,
bottom:
24.0
)
:
EdgeInsets
.
all
(
spacing
),
);
actionsWidget
=
Padding
(
actionsWidget
=
Padding
(
padding:
effetiveActionsPadding
,
padding:
actionsPadding
??
dialogTheme
.
actionsPadding
??
(
theme
.
useMaterial3
?
defaults
.
actionsPadding
!
:
defaults
.
actionsPadding
!.
add
(
EdgeInsets
.
all
(
spacing
))
),
child:
OverflowBar
(
child:
OverflowBar
(
alignment:
actionsAlignment
??
MainAxisAlignment
.
end
,
alignment:
actionsAlignment
??
MainAxisAlignment
.
end
,
spacing:
spacing
,
spacing:
spacing
,
...
@@ -1205,6 +1204,9 @@ class _DefaultsM2 extends DialogTheme {
...
@@ -1205,6 +1204,9 @@ class _DefaultsM2 extends DialogTheme {
@override
@override
TextStyle
?
get
contentTextStyle
=>
_textTheme
.
subtitle1
;
TextStyle
?
get
contentTextStyle
=>
_textTheme
.
subtitle1
;
@override
EdgeInsetsGeometry
?
get
actionsPadding
=>
EdgeInsets
.
zero
;
}
}
// BEGIN GENERATED TOKEN PROPERTIES
// BEGIN GENERATED TOKEN PROPERTIES
...
@@ -1235,6 +1237,9 @@ class _TokenDefaultsM3 extends DialogTheme {
...
@@ -1235,6 +1237,9 @@ class _TokenDefaultsM3 extends DialogTheme {
@override
@override
TextStyle
?
get
contentTextStyle
=>
_textTheme
.
bodyMedium
;
TextStyle
?
get
contentTextStyle
=>
_textTheme
.
bodyMedium
;
@override
EdgeInsetsGeometry
?
get
actionsPadding
=>
const
EdgeInsets
.
only
(
left:
24.0
,
right:
24.0
,
bottom:
24.0
);
}
}
// END GENERATED TOKEN PROPERTIES
// END GENERATED TOKEN PROPERTIES
packages/flutter/lib/src/material/dialog_theme.dart
View file @
1d53378b
...
@@ -34,6 +34,7 @@ class DialogTheme with Diagnosticable {
...
@@ -34,6 +34,7 @@ class DialogTheme with Diagnosticable {
this
.
alignment
,
this
.
alignment
,
this
.
titleTextStyle
,
this
.
titleTextStyle
,
this
.
contentTextStyle
,
this
.
contentTextStyle
,
this
.
actionsPadding
,
});
});
/// Overrides the default value for [Dialog.backgroundColor].
/// Overrides the default value for [Dialog.backgroundColor].
...
@@ -56,6 +57,9 @@ class DialogTheme with Diagnosticable {
...
@@ -56,6 +57,9 @@ class DialogTheme with Diagnosticable {
/// [AlertDialog.content].
/// [AlertDialog.content].
final
TextStyle
?
contentTextStyle
;
final
TextStyle
?
contentTextStyle
;
/// Overrides the default value for [AlertDialog.actionsPadding].
final
EdgeInsetsGeometry
?
actionsPadding
;
/// Creates a copy of this object but with the given fields replaced with the
/// Creates a copy of this object but with the given fields replaced with the
/// new values.
/// new values.
DialogTheme
copyWith
({
DialogTheme
copyWith
({
...
@@ -65,6 +69,7 @@ class DialogTheme with Diagnosticable {
...
@@ -65,6 +69,7 @@ class DialogTheme with Diagnosticable {
AlignmentGeometry
?
alignment
,
AlignmentGeometry
?
alignment
,
TextStyle
?
titleTextStyle
,
TextStyle
?
titleTextStyle
,
TextStyle
?
contentTextStyle
,
TextStyle
?
contentTextStyle
,
EdgeInsetsGeometry
?
actionsPadding
,
})
{
})
{
return
DialogTheme
(
return
DialogTheme
(
backgroundColor:
backgroundColor
??
this
.
backgroundColor
,
backgroundColor:
backgroundColor
??
this
.
backgroundColor
,
...
@@ -73,6 +78,7 @@ class DialogTheme with Diagnosticable {
...
@@ -73,6 +78,7 @@ class DialogTheme with Diagnosticable {
alignment:
alignment
??
this
.
alignment
,
alignment:
alignment
??
this
.
alignment
,
titleTextStyle:
titleTextStyle
??
this
.
titleTextStyle
,
titleTextStyle:
titleTextStyle
??
this
.
titleTextStyle
,
contentTextStyle:
contentTextStyle
??
this
.
contentTextStyle
,
contentTextStyle:
contentTextStyle
??
this
.
contentTextStyle
,
actionsPadding:
actionsPadding
??
this
.
actionsPadding
,
);
);
}
}
...
@@ -95,6 +101,7 @@ class DialogTheme with Diagnosticable {
...
@@ -95,6 +101,7 @@ class DialogTheme with Diagnosticable {
alignment:
AlignmentGeometry
.
lerp
(
a
?.
alignment
,
b
?.
alignment
,
t
),
alignment:
AlignmentGeometry
.
lerp
(
a
?.
alignment
,
b
?.
alignment
,
t
),
titleTextStyle:
TextStyle
.
lerp
(
a
?.
titleTextStyle
,
b
?.
titleTextStyle
,
t
),
titleTextStyle:
TextStyle
.
lerp
(
a
?.
titleTextStyle
,
b
?.
titleTextStyle
,
t
),
contentTextStyle:
TextStyle
.
lerp
(
a
?.
contentTextStyle
,
b
?.
contentTextStyle
,
t
),
contentTextStyle:
TextStyle
.
lerp
(
a
?.
contentTextStyle
,
b
?.
contentTextStyle
,
t
),
actionsPadding:
EdgeInsetsGeometry
.
lerp
(
a
?.
actionsPadding
,
b
?.
actionsPadding
,
t
),
);
);
}
}
...
@@ -115,7 +122,8 @@ class DialogTheme with Diagnosticable {
...
@@ -115,7 +122,8 @@ class DialogTheme with Diagnosticable {
&&
other
.
shape
==
shape
&&
other
.
shape
==
shape
&&
other
.
alignment
==
alignment
&&
other
.
alignment
==
alignment
&&
other
.
titleTextStyle
==
titleTextStyle
&&
other
.
titleTextStyle
==
titleTextStyle
&&
other
.
contentTextStyle
==
contentTextStyle
;
&&
other
.
contentTextStyle
==
contentTextStyle
&&
other
.
actionsPadding
==
actionsPadding
;
}
}
@override
@override
...
@@ -127,5 +135,6 @@ class DialogTheme with Diagnosticable {
...
@@ -127,5 +135,6 @@ class DialogTheme with Diagnosticable {
properties
.
add
(
DiagnosticsProperty
<
AlignmentGeometry
>(
'alignment'
,
alignment
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
AlignmentGeometry
>(
'alignment'
,
alignment
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
TextStyle
>(
'titleTextStyle'
,
titleTextStyle
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
TextStyle
>(
'titleTextStyle'
,
titleTextStyle
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
TextStyle
>(
'contentTextStyle'
,
contentTextStyle
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
TextStyle
>(
'contentTextStyle'
,
contentTextStyle
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
EdgeInsetsGeometry
>(
'actionsPadding'
,
actionsPadding
,
defaultValue:
null
));
}
}
}
}
packages/flutter/test/material/dialog_theme_test.dart
View file @
1d53378b
...
@@ -54,6 +54,7 @@ void main() {
...
@@ -54,6 +54,7 @@ void main() {
alignment:
Alignment
.
bottomLeft
,
alignment:
Alignment
.
bottomLeft
,
titleTextStyle:
TextStyle
(
color:
Color
(
0xffffffff
)),
titleTextStyle:
TextStyle
(
color:
Color
(
0xffffffff
)),
contentTextStyle:
TextStyle
(
color:
Color
(
0xff000000
)),
contentTextStyle:
TextStyle
(
color:
Color
(
0xff000000
)),
actionsPadding:
EdgeInsets
.
all
(
8.0
),
).
debugFillProperties
(
builder
);
).
debugFillProperties
(
builder
);
final
List
<
String
>
description
=
builder
.
properties
final
List
<
String
>
description
=
builder
.
properties
.
where
((
DiagnosticsNode
n
)
=>
!
n
.
isFiltered
(
DiagnosticLevel
.
info
))
.
where
((
DiagnosticsNode
n
)
=>
!
n
.
isFiltered
(
DiagnosticLevel
.
info
))
...
@@ -64,6 +65,7 @@ void main() {
...
@@ -64,6 +65,7 @@ void main() {
'alignment: Alignment.bottomLeft'
,
'alignment: Alignment.bottomLeft'
,
'titleTextStyle: TextStyle(inherit: true, color: Color(0xffffffff))'
,
'titleTextStyle: TextStyle(inherit: true, color: Color(0xffffffff))'
,
'contentTextStyle: TextStyle(inherit: true, color: Color(0xff000000))'
,
'contentTextStyle: TextStyle(inherit: true, color: Color(0xff000000))'
,
'actionsPadding: EdgeInsets.all(8.0)'
,
]);
]);
});
});
...
...
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