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
fbedd976
Unverified
Commit
fbedd976
authored
Jan 16, 2019
by
Hans Muller
Committed by
GitHub
Jan 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IconButton backgroundColor doc sample (#26611)
parent
b576e093
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
icon_button.dart
packages/flutter/lib/src/material/icon_button.dart
+34
-0
No files found.
packages/flutter/lib/src/material/icon_button.dart
View file @
fbedd976
...
@@ -57,6 +57,40 @@ const double _kMinButtonSize = 48.0;
...
@@ -57,6 +57,40 @@ const double _kMinButtonSize = 48.0;
/// ```
/// ```
/// {@end-tool}
/// {@end-tool}
///
///
/// ### Adding a filled background
///
/// Icon buttons don't support specifying a background color or other
/// background decoration because typically the icon is just displayed
/// on top of the parent widget's background. Icon buttons that appear
/// in [AppBar.actions] are an example of this.
///
/// It's easy enough to create an icon button with a filled background
/// using the [Ink] widget. The [Ink] widget renders a decoration on
/// the underlying [Material] along with the splash and highlight
/// [InkResponse] contributed by descendant widgets.
///
/// {@tool snippet --template=stateless_widget}
///
/// In this sample the icon button's background color is defined with an [Ink]
/// widget whose child is an [IconButton]. The icon button's filled background
/// is a light shade of blue, it's a filled circle, and it's as big as the
/// button is.
///
/// ```dart
/// Ink(
/// decoration: ShapeDecoration(
/// color: Colors.purple,
/// shape: CircleBorder(),
/// ),
/// child: IconButton(
/// icon: Icon(Icons.android),
/// color: Colors.white,
/// onPressed: () { print("filled background"); },
/// ),
/// )
/// ```
/// {@end-tool}
///
/// See also:
/// See also:
///
///
/// * [Icons], a library of predefined icons.
/// * [Icons], a library of predefined icons.
...
...
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