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
02883908
Commit
02883908
authored
Oct 29, 2016
by
Ian Hickson
Committed by
GitHub
Oct 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Theme doc improvements (#6585)
parent
70eb4929
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
15 deletions
+32
-15
drawer_item.dart
packages/flutter/lib/src/material/drawer_item.dart
+1
-1
theme.dart
packages/flutter/lib/src/material/theme.dart
+29
-14
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+2
-0
No files found.
packages/flutter/lib/src/material/drawer_item.dart
View file @
02883908
...
...
@@ -73,7 +73,7 @@ class DrawerItem extends StatelessWidget {
return
themeData
.
accentColor
;
if
(
onPressed
==
null
)
return
Colors
.
white30
;
return
null
;
// use default icon theme colo
u
r unmodified
return
null
;
// use default icon theme color unmodified
}
assert
(
themeData
.
brightness
!=
null
);
return
null
;
...
...
packages/flutter/lib/src/material/theme.dart
View file @
02883908
...
...
@@ -9,16 +9,24 @@ import 'theme_data.dart';
export
'theme_data.dart'
show
Brightness
,
ThemeData
;
/// The duration over which theme changes animate.
/// The duration over which theme changes animate
by default
.
const
Duration
kThemeAnimationDuration
=
const
Duration
(
milliseconds:
200
);
/// Applies a theme to descendant widgets.
///
/// A theme describes the colors and typographic choices of an application.
///
/// Descendant widgets obtain the current theme's [ThemeData] object using
/// [Theme.of]. When a widget uses [Theme.of], it is automatically rebuilt if
/// the theme later changes, so that the changes can be applied.
///
/// See also:
///
/// * [AnimatedTheme]
/// * [ThemeData]
/// * [MaterialApp]
/// * [ThemeData], which describes the actual configuration of a theme.
/// * [AnimatedTheme], which animates the [ThemeData] when it changes rather
/// than changing the theme all at once.
/// * [MaterialApp], which includes an [AnimatedTheme] widget configured via
/// the [MaterialApp.theme] argument.
class
Theme
extends
InheritedWidget
{
/// Applies the given theme [data] to [child].
///
...
...
@@ -49,16 +57,19 @@ class Theme extends InheritedWidget {
static
final
ThemeData
_kFallbackTheme
=
new
ThemeData
.
fallback
();
/// The data from the closest instance of this class that encloses the given context.
/// The data from the closest [Theme] instance that encloses the given
/// context.
///
/// Defaults to the fallback theme data if none exists.
/// Defaults to [new ThemeData.fallback] if there is no [Theme] in the given
/// build context.
///
/// If [shadowThemeOnly] is true and the closest Theme ancestor was installed by
/// the [MaterialApp] - in other words if the closest Theme ancestor does not
/// shadow the app's theme - then return null. This property is specified in
/// situations where its useful to wrap a route's widgets with a Theme, but only
/// when the app's theme is being shadowed by a theme widget that is farather
/// down in the tree. See [isMaterialAppTheme].
/// If [shadowThemeOnly] is true and the closest [Theme] ancestor was
/// installed by the [MaterialApp] — in other words if the closest [Theme]
/// ancestor does not shadow the application's theme — then this returns null.
/// This argument should be used in situations where its useful to wrap a
/// route's widgets with a [Theme], but only when the application's overall
/// theme is being shadowed by a [Theme] widget that is deeper in the tree.
/// See [isMaterialAppTheme].
///
/// Typical usage is as follows:
///
...
...
@@ -128,12 +139,16 @@ class ThemeDataTween extends Tween<ThemeData> {
ThemeData
lerp
(
double
t
)
=>
ThemeData
.
lerp
(
begin
,
end
,
t
);
}
/// Animated version of [Theme] which automatically transitions the colo
u
rs,
/// Animated version of [Theme] which automatically transitions the colors,
/// etc, over a given duration whenever the given theme changes.
///
/// See also:
///
/// * [ThemeData]
/// * [Theme], which [AnimatedTheme] uses to actually apply the interpolated
/// theme.
/// * [ThemeData], which describes the actual configuration of a theme.
/// * [MaterialApp], which includes an [AnimatedTheme] widget configured via
/// the [MaterialApp.theme] argument.
class
AnimatedTheme
extends
ImplicitlyAnimatedWidget
{
/// Creates an animated theme.
///
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
02883908
...
...
@@ -45,6 +45,8 @@ const Color _kDarkThemeSplashColor = const Color(0x40CCCCCC);
/// Holds the color and typography values for a material design theme.
///
/// Use this class to configure a [Theme] widget.
///
/// To obtain the current theme, use [Theme.of].
class
ThemeData
{
/// Create a ThemeData given a set of preferred values.
///
...
...
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