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
e1a96b81
Unverified
Commit
e1a96b81
authored
Nov 16, 2021
by
Pierre-Louis
Committed by
GitHub
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate `primaryColorBrightness` (#93396)
parent
8612f80a
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
27 deletions
+96
-27
fix_data.yaml
packages/flutter/lib/fix_data.yaml
+32
-0
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-1
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+2
-2
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+42
-18
circle_avatar_test.dart
packages/flutter/test/material/circle_avatar_test.dart
+0
-1
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+5
-5
material.dart
packages/flutter/test_fixes/material.dart
+7
-0
material.dart.expect
packages/flutter/test_fixes/material.dart.expect
+7
-0
No files found.
packages/flutter/lib/fix_data.yaml
View file @
e1a96b81
...
...
@@ -14,6 +14,38 @@
version
:
1
transforms
:
# Changes made in https://github.com/flutter/flutter/pull/93396
-
title
:
"
Remove
'primaryColorBrightness'"
date
:
2021-11-11
element
:
uris
:
[
'
material.dart'
]
method
:
'
copyWith'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
primaryColorBrightness'
# Changes made in https://github.com/flutter/flutter/pull/93396
-
title
:
"
Remove
'primaryColorBrightness'"
date
:
2021-11-11
element
:
uris
:
[
'
material.dart'
]
constructor
:
'
raw'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
primaryColorBrightness'
# Changes made in https://github.com/flutter/flutter/pull/93396
-
title
:
"
Remove
'primaryColorBrightness'"
date
:
2021-11-11
element
:
uris
:
[
'
material.dart'
]
constructor
:
'
'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
primaryColorBrightness'
# Changes made in https://github.com/flutter/flutter/pull/86198
-
title
:
"
Migrate
to
'backgroundColor'"
...
...
packages/flutter/lib/src/material/app_bar.dart
View file @
e1a96b81
...
...
@@ -1047,7 +1047,7 @@ class _AppBarState extends State<AppBar> {
?
_systemOverlayStyleForBrightness
(
widget
.
brightness
??
appBarTheme
.
brightness
??
theme
.
primaryColorBrightness
,
??
ThemeData
.
estimateBrightnessForColor
(
backgroundColor
)
,
)
:
widget
.
systemOverlayStyle
??
appBarTheme
.
systemOverlayStyle
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
e1a96b81
...
...
@@ -662,7 +662,7 @@ class TextField extends StatefulWidget {
///
/// This setting is only honored on iOS devices.
///
/// If unset, defaults to
the brightness of [ThemeData.primaryColorB
rightness].
/// If unset, defaults to
[ThemeData.b
rightness].
final
Brightness
?
keyboardAppearance
;
/// {@macro flutter.widgets.editableText.scrollPadding}
...
...
@@ -1143,7 +1143,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
TextSelectionThemeData
selectionTheme
=
TextSelectionTheme
.
of
(
context
);
final
TextStyle
style
=
theme
.
textTheme
.
subtitle1
!.
merge
(
widget
.
style
);
final
Brightness
keyboardAppearance
=
widget
.
keyboardAppearance
??
theme
.
primaryColorB
rightness
;
final
Brightness
keyboardAppearance
=
widget
.
keyboardAppearance
??
theme
.
b
rightness
;
final
TextEditingController
controller
=
_effectiveController
;
final
FocusNode
focusNode
=
_effectiveFocusNode
;
final
List
<
TextInputFormatter
>
formatters
=
<
TextInputFormatter
>[
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
e1a96b81
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/circle_avatar_test.dart
View file @
e1a96b81
...
...
@@ -5,7 +5,6 @@
// This file is run as part of a reduced test set in CI on Mac and Windows
// machines.
@Tags
(<
String
>[
'reduced-test-set'
])
import
'dart:typed_data'
;
import
'package:flutter/material.dart'
;
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
e1a96b81
...
...
@@ -43,8 +43,8 @@ void main() {
});
test
(
'Default primary text theme contrasts with primary brightness'
,
()
{
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
light
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
dar
k
);
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
:
Colors
.
white
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
:
Colors
.
blac
k
);
final
Typography
typography
=
Typography
.
material2018
(
platform:
lightTheme
.
platform
);
expect
(
lightTheme
.
primaryTextTheme
.
headline6
!.
color
,
typography
.
black
.
headline6
!.
color
);
...
...
@@ -61,8 +61,8 @@ void main() {
});
test
(
'Default primary icon theme contrasts with primary brightness'
,
()
{
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
light
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
Brightness:
Brightness
.
dar
k
);
final
ThemeData
lightTheme
=
ThemeData
(
primaryColor
:
Colors
.
white
);
final
ThemeData
darkTheme
=
ThemeData
(
primaryColor
:
Colors
.
blac
k
);
final
Typography
typography
=
Typography
.
material2018
(
platform:
lightTheme
.
platform
);
expect
(
lightTheme
.
primaryTextTheme
.
headline6
!.
color
,
typography
.
black
.
headline6
!.
color
);
...
...
@@ -670,7 +670,6 @@ void main() {
// COLOR
'colorScheme'
,
'primaryColor'
,
'primaryColorBrightness'
,
'primaryColorLight'
,
'primaryColorDark'
,
'focusColor'
,
...
...
@@ -743,6 +742,7 @@ void main() {
'accentIconTheme'
,
'buttonColor'
,
'fixTextFieldOutlineLabel'
,
'primaryColorBrightness'
,
};
final
DiagnosticPropertiesBuilder
properties
=
DiagnosticPropertiesBuilder
();
...
...
packages/flutter/test_fixes/material.dart
View file @
e1a96b81
...
...
@@ -500,4 +500,11 @@ void main() {
AppBarTheme
appBarTheme
=
AppBarTheme
();
appBarTheme
.
color
;
// Changes made in https://github.com/flutter/flutter/pull/93396
ThemeData
themeData
=
ThemeData
();
themeData
=
ThemeData
(
primaryColorBrightness:
Brightness
.
dark
);
themeData
=
ThemeData
.
raw
(
primaryColorBrightness:
Brightness
.
dark
);
themeData
=
themeData
.
copyWith
(
primaryColorBrightness:
Brightness
.
dark
);
themeData
.
primaryColorBrightness
;
// Removing field reference not supported.
}
packages/flutter/test_fixes/material.dart.expect
View file @
e1a96b81
...
...
@@ -473,4 +473,11 @@ void main() {
AppBarTheme appBarTheme = AppBarTheme();
appBarTheme.backgroundColor;
// Changes made in https://github.com/flutter/flutter/pull/93396
ThemeData themeData = ThemeData();
themeData = ThemeData();
themeData = ThemeData.raw();
themeData = themeData.copyWith();
themeData.primaryColorBrightness; // Removing field reference not supported.
}
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