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
c2ec2426
Unverified
Commit
c2ec2426
authored
Apr 19, 2022
by
Kate Lovett
Committed by
GitHub
Apr 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed required from deprecated API (#102107)
parent
eb54cefb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
30 deletions
+37
-30
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+37
-29
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+0
-1
No files found.
packages/flutter/lib/src/material/theme_data.dart
View file @
c2ec2426
...
...
@@ -660,9 +660,9 @@ class ThemeData with Diagnosticable {
);
}
/// Create a [ThemeData] given a set of exact values.
All the
values must be
/// Create a [ThemeData] given a set of exact values.
Most
values must be
/// specified. They all must also be non-null except for
/// [cupertinoOverrideTheme].
/// [cupertinoOverrideTheme]
, and deprecated members
.
///
/// This will rarely be used directly. It is used by [lerp] to
/// create intermediate themes based on two themes created with the
...
...
@@ -758,49 +758,58 @@ class ThemeData with Diagnosticable {
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
required
this
.
accentColor
,
Color
?
accentColor
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
required
this
.
accentColorBrightness
,
Brightness
?
accentColorBrightness
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
required
this
.
accentTextTheme
,
TextTheme
?
accentTextTheme
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
required
this
.
accentIconTheme
,
IconThemeData
?
accentIconTheme
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.3.0-0.2.pre.'
,
)
required
this
.
buttonColor
,
Color
?
buttonColor
,
@Deprecated
(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.'
,
)
required
this
.
fixTextFieldOutlineLabel
,
bool
?
fixTextFieldOutlineLabel
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.'
,
)
required
this
.
primaryColorBrightness
,
Brightness
?
primaryColorBrightness
,
@Deprecated
(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
required
this
.
androidOverscrollIndicator
,
})
:
// GENERAL CONFIGURATION
this
.
androidOverscrollIndicator
,
})
:
// DEPRECATED (newest deprecations at the bottom)
// should not be `required`, use getter pattern to avoid breakages.
_accentColor
=
accentColor
,
_accentColorBrightness
=
accentColorBrightness
,
_accentTextTheme
=
accentTextTheme
,
_accentIconTheme
=
accentIconTheme
,
_buttonColor
=
buttonColor
,
_fixTextFieldOutlineLabel
=
fixTextFieldOutlineLabel
,
_primaryColorBrightness
=
primaryColorBrightness
,
// GENERAL CONFIGURATION
assert
(
applyElevationOverlayColor
!=
null
),
assert
(
extensions
!=
null
),
assert
(
inputDecorationTheme
!=
null
),
...
...
@@ -875,15 +884,7 @@ class ThemeData with Diagnosticable {
assert
(
timePickerTheme
!=
null
),
assert
(
toggleButtonsTheme
!=
null
),
assert
(
tooltipTheme
!=
null
),
assert
(
expansionTileTheme
!=
null
),
// DEPRECATED (newest deprecations at the bottom)
assert
(
accentColor
!=
null
),
assert
(
accentColorBrightness
!=
null
),
assert
(
accentTextTheme
!=
null
),
assert
(
accentIconTheme
!=
null
),
assert
(
buttonColor
!=
null
),
assert
(
fixTextFieldOutlineLabel
!=
null
),
assert
(
primaryColorBrightness
!=
null
);
assert
(
expansionTileTheme
!=
null
);
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
/// text styles of the optional [textTheme].
...
...
@@ -1493,7 +1494,8 @@ class ThemeData with Diagnosticable {
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
final
Color
accentColor
;
Color
get
accentColor
=>
_accentColor
!;
final
Color
?
_accentColor
;
/// Obsolete property that was originally used to determine the color
/// of text and icons placed on top of the accent color (e.g. the
...
...
@@ -1509,7 +1511,8 @@ class ThemeData with Diagnosticable {
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
final
Brightness
accentColorBrightness
;
Brightness
get
accentColorBrightness
=>
_accentColorBrightness
!;
final
Brightness
?
_accentColorBrightness
;
/// Obsolete property that was originally used when a [TextTheme]
/// that contrasted well with the [accentColor] was needed.
...
...
@@ -1532,7 +1535,8 @@ class ThemeData with Diagnosticable {
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
final
TextTheme
accentTextTheme
;
TextTheme
get
accentTextTheme
=>
_accentTextTheme
!;
final
TextTheme
?
_accentTextTheme
;
/// Obsolete property that was originally used when an [IconTheme]
/// that contrasted well with the [accentColor] was needed.
...
...
@@ -1546,14 +1550,16 @@ class ThemeData with Diagnosticable {
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.'
,
)
final
IconThemeData
accentIconTheme
;
IconThemeData
get
accentIconTheme
=>
_accentIconTheme
!;
final
IconThemeData
?
_accentIconTheme
;
/// The default fill color of the [Material].
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.3.0-0.2.pre.'
,
)
final
Color
buttonColor
;
Color
get
buttonColor
=>
_buttonColor
!;
final
Color
?
_buttonColor
;
/// An obsolete flag to allow apps to opt-out of a
/// [small fix](https://github.com/flutter/flutter/issues/54028) for the Y
...
...
@@ -1567,7 +1573,8 @@ class ThemeData with Diagnosticable {
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.'
,
)
final
bool
fixTextFieldOutlineLabel
;
bool
get
fixTextFieldOutlineLabel
=>
_fixTextFieldOutlineLabel
!;
final
bool
?
_fixTextFieldOutlineLabel
;
/// Obsolete property that was originally used to determine the color
/// of text and icons placed on top of the primary color (e.g. toolbar text).
...
...
@@ -1582,7 +1589,8 @@ class ThemeData with Diagnosticable {
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.'
,
)
final
Brightness
primaryColorBrightness
;
Brightness
get
primaryColorBrightness
=>
_primaryColorBrightness
!;
final
Brightness
?
_primaryColorBrightness
;
/// Creates a copy of this theme but with the given fields replaced with the new values.
///
...
...
@@ -1994,11 +2002,11 @@ class ThemeData with Diagnosticable {
tooltipTheme:
TooltipThemeData
.
lerp
(
a
.
tooltipTheme
,
b
.
tooltipTheme
,
t
)!,
expansionTileTheme:
ExpansionTileThemeData
.
lerp
(
a
.
expansionTileTheme
,
b
.
expansionTileTheme
,
t
)!,
// DEPRECATED (newest deprecations at the bottom)
accentColor:
Color
.
lerp
(
a
.
accentColor
,
b
.
accentColor
,
t
)
!
,
accentColor:
Color
.
lerp
(
a
.
accentColor
,
b
.
accentColor
,
t
),
accentColorBrightness:
t
<
0.5
?
a
.
accentColorBrightness
:
b
.
accentColorBrightness
,
accentTextTheme:
TextTheme
.
lerp
(
a
.
accentTextTheme
,
b
.
accentTextTheme
,
t
),
accentIconTheme:
IconThemeData
.
lerp
(
a
.
accentIconTheme
,
b
.
accentIconTheme
,
t
),
buttonColor:
Color
.
lerp
(
a
.
buttonColor
,
b
.
buttonColor
,
t
)
!
,
buttonColor:
Color
.
lerp
(
a
.
buttonColor
,
b
.
buttonColor
,
t
),
fixTextFieldOutlineLabel:
t
<
0.5
?
a
.
fixTextFieldOutlineLabel
:
b
.
fixTextFieldOutlineLabel
,
primaryColorBrightness:
t
<
0.5
?
a
.
primaryColorBrightness
:
b
.
primaryColorBrightness
,
androidOverscrollIndicator:
t
<
0.5
?
a
.
androidOverscrollIndicator
:
b
.
androidOverscrollIndicator
,
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
c2ec2426
...
...
@@ -687,7 +687,6 @@ void main() {
drawerTheme:
const
DrawerThemeData
(),
listTileTheme:
const
ListTileThemeData
(),
fixTextFieldOutlineLabel:
false
,
androidOverscrollIndicator:
null
,
extensions:
const
<
Object
,
ThemeExtension
<
dynamic
>>{},
);
...
...
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