Commit 9ad94220 authored by Devon Carew's avatar Devon Carew

Merge pull request #907 from devoncarew/mini_fab

support mini fabs
parents 5b42f83f a8582228
...@@ -13,6 +13,7 @@ import 'theme.dart'; ...@@ -13,6 +13,7 @@ import 'theme.dart';
// TODO(eseidel): This needs to change based on device size? // TODO(eseidel): This needs to change based on device size?
// http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing // http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing
const double _kSize = 56.0; const double _kSize = 56.0;
const double _kSizeMini = 40.0;
class FloatingActionButton extends StatefulComponent { class FloatingActionButton extends StatefulComponent {
const FloatingActionButton({ const FloatingActionButton({
...@@ -21,7 +22,8 @@ class FloatingActionButton extends StatefulComponent { ...@@ -21,7 +22,8 @@ class FloatingActionButton extends StatefulComponent {
this.backgroundColor, this.backgroundColor,
this.elevation: 6, this.elevation: 6,
this.highlightElevation: 12, this.highlightElevation: 12,
this.onPressed this.onPressed,
this.mini: false
}) : super(key: key); }) : super(key: key);
final Widget child; final Widget child;
...@@ -29,6 +31,7 @@ class FloatingActionButton extends StatefulComponent { ...@@ -29,6 +31,7 @@ class FloatingActionButton extends StatefulComponent {
final VoidCallback onPressed; final VoidCallback onPressed;
final int elevation; final int elevation;
final int highlightElevation; final int highlightElevation;
final bool mini;
_FloatingActionButtonState createState() => new _FloatingActionButtonState(); _FloatingActionButtonState createState() => new _FloatingActionButtonState();
} }
...@@ -56,8 +59,8 @@ class _FloatingActionButtonState extends State<FloatingActionButton> { ...@@ -56,8 +59,8 @@ class _FloatingActionButtonState extends State<FloatingActionButton> {
type: MaterialType.circle, type: MaterialType.circle,
elevation: _highlight ? config.highlightElevation : config.elevation, elevation: _highlight ? config.highlightElevation : config.elevation,
child: new Container( child: new Container(
width: _kSize, width: config.mini ? _kSizeMini : _kSize,
height: _kSize, height: config.mini ? _kSizeMini : _kSize,
child: new InkWell( child: new InkWell(
onTap: config.onPressed, onTap: config.onPressed,
onHighlightChanged: _handleHighlightChanged, onHighlightChanged: _handleHighlightChanged,
......
...@@ -1252,7 +1252,7 @@ class RawText extends LeafRenderObjectWidget { ...@@ -1252,7 +1252,7 @@ class RawText extends LeafRenderObjectWidget {
/// A convience widget for paragraphs of text with heterogeneous style. /// A convience widget for paragraphs of text with heterogeneous style.
/// ///
/// The elements paramter is a recusrive list of lists that matches the /// The elements parameter is a recursive list of lists that matches the
/// following grammar: /// following grammar:
/// ///
/// `elements ::= "string" | [<text-style> <elements>*]`` /// `elements ::= "string" | [<text-style> <elements>*]``
......
...@@ -60,7 +60,7 @@ class StatisticsOverlay extends LeafRenderObjectWidget { ...@@ -60,7 +60,7 @@ class StatisticsOverlay extends LeafRenderObjectWidget {
/// The rasterizer threshold is an integer specifying the number of frame /// The rasterizer threshold is an integer specifying the number of frame
/// intervals that the rasterizer must miss before it decides that the frame /// intervals that the rasterizer must miss before it decides that the frame
/// is suitable for capturing an SkPicture trace from for further analysis. /// is suitable for capturing an SkPicture trace for further analysis.
/// ///
/// For example, if you want a trace of all pictures that could not be /// For example, if you want a trace of all pictures that could not be
/// renderered by the rasterizer within the frame boundary (and hence caused /// renderered by the rasterizer within the frame boundary (and hence caused
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment