BoxDecoration API changes: backgroundColor -> color et al (#9648)
backgroundColor -> color backgroundImage -> image BackgroundImage -> DecorationImage
This commit is contained in:
@@ -315,7 +315,7 @@ class MiniIconWithText extends StatelessWidget {
|
||||
width: 16.0,
|
||||
height: 16.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: BoxShape.circle
|
||||
),
|
||||
child: new Icon(icon, color: Colors.white, size: 12.0)
|
||||
@@ -332,9 +332,7 @@ class FatDivider extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new Container(
|
||||
height: 8.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).dividerColor
|
||||
)
|
||||
color: Theme.of(context).dividerColor,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -436,7 +434,7 @@ class ItemImageBox extends StatelessWidget {
|
||||
left: 4.0,
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.black54,
|
||||
color: Colors.black54,
|
||||
borderRadius: new BorderRadius.circular(2.0)
|
||||
),
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
@@ -506,9 +504,7 @@ class ItemGalleryBox extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
new Expanded(
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
child: new Center(
|
||||
child: new Text(tabName, style: Theme.of(context).textTheme.headline.copyWith(color: Colors.white)),
|
||||
)
|
||||
@@ -665,10 +661,8 @@ class FancyDrawerHeader extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: Colors.purple
|
||||
),
|
||||
height: 200.0
|
||||
color: Colors.purple,
|
||||
height: 200.0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
|
||||
height: 100.0,
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
decoration: new BoxDecoration(
|
||||
color: data.isEmpty ? _color : Colors.grey.shade200,
|
||||
border: new Border.all(
|
||||
width: 3.0,
|
||||
color: data.isEmpty ? Colors.white : Colors.blue
|
||||
),
|
||||
backgroundColor: data.isEmpty ? _color : Colors.grey.shade200
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class DotState extends State<Dot> {
|
||||
width: widget.size,
|
||||
height: widget.size,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: widget.color,
|
||||
color: widget.color,
|
||||
border: new Border.all(width: taps.toDouble()),
|
||||
shape: BoxShape.circle
|
||||
),
|
||||
|
||||
@@ -446,7 +446,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
|
||||
final List<Widget> headings = <Widget>[];
|
||||
for (int index = 0; index < allSections.length; index++) {
|
||||
headings.add(new Container(
|
||||
decoration: const BoxDecoration(backgroundColor: _kAppBackgroundColor),
|
||||
color: _kAppBackgroundColor,
|
||||
child: new ClipRect(
|
||||
child: new _AllSectionsView(
|
||||
sectionIndex: index,
|
||||
|
||||
@@ -110,9 +110,7 @@ class SectionIndicator extends StatelessWidget {
|
||||
child: new Container(
|
||||
width: kSectionIndicatorWidth,
|
||||
height: 3.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.white.withOpacity(opacity),
|
||||
),
|
||||
color: Colors.white.withOpacity(opacity),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -132,7 +130,7 @@ class SectionDetailView extends StatelessWidget {
|
||||
final Widget image = new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
borderRadius: new BorderRadius.circular(6.0),
|
||||
backgroundImage: new BackgroundImage(
|
||||
image: new DecorationImage(
|
||||
image: new AssetImage(detail.imageAsset),
|
||||
fit: BoxFit.cover,
|
||||
alignment: FractionalOffset.center,
|
||||
@@ -156,7 +154,7 @@ class SectionDetailView extends StatelessWidget {
|
||||
}
|
||||
|
||||
return new DecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: Colors.grey.shade200),
|
||||
decoration: new BoxDecoration(color: Colors.grey.shade200),
|
||||
child: item,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,9 +71,7 @@ class CustomIcon extends StatelessWidget {
|
||||
margin: const EdgeInsets.all(4.0),
|
||||
width: iconTheme.size - 8.0,
|
||||
height: iconTheme.size - 8.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: iconTheme.color,
|
||||
),
|
||||
color: iconTheme.color,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
|
||||
height: 100.0,
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
backgroundImage: new BackgroundImage(
|
||||
image: new DecorationImage(
|
||||
image: new AssetImage(_kAsset0),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -115,7 +115,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
||||
),
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: theme.canvasColor,
|
||||
color: theme.canvasColor,
|
||||
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
|
||||
),
|
||||
child: new ListTile(
|
||||
|
||||
@@ -157,7 +157,7 @@ abstract class _PriceItem extends StatelessWidget {
|
||||
Widget buildItem(BuildContext context, TextStyle style, EdgeInsets padding) {
|
||||
BoxDecoration decoration;
|
||||
if (_shoppingCart[product] != null)
|
||||
decoration = new BoxDecoration(backgroundColor: ShrineTheme.of(context).priceHighlightColor);
|
||||
decoration = new BoxDecoration(color: ShrineTheme.of(context).priceHighlightColor);
|
||||
|
||||
return new Container(
|
||||
padding: padding,
|
||||
@@ -258,7 +258,7 @@ class _Heading extends StatelessWidget {
|
||||
: (screenSize.height - kToolbarHeight) * 0.70,
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: theme.cardBackgroundColor,
|
||||
color: theme.cardBackgroundColor,
|
||||
border: new Border(bottom: new BorderSide(color: theme.dividerColor)),
|
||||
),
|
||||
child: new CustomMultiChildLayout(
|
||||
|
||||
@@ -19,18 +19,18 @@ void main() {
|
||||
final RenderFlex row = new RenderFlex(crossAxisAlignment: crossAxisAlignment, textBaseline: TextBaseline.alphabetic);
|
||||
style = const TextStyle(fontSize: 15.0, color: const Color(0xFF000000));
|
||||
row.add(new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0x7FFFCCCC)),
|
||||
decoration: const BoxDecoration(color: const Color(0x7FFFCCCC)),
|
||||
child: new RenderParagraph(new TextSpan(style: style, text: 'foo foo foo'))
|
||||
));
|
||||
style = const TextStyle(fontSize: 10.0, color: const Color(0xFF000000));
|
||||
row.add(new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0x7FCCFFCC)),
|
||||
decoration: const BoxDecoration(color: const Color(0x7FCCFFCC)),
|
||||
child: new RenderParagraph(new TextSpan(style: style, text: 'foo foo foo'))
|
||||
));
|
||||
final RenderFlex subrow = new RenderFlex(crossAxisAlignment: crossAxisAlignment, textBaseline: TextBaseline.alphabetic);
|
||||
style = const TextStyle(fontSize: 25.0, color: const Color(0xFF000000));
|
||||
subrow.add(new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0x7FCCCCFF)),
|
||||
decoration: const BoxDecoration(color: const Color(0x7FCCCCFF)),
|
||||
child: new RenderParagraph(new TextSpan(style: style, text: 'foo foo foo foo'))
|
||||
));
|
||||
subrow.add(new RenderSolidColorBox(const Color(0x7FCCFFFF), desiredSize: const Size(30.0, 40.0)));
|
||||
@@ -67,7 +67,7 @@ void main() {
|
||||
addJustificationRow(MainAxisAlignment.spaceAround);
|
||||
|
||||
final RenderDecoratedBox root = new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
|
||||
decoration: const BoxDecoration(color: const Color(0xFFFFFFFF)),
|
||||
child: new RenderPadding(child: table, padding: const EdgeInsets.symmetric(vertical: 50.0))
|
||||
);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class NonStopVSync implements TickerProvider {
|
||||
void main() {
|
||||
// We first create a render object that represents a green box.
|
||||
final RenderBox green = new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xFF00FF00))
|
||||
decoration: const BoxDecoration(color: const Color(0xFF00FF00))
|
||||
);
|
||||
// Second, we wrap that green box in a render object that forces the green box
|
||||
// to have a specific size.
|
||||
|
||||
@@ -166,9 +166,9 @@ abstract class RenderDecoratedSector extends RenderSector {
|
||||
if (_decoration == null)
|
||||
return;
|
||||
|
||||
if (_decoration.backgroundColor != null) {
|
||||
if (_decoration.color != null) {
|
||||
final Canvas canvas = context.canvas;
|
||||
final Paint paint = new Paint()..color = _decoration.backgroundColor;
|
||||
final Paint paint = new Paint()..color = _decoration.color;
|
||||
final Path path = new Path();
|
||||
final double outerRadius = (parentData.radius + deltaRadius);
|
||||
final Rect outerBounds = new Rect.fromLTRB(offset.dx-outerRadius, offset.dy-outerRadius, offset.dx+outerRadius, offset.dy+outerRadius);
|
||||
@@ -558,7 +558,7 @@ class RenderSolidColor extends RenderDecoratedSector {
|
||||
RenderSolidColor(this.backgroundColor, {
|
||||
this.desiredDeltaRadius: double.INFINITY,
|
||||
this.desiredDeltaTheta: kTwoPi
|
||||
}) : super(new BoxDecoration(backgroundColor: backgroundColor));
|
||||
}) : super(new BoxDecoration(color: backgroundColor));
|
||||
|
||||
double desiredDeltaRadius;
|
||||
double desiredDeltaTheta;
|
||||
@@ -578,9 +578,9 @@ class RenderSolidColor extends RenderDecoratedSector {
|
||||
@override
|
||||
void handleEvent(PointerEvent event, HitTestEntry entry) {
|
||||
if (event is PointerDownEvent) {
|
||||
decoration = const BoxDecoration(backgroundColor: const Color(0xFFFF0000));
|
||||
decoration = const BoxDecoration(color: const Color(0xFFFF0000));
|
||||
} else if (event is PointerUpEvent) {
|
||||
decoration = new BoxDecoration(backgroundColor: backgroundColor);
|
||||
decoration = new BoxDecoration(color: backgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class RenderSolidColorBox extends RenderDecoratedBox {
|
||||
final Color backgroundColor;
|
||||
|
||||
RenderSolidColorBox(this.backgroundColor, { this.desiredSize: Size.infinite })
|
||||
: super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
|
||||
: super(decoration: new BoxDecoration(color: backgroundColor));
|
||||
|
||||
@override
|
||||
double computeMinIntrinsicWidth(double height) {
|
||||
@@ -40,9 +40,9 @@ class RenderSolidColorBox extends RenderDecoratedBox {
|
||||
@override
|
||||
void handleEvent(PointerEvent event, BoxHitTestEntry entry) {
|
||||
if (event is PointerDownEvent) {
|
||||
decoration = const BoxDecoration(backgroundColor: const Color(0xFFFF0000));
|
||||
decoration = const BoxDecoration(color: const Color(0xFFFF0000));
|
||||
} else if (event is PointerUpEvent) {
|
||||
decoration = new BoxDecoration(backgroundColor: backgroundColor);
|
||||
decoration = new BoxDecoration(color: backgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,9 +244,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
||||
child: new Container(
|
||||
width: 120.0,
|
||||
height: 120.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF882222)
|
||||
)
|
||||
color: const Color(0xFF882222),
|
||||
)
|
||||
),
|
||||
new Opacity(
|
||||
|
||||
@@ -17,9 +17,7 @@ class AdaptedListItem extends StatelessWidget {
|
||||
width: 32.0,
|
||||
height: 32.0,
|
||||
margin: const EdgeInsets.all(8.0),
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.lightBlueAccent.shade100
|
||||
)
|
||||
color: Colors.lightBlueAccent.shade100,
|
||||
),
|
||||
new Text(name)
|
||||
]
|
||||
@@ -39,9 +37,7 @@ class AdaptedGridItem extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
new Expanded(
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.lightBlueAccent.shade100
|
||||
)
|
||||
color: Colors.lightBlueAccent.shade100,
|
||||
)
|
||||
),
|
||||
new Container(
|
||||
|
||||
@@ -25,7 +25,7 @@ class Rectangle extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return new Expanded(
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(backgroundColor: color)
|
||||
color: color,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -37,9 +37,7 @@ class _SpinningSquareState extends State<SpinningSquare> with SingleTickerProvid
|
||||
child: new Container(
|
||||
width: 200.0,
|
||||
height: 200.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class _CupertinoButtonState extends State<CupertinoButton> with SingleTickerProv
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(const Radius.circular(8.0)),
|
||||
backgroundColor: backgroundColor != null && !enabled
|
||||
color: backgroundColor != null && !enabled
|
||||
? _kDisabledBackground
|
||||
: backgroundColor,
|
||||
),
|
||||
|
||||
@@ -40,7 +40,7 @@ const double _kCupertinoDialogWidth = 270.0;
|
||||
const BoxDecoration _kCupertinoDialogDecoration = const BoxDecoration(
|
||||
// TODO(abarth): Rather than being opaque, this decoration should actually be
|
||||
// partially transparent and have a subtle background blur effect.
|
||||
backgroundColor: const Color(0xFFF8F8F8),
|
||||
color: const Color(0xFFF8F8F8),
|
||||
borderRadius: const BorderRadius.all(const Radius.circular(15.0)),
|
||||
);
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class Chip extends StatelessWidget {
|
||||
height: _kChipHeight,
|
||||
padding: new EdgeInsets.only(left: leftPadding, right: rightPadding),
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.grey.shade300,
|
||||
color: Colors.grey.shade300,
|
||||
borderRadius: new BorderRadius.circular(16.0)
|
||||
),
|
||||
child: new Row(
|
||||
|
||||
@@ -94,8 +94,8 @@ class CircleAvatar extends StatelessWidget {
|
||||
height: radius * 2.0,
|
||||
duration: kThemeChangeDuration,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: backgroundColor ?? theme.primaryColor,
|
||||
backgroundImage: backgroundImage != null ? new BackgroundImage(
|
||||
color: backgroundColor ?? theme.primaryColor,
|
||||
image: backgroundImage != null ? new DecorationImage(
|
||||
image: backgroundImage
|
||||
) : null,
|
||||
shape: BoxShape.circle,
|
||||
|
||||
@@ -499,7 +499,7 @@ class DataTable extends StatelessWidget {
|
||||
final BoxDecoration _kSelectedDecoration = new BoxDecoration(
|
||||
border: new Border(bottom: new BorderSide(color: theme.dividerColor)),
|
||||
// The backgroundColor has to be transparent so you can see the ink on the material
|
||||
backgroundColor: (Theme.of(context).brightness == Brightness.light) ? _kGrey100Opacity : _kGrey300Opacity
|
||||
color: (Theme.of(context).brightness == Brightness.light) ? _kGrey100Opacity : _kGrey300Opacity
|
||||
);
|
||||
final BoxDecoration _kUnselectedDecoration = new BoxDecoration(
|
||||
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
|
||||
|
||||
@@ -253,7 +253,7 @@ class DayPicker extends StatelessWidget {
|
||||
// The selected day gets a circle background highlight, and a contrasting text color.
|
||||
itemStyle = themeData.accentTextTheme.body2;
|
||||
decoration = new BoxDecoration(
|
||||
backgroundColor: themeData.accentColor,
|
||||
color: themeData.accentColor,
|
||||
shape: BoxShape.circle
|
||||
);
|
||||
} else if (disabled) {
|
||||
|
||||
@@ -273,11 +273,8 @@ class DrawerControllerState extends State<DrawerController> with SingleTickerPro
|
||||
children: <Widget>[
|
||||
new GestureDetector(
|
||||
onTap: close,
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: _color.evaluate(_controller)
|
||||
),
|
||||
child: new Container(),
|
||||
child: new Container(
|
||||
color: _color.evaluate(_controller)
|
||||
),
|
||||
),
|
||||
new Align(
|
||||
|
||||
@@ -31,10 +31,10 @@ class _DropdownMenuPainter extends CustomPainter {
|
||||
this.selectedIndex,
|
||||
this.resize,
|
||||
}) : _painter = new BoxDecoration(
|
||||
// If you add a background image here, you must provide a real
|
||||
// If you add an image here, you must provide a real
|
||||
// configuration in the paint() function and you must provide some sort
|
||||
// of onChanged callback here.
|
||||
backgroundColor: color,
|
||||
color: color,
|
||||
borderRadius: new BorderRadius.circular(2.0),
|
||||
boxShadow: kElevationToShadow[elevation]
|
||||
).createBoxPainter(),
|
||||
|
||||
@@ -62,7 +62,7 @@ class GridTileBar extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
BoxDecoration decoration;
|
||||
if (backgroundColor != null)
|
||||
decoration = new BoxDecoration(backgroundColor: backgroundColor);
|
||||
decoration = new BoxDecoration(color: backgroundColor);
|
||||
|
||||
final List<Widget> children = <Widget>[];
|
||||
final EdgeInsets padding = new EdgeInsets.only(
|
||||
|
||||
@@ -287,7 +287,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
borderRadius: radius,
|
||||
backgroundColor: backgroundColor,
|
||||
color: backgroundColor,
|
||||
shape: widget.type == MaterialType.circle ? BoxShape.circle : BoxShape.rectangle
|
||||
),
|
||||
child: contents
|
||||
|
||||
@@ -517,7 +517,7 @@ class _MergeableMaterialState extends State<MergeableMaterial> with TickerProvid
|
||||
widgets.add(
|
||||
new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).cardColor,
|
||||
color: Theme.of(context).cardColor,
|
||||
borderRadius: _borderRadius(i - 1, widgets.isEmpty, false),
|
||||
shape: BoxShape.rectangle
|
||||
),
|
||||
@@ -588,7 +588,7 @@ class _MergeableMaterialState extends State<MergeableMaterial> with TickerProvid
|
||||
widgets.add(
|
||||
new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).cardColor,
|
||||
color: Theme.of(context).cardColor,
|
||||
borderRadius: _borderRadius(i - 1, widgets.isEmpty, true),
|
||||
shape: BoxShape.rectangle
|
||||
),
|
||||
|
||||
@@ -388,9 +388,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
|
||||
// TODO(ianh): This decoration will prevent ink splashes from being visible.
|
||||
// Instead, we should have a widget that prints the decoration on the material.
|
||||
// See https://github.com/flutter/flutter/issues/3782
|
||||
decoration: _selectedRowCount > 0 ? new BoxDecoration(
|
||||
backgroundColor: themeData.secondaryHeaderColor
|
||||
) : null,
|
||||
color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null,
|
||||
child: new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: headerWidgets
|
||||
|
||||
@@ -225,9 +225,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
|
||||
return new Container(
|
||||
width: visible ? 1.0 : 0.0,
|
||||
height: 16.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.grey.shade400,
|
||||
),
|
||||
color: Colors.grey.shade400,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -276,7 +274,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
|
||||
curve: Curves.fastOutSlowIn,
|
||||
duration: kThemeAnimationDuration,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: _circleColor(index),
|
||||
color: _circleColor(index),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: new Center(
|
||||
@@ -484,9 +482,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
|
||||
child: new SizedBox(
|
||||
width: _isLast(index) ? 0.0 : 1.0,
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.grey.shade400,
|
||||
),
|
||||
color: Colors.grey.shade400,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -585,9 +581,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
|
||||
child: new Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
height: 1.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.grey.shade400,
|
||||
),
|
||||
color: Colors.grey.shade400,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -325,8 +325,8 @@ class _RenderSwitch extends RenderToggleable {
|
||||
|
||||
BoxDecoration _createDefaultThumbDecoration(Color color, ImageProvider image) {
|
||||
return new BoxDecoration(
|
||||
backgroundColor: color,
|
||||
backgroundImage: image == null ? null : new BackgroundImage(image: image),
|
||||
color: color,
|
||||
image: image == null ? null : new DecorationImage(image: image),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: kElevationToShadow[1]
|
||||
);
|
||||
|
||||
@@ -930,9 +930,9 @@ class TabPageSelectorIndicator extends StatelessWidget {
|
||||
height: 12.0,
|
||||
margin: const EdgeInsets.all(4.0),
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: backgroundColor,
|
||||
color: backgroundColor,
|
||||
border: new Border.all(color: borderColor),
|
||||
shape: BoxShape.circle
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ class _TooltipOverlay extends StatelessWidget {
|
||||
opacity: 0.9,
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: darkTheme.backgroundColor,
|
||||
color: darkTheme.backgroundColor,
|
||||
borderRadius: new BorderRadius.circular(2.0)
|
||||
),
|
||||
height: height,
|
||||
|
||||
@@ -192,7 +192,7 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> with SingleTickerProv
|
||||
Widget buildList(BuildContext context, Widget child) {
|
||||
return new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: _backgroundColor.evaluate(_easeOutAnimation),
|
||||
color: _backgroundColor.evaluate(_easeOutAnimation),
|
||||
border: new Border(
|
||||
top: new BorderSide(color: _borderColor.evaluate(_easeOutAnimation)),
|
||||
bottom: new BorderSide(color: _borderColor.evaluate(_easeOutAnimation))
|
||||
|
||||
@@ -183,7 +183,7 @@ class _UserAccountsDrawerHeaderState extends State<UserAccountsDrawerHeader> {
|
||||
assert(debugCheckHasMaterial(context));
|
||||
return new DrawerHeader(
|
||||
decoration: widget.decoration ?? new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
margin: widget.margin,
|
||||
child: new Column(
|
||||
|
||||
@@ -964,16 +964,16 @@ void paintImage({
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
/// A background image for a box.
|
||||
/// An image for a box decoration.
|
||||
///
|
||||
/// The image is painted using [paintImage], which describes the meanings of the
|
||||
/// various fields on this class in more detail.
|
||||
@immutable
|
||||
class BackgroundImage {
|
||||
/// Creates a background image.
|
||||
class DecorationImage {
|
||||
/// Creates an image to show in a [BoxDecoration].
|
||||
///
|
||||
/// The [image] argument must not be null.
|
||||
const BackgroundImage({
|
||||
const DecorationImage({
|
||||
this.image,
|
||||
this.fit,
|
||||
this.repeat: ImageRepeat.noRepeat,
|
||||
@@ -982,16 +982,16 @@ class BackgroundImage {
|
||||
this.alignment,
|
||||
});
|
||||
|
||||
/// The image to be painted into the background.
|
||||
/// The image to be painted into the decoration.
|
||||
final ImageProvider image;
|
||||
|
||||
/// How the background image should be inscribed into the box.
|
||||
/// How the image should be inscribed into the box.
|
||||
///
|
||||
/// The default varies based on the other fields. See the discussion at
|
||||
/// [paintImage].
|
||||
final BoxFit fit;
|
||||
|
||||
/// How to paint any portions of the box not covered by the background image.
|
||||
/// How to paint any portions of the box not covered by the image.
|
||||
final ImageRepeat repeat;
|
||||
|
||||
/// The center slice for a nine-patch image.
|
||||
@@ -1003,7 +1003,7 @@ class BackgroundImage {
|
||||
/// the center slice will be stretched only vertically.
|
||||
final Rect centerSlice;
|
||||
|
||||
/// A color filter to apply to the background image before painting it.
|
||||
/// A color filter to apply to the image before painting it.
|
||||
final ColorFilter colorFilter;
|
||||
|
||||
/// How to align the image within its bounds.
|
||||
@@ -1019,9 +1019,9 @@ class BackgroundImage {
|
||||
bool operator ==(dynamic other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other is! BackgroundImage)
|
||||
if (runtimeType != other.runtimeType)
|
||||
return false;
|
||||
final BackgroundImage typedOther = other;
|
||||
final DecorationImage typedOther = other;
|
||||
return image == typedOther.image &&
|
||||
fit == typedOther.fit &&
|
||||
repeat == typedOther.repeat &&
|
||||
@@ -1034,19 +1034,19 @@ class BackgroundImage {
|
||||
int get hashCode => hashValues(image, fit, repeat, centerSlice, colorFilter, alignment);
|
||||
|
||||
@override
|
||||
String toString() => 'BackgroundImage($image, $fit, $repeat)';
|
||||
String toString() => '$runtimeType($image, $fit, $repeat)';
|
||||
}
|
||||
|
||||
/// An immutable description of how to paint a box.
|
||||
///
|
||||
/// The following example uses the [Container] widget from the widgets layer to
|
||||
/// draw a background image with a border:
|
||||
/// draw an image with a border:
|
||||
///
|
||||
/// ```dart
|
||||
/// new Container(
|
||||
/// decoration: new BoxDecoration(
|
||||
/// backgroundColor: const Color(0xff7c94b6),
|
||||
/// backgroundImage: new BackgroundImage(
|
||||
/// color: const Color(0xff7c94b6),
|
||||
/// image: new DecorationImage(
|
||||
/// image: new ExactAssetImage('images/flowers.jpeg'),
|
||||
/// fit: BoxFit.cover,
|
||||
/// ),
|
||||
@@ -1060,8 +1060,8 @@ class BackgroundImage {
|
||||
class BoxDecoration extends Decoration {
|
||||
/// Creates a box decoration.
|
||||
///
|
||||
/// * If [backgroundColor] is null, this decoration does not paint a background color.
|
||||
/// * If [backgroundImage] is null, this decoration does not paint a background image.
|
||||
/// * If [color] is null, this decoration does not paint a background color.
|
||||
/// * If [image] is null, this decoration does not paint a background image.
|
||||
/// * If [border] is null, this decoration does not paint a border.
|
||||
/// * If [borderRadius] is null, this decoration uses more efficient background
|
||||
/// painting commands. The [borderRadius] argument must be be null if [shape] is
|
||||
@@ -1069,8 +1069,8 @@ class BoxDecoration extends Decoration {
|
||||
/// * If [boxShadow] is null, this decoration does not paint a shadow.
|
||||
/// * If [gradient] is null, this decoration does not paint gradients.
|
||||
const BoxDecoration({
|
||||
this.backgroundColor,
|
||||
this.backgroundImage,
|
||||
this.color,
|
||||
this.image,
|
||||
this.border,
|
||||
this.borderRadius,
|
||||
this.boxShadow,
|
||||
@@ -1092,13 +1092,13 @@ class BoxDecoration extends Decoration {
|
||||
///
|
||||
/// The color is filled into the shape of the box (e.g., either a rectangle,
|
||||
/// potentially with a border radius, or a circle).
|
||||
final Color backgroundColor;
|
||||
final Color color;
|
||||
|
||||
/// An image to paint above the background color. If [shape] is [BoxShape.circle]
|
||||
/// then the image is clipped to the circle's boundary.
|
||||
final BackgroundImage backgroundImage;
|
||||
final DecorationImage image;
|
||||
|
||||
/// A border to draw above the background.
|
||||
/// A border to draw above the background [color] or [image].
|
||||
final Border border;
|
||||
|
||||
/// If non-null, the corners of this box are rounded by this [BorderRadius].
|
||||
@@ -1106,13 +1106,15 @@ class BoxDecoration extends Decoration {
|
||||
/// Applies only to boxes with rectangular shapes.
|
||||
final BorderRadius borderRadius;
|
||||
|
||||
/// A list of shadows cast by this box behind the background.
|
||||
/// A list of shadows cast by this box behind the box.
|
||||
///
|
||||
/// The shadow follows the [shape] of the box.
|
||||
final List<BoxShadow> boxShadow;
|
||||
|
||||
/// A gradient to use when filling the background.
|
||||
/// A gradient to use when filling the box.
|
||||
final Gradient gradient;
|
||||
|
||||
/// The shape to fill the background color into and to cast as a shadow.
|
||||
/// The shape to fill the background [color] into and to cast as the [boxShadow].
|
||||
final BoxShape shape;
|
||||
|
||||
/// The inset space occupied by the border.
|
||||
@@ -1123,8 +1125,8 @@ class BoxDecoration extends Decoration {
|
||||
BoxDecoration scale(double factor) {
|
||||
// TODO(abarth): Scale ALL the things.
|
||||
return new BoxDecoration(
|
||||
backgroundColor: Color.lerp(null, backgroundColor, factor),
|
||||
backgroundImage: backgroundImage,
|
||||
color: Color.lerp(null, color, factor),
|
||||
image: image,
|
||||
border: Border.lerp(null, border, factor),
|
||||
borderRadius: BorderRadius.lerp(null, borderRadius, factor),
|
||||
boxShadow: BoxShadow.lerpList(null, boxShadow, factor),
|
||||
@@ -1150,8 +1152,8 @@ class BoxDecoration extends Decoration {
|
||||
return a.scale(1.0 - t);
|
||||
// TODO(abarth): lerp ALL the fields.
|
||||
return new BoxDecoration(
|
||||
backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t),
|
||||
backgroundImage: b.backgroundImage,
|
||||
color: Color.lerp(a.color, b.color, t),
|
||||
image: b.image,
|
||||
border: Border.lerp(a.border, b.border, t),
|
||||
borderRadius: BorderRadius.lerp(a.borderRadius, b.borderRadius, t),
|
||||
boxShadow: BoxShadow.lerpList(a.boxShadow, b.boxShadow, t),
|
||||
@@ -1178,11 +1180,11 @@ class BoxDecoration extends Decoration {
|
||||
bool operator ==(dynamic other) {
|
||||
if (identical(this, other))
|
||||
return true;
|
||||
if (other is! BoxDecoration)
|
||||
if (runtimeType != other.runtimeType)
|
||||
return false;
|
||||
final BoxDecoration typedOther = other;
|
||||
return backgroundColor == typedOther.backgroundColor &&
|
||||
backgroundImage == typedOther.backgroundImage &&
|
||||
return color == typedOther.color &&
|
||||
image == typedOther.image &&
|
||||
border == typedOther.border &&
|
||||
borderRadius == typedOther.borderRadius &&
|
||||
boxShadow == typedOther.boxShadow &&
|
||||
@@ -1193,8 +1195,8 @@ class BoxDecoration extends Decoration {
|
||||
@override
|
||||
int get hashCode {
|
||||
return hashValues(
|
||||
backgroundColor,
|
||||
backgroundImage,
|
||||
color,
|
||||
image,
|
||||
border,
|
||||
borderRadius,
|
||||
boxShadow,
|
||||
@@ -1209,10 +1211,10 @@ class BoxDecoration extends Decoration {
|
||||
@override
|
||||
String toString([String prefix = '', String indentPrefix]) {
|
||||
final List<String> result = <String>[];
|
||||
if (backgroundColor != null)
|
||||
result.add('${prefix}backgroundColor: $backgroundColor');
|
||||
if (backgroundImage != null)
|
||||
result.add('${prefix}backgroundImage: $backgroundImage');
|
||||
if (color != null)
|
||||
result.add('${prefix}color: $color');
|
||||
if (image != null)
|
||||
result.add('${prefix}image: $image');
|
||||
if (border != null)
|
||||
result.add('${prefix}border: $border');
|
||||
if (borderRadius != null)
|
||||
@@ -1260,7 +1262,7 @@ class BoxDecoration extends Decoration {
|
||||
|
||||
@override
|
||||
_BoxDecorationPainter createBoxPainter([VoidCallback onChanged]) {
|
||||
assert(onChanged != null || backgroundImage == null);
|
||||
assert(onChanged != null || image == null);
|
||||
return new _BoxDecorationPainter(this, onChanged);
|
||||
}
|
||||
}
|
||||
@@ -1282,8 +1284,8 @@ class _BoxDecorationPainter extends BoxPainter {
|
||||
(_decoration.gradient != null && _rectForCachedBackgroundPaint != rect)) {
|
||||
final Paint paint = new Paint();
|
||||
|
||||
if (_decoration.backgroundColor != null)
|
||||
paint.color = _decoration.backgroundColor;
|
||||
if (_decoration.color != null)
|
||||
paint.color = _decoration.color;
|
||||
|
||||
if (_decoration.gradient != null) {
|
||||
paint.shader = _decoration.gradient.createShader(rect);
|
||||
@@ -1329,7 +1331,7 @@ class _BoxDecorationPainter extends BoxPainter {
|
||||
}
|
||||
|
||||
void _paintBackgroundColor(Canvas canvas, Rect rect) {
|
||||
if (_decoration.backgroundColor != null || _decoration.gradient != null)
|
||||
if (_decoration.color != null || _decoration.gradient != null)
|
||||
_paintBox(canvas, rect, _getBackgroundPaint(rect));
|
||||
}
|
||||
|
||||
@@ -1337,7 +1339,7 @@ class _BoxDecorationPainter extends BoxPainter {
|
||||
ImageInfo _image;
|
||||
|
||||
void _paintBackgroundImage(Canvas canvas, Rect rect, ImageConfiguration configuration) {
|
||||
final BackgroundImage backgroundImage = _decoration.backgroundImage;
|
||||
final DecorationImage backgroundImage = _decoration.image;
|
||||
if (backgroundImage == null)
|
||||
return;
|
||||
final ImageStream newImageStream = backgroundImage.image.resolve(configuration);
|
||||
|
||||
@@ -122,7 +122,7 @@ class Container extends StatelessWidget {
|
||||
this.margin,
|
||||
this.transform,
|
||||
this.child,
|
||||
}) : decoration = decoration ?? (color != null ? new BoxDecoration(backgroundColor: color) : null),
|
||||
}) : decoration = decoration ?? (color != null ? new BoxDecoration(color: color) : null),
|
||||
constraints =
|
||||
(width != null || height != null)
|
||||
? constraints?.tighten(width: width, height: height)
|
||||
@@ -161,6 +161,10 @@ class Container extends StatelessWidget {
|
||||
final EdgeInsets padding;
|
||||
|
||||
/// The decoration to paint behind the [child].
|
||||
///
|
||||
/// A shorthand for specifying just a solid color is available in the
|
||||
/// constructor: set the `color` argument instead of the `decoration`
|
||||
/// argument.
|
||||
final Decoration decoration;
|
||||
|
||||
/// The decoration to paint in front of the [child].
|
||||
@@ -234,18 +238,18 @@ class Container extends StatelessWidget {
|
||||
@override
|
||||
void debugFillDescription(List<String> description) {
|
||||
super.debugFillDescription(description);
|
||||
if (constraints != null)
|
||||
description.add('$constraints');
|
||||
if (alignment != null)
|
||||
description.add('$alignment');
|
||||
if (padding != null)
|
||||
description.add('padding: $padding');
|
||||
if (decoration != null)
|
||||
description.add('bg: $decoration');
|
||||
if (foregroundDecoration != null)
|
||||
description.add('fg: $foregroundDecoration');
|
||||
if (constraints != null)
|
||||
description.add('$constraints');
|
||||
if (margin != null)
|
||||
description.add('margin: $margin');
|
||||
if (padding != null)
|
||||
description.add('padding: $padding');
|
||||
if (transform != null)
|
||||
description.add('has transform');
|
||||
}
|
||||
|
||||
@@ -241,134 +241,155 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
|
||||
/// The [curve] and [duration] arguments must not be null.
|
||||
AnimatedContainer({
|
||||
Key key,
|
||||
this.child,
|
||||
this.constraints,
|
||||
this.decoration,
|
||||
this.foregroundDecoration,
|
||||
this.margin,
|
||||
this.alignment,
|
||||
this.padding,
|
||||
Color color,
|
||||
Decoration decoration,
|
||||
this.foregroundDecoration,
|
||||
double width,
|
||||
double height,
|
||||
BoxConstraints constraints,
|
||||
this.margin,
|
||||
this.transform,
|
||||
this.width,
|
||||
this.height,
|
||||
this.child,
|
||||
Curve curve: Curves.linear,
|
||||
@required Duration duration,
|
||||
}) : super(key: key, curve: curve, duration: duration) {
|
||||
assert(decoration == null || decoration.debugAssertIsValid());
|
||||
assert(foregroundDecoration == null || foregroundDecoration.debugAssertIsValid());
|
||||
}) : decoration = decoration ?? (color != null ? new BoxDecoration(color: color) : null),
|
||||
constraints =
|
||||
(width != null || height != null)
|
||||
? constraints?.tighten(width: width, height: height)
|
||||
?? new BoxConstraints.tightFor(width: width, height: height)
|
||||
: constraints,
|
||||
super(key: key, curve: curve, duration: duration) {
|
||||
assert(margin == null || margin.isNonNegative);
|
||||
assert(padding == null || padding.isNonNegative);
|
||||
assert(decoration == null || decoration.debugAssertIsValid());
|
||||
assert(constraints == null || constraints.debugAssertIsValid());
|
||||
assert(color == null || decoration == null,
|
||||
'Cannot provide both a color and a decoration\n'
|
||||
'The color argument is just a shorthand for "decoration: new BoxDecoration(backgroundColor: color)".'
|
||||
);
|
||||
}
|
||||
|
||||
/// The widget below this widget in the tree.
|
||||
/// The [child] contained by the container.
|
||||
///
|
||||
/// If null, and if the [constraints] are unbounded or also null, the
|
||||
/// container will expand to fill all available space in its parent, unless
|
||||
/// the parent provides unbounded constraints, in which case the container
|
||||
/// will attempt to be as small as possible.
|
||||
final Widget child;
|
||||
|
||||
/// Additional constraints to apply to the child.
|
||||
final BoxConstraints constraints;
|
||||
/// Align the [child] within the container.
|
||||
///
|
||||
/// If non-null, the container will expand to fill its parent and position its
|
||||
/// child within itself according to the given value. If the incoming
|
||||
/// constraints are unbounded, then the child will be shrink-wrapped instead.
|
||||
///
|
||||
/// Ignored if [child] is null.
|
||||
final FractionalOffset alignment;
|
||||
|
||||
/// The decoration to paint behind the child.
|
||||
/// Empty space to inscribe inside the [decoration]. The [child], if any, is
|
||||
/// placed inside this padding.
|
||||
final EdgeInsets padding;
|
||||
|
||||
/// The decoration to paint behind the [child].
|
||||
///
|
||||
/// A shorthand for specifying just a solid color is available in the
|
||||
/// constructor: set the `color` argument instead of the `decoration`
|
||||
/// argument.
|
||||
final Decoration decoration;
|
||||
|
||||
/// The decoration to paint in front of the child.
|
||||
final Decoration foregroundDecoration;
|
||||
|
||||
/// Empty space to surround the decoration.
|
||||
final EdgeInsets margin;
|
||||
/// Additional constraints to apply to the child.
|
||||
///
|
||||
/// The constructor `width` and `height` arguments are combined with the
|
||||
/// `constraints` argument to set this property.
|
||||
///
|
||||
/// The [padding] goes inside the constraints.
|
||||
final BoxConstraints constraints;
|
||||
|
||||
/// Empty space to inscribe inside the decoration.
|
||||
final EdgeInsets padding;
|
||||
/// Empty space to surround the [decoration] and [child].
|
||||
final EdgeInsets margin;
|
||||
|
||||
/// The transformation matrix to apply before painting the container.
|
||||
final Matrix4 transform;
|
||||
|
||||
/// If non-null, requires the decoration to have this width.
|
||||
final double width;
|
||||
|
||||
/// If non-null, requires the decoration to have this height.
|
||||
final double height;
|
||||
|
||||
@override
|
||||
_AnimatedContainerState createState() => new _AnimatedContainerState();
|
||||
|
||||
@override
|
||||
void debugFillDescription(List<String> description) {
|
||||
super.debugFillDescription(description);
|
||||
if (constraints != null)
|
||||
description.add('$constraints');
|
||||
if (decoration != null)
|
||||
description.add('has background');
|
||||
if (foregroundDecoration != null)
|
||||
description.add('has foreground');
|
||||
if (margin != null)
|
||||
description.add('margin: $margin');
|
||||
if (alignment != null)
|
||||
description.add('$alignment');
|
||||
if (padding != null)
|
||||
description.add('padding: $padding');
|
||||
if (decoration != null)
|
||||
description.add('bg: $decoration');
|
||||
if (foregroundDecoration != null)
|
||||
description.add('fg: $foregroundDecoration');
|
||||
if (constraints != null)
|
||||
description.add('$constraints');
|
||||
if (margin != null)
|
||||
description.add('margin: $margin');
|
||||
if (transform != null)
|
||||
description.add('has transform');
|
||||
if (width != null)
|
||||
description.add('width: $width');
|
||||
if (height != null)
|
||||
description.add('height: $height');
|
||||
}
|
||||
}
|
||||
|
||||
class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer> {
|
||||
BoxConstraintsTween _constraints;
|
||||
FractionalOffsetTween _alignment;
|
||||
EdgeInsetsTween _padding;
|
||||
DecorationTween _decoration;
|
||||
DecorationTween _foregroundDecoration;
|
||||
BoxConstraintsTween _constraints;
|
||||
EdgeInsetsTween _margin;
|
||||
EdgeInsetsTween _padding;
|
||||
Matrix4Tween _transform;
|
||||
Tween<double> _width;
|
||||
Tween<double> _height;
|
||||
|
||||
@override
|
||||
void forEachTween(TweenVisitor<dynamic> visitor) {
|
||||
// TODO(ianh): Use constructor tear-offs when it becomes possible
|
||||
_constraints = visitor(_constraints, widget.constraints, (dynamic value) => new BoxConstraintsTween(begin: value));
|
||||
_alignment = visitor(_alignment, widget.alignment, (dynamic value) => new FractionalOffsetTween(begin: value));
|
||||
_padding = visitor(_padding, widget.padding, (dynamic value) => new EdgeInsetsTween(begin: value));
|
||||
_decoration = visitor(_decoration, widget.decoration, (dynamic value) => new DecorationTween(begin: value));
|
||||
_foregroundDecoration = visitor(_foregroundDecoration, widget.foregroundDecoration, (dynamic value) => new DecorationTween(begin: value));
|
||||
_constraints = visitor(_constraints, widget.constraints, (dynamic value) => new BoxConstraintsTween(begin: value));
|
||||
_margin = visitor(_margin, widget.margin, (dynamic value) => new EdgeInsetsTween(begin: value));
|
||||
_padding = visitor(_padding, widget.padding, (dynamic value) => new EdgeInsetsTween(begin: value));
|
||||
_transform = visitor(_transform, widget.transform, (dynamic value) => new Matrix4Tween(begin: value));
|
||||
_width = visitor(_width, widget.width, (dynamic value) => new Tween<double>(begin: value));
|
||||
_height = visitor(_height, widget.height, (dynamic value) => new Tween<double>(begin: value));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Container(
|
||||
child: widget.child,
|
||||
constraints: _constraints?.evaluate(animation),
|
||||
alignment: _alignment?.evaluate(animation),
|
||||
padding: _padding?.evaluate(animation),
|
||||
decoration: _decoration?.evaluate(animation),
|
||||
foregroundDecoration: _foregroundDecoration?.evaluate(animation),
|
||||
constraints: _constraints?.evaluate(animation),
|
||||
margin: _margin?.evaluate(animation),
|
||||
padding: _padding?.evaluate(animation),
|
||||
transform: _transform?.evaluate(animation),
|
||||
width: _width?.evaluate(animation),
|
||||
height: _height?.evaluate(animation)
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void debugFillDescription(List<String> description) {
|
||||
super.debugFillDescription(description);
|
||||
if (_constraints != null)
|
||||
description.add('has constraints');
|
||||
if (_decoration != null)
|
||||
description.add('has background');
|
||||
if (_foregroundDecoration != null)
|
||||
description.add('has foreground');
|
||||
if (_margin != null)
|
||||
description.add('has margin');
|
||||
if (_alignment != null)
|
||||
description.add('$_alignment');
|
||||
if (_padding != null)
|
||||
description.add('has padding');
|
||||
description.add('padding: $_padding');
|
||||
if (_decoration != null)
|
||||
description.add('bg: $_decoration');
|
||||
if (_foregroundDecoration != null)
|
||||
description.add('fg: $_foregroundDecoration');
|
||||
if (_constraints != null)
|
||||
description.add('$_constraints');
|
||||
if (_margin != null)
|
||||
description.add('margin: $_margin');
|
||||
if (_transform != null)
|
||||
description.add('has transform');
|
||||
if (_width != null)
|
||||
description.add('has width');
|
||||
if (_height != null)
|
||||
description.add('has height');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +496,6 @@ class _AnimatedPositionedState extends AnimatedWidgetBaseState<AnimatedPositione
|
||||
|
||||
@override
|
||||
void forEachTween(TweenVisitor<dynamic> visitor) {
|
||||
// TODO(ianh): Use constructor tear-offs when it becomes possible
|
||||
_left = visitor(_left, widget.left, (dynamic value) => new Tween<double>(begin: value));
|
||||
_top = visitor(_top, widget.top, (dynamic value) => new Tween<double>(begin: value));
|
||||
_right = visitor(_right, widget.right, (dynamic value) => new Tween<double>(begin: value));
|
||||
@@ -559,7 +579,6 @@ class _AnimatedOpacityState extends AnimatedWidgetBaseState<AnimatedOpacity> {
|
||||
|
||||
@override
|
||||
void forEachTween(TweenVisitor<dynamic> visitor) {
|
||||
// TODO(ianh): Use constructor tear-offs when it becomes possible
|
||||
_opacity = visitor(_opacity, widget.opacity, (dynamic value) => new Tween<double>(begin: value));
|
||||
}
|
||||
|
||||
@@ -613,7 +632,6 @@ class _AnimatedDefaultTextStyleState extends AnimatedWidgetBaseState<AnimatedDef
|
||||
|
||||
@override
|
||||
void forEachTween(TweenVisitor<dynamic> visitor) {
|
||||
// TODO(ianh): Use constructor tear-offs when it becomes possible
|
||||
_style = visitor(_style, widget.style, (dynamic value) => new TextStyleTween(begin: value));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class ModalBarrier extends StatelessWidget {
|
||||
constraints: const BoxConstraints.expand(),
|
||||
child: color == null ? null : new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: color
|
||||
color: color
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ void main() {
|
||||
expect(box.size.height, equals(100.0));
|
||||
final RenderDecoratedBox child = box.child;
|
||||
final BoxDecoration decoration = child.decoration;
|
||||
expect(decoration.backgroundColor, equals(backgroundColor));
|
||||
expect(decoration.color, equals(backgroundColor));
|
||||
|
||||
final RenderParagraph paragraph = tester.renderObject(find.text('Z'));
|
||||
expect(paragraph.text.style.color, equals(Colors.white));
|
||||
@@ -48,7 +48,7 @@ void main() {
|
||||
expect(box.size.height, equals(40.0));
|
||||
final RenderDecoratedBox child = box.child;
|
||||
final BoxDecoration decoration = child.decoration;
|
||||
expect(decoration.backgroundColor, equals(fallback.primaryColor));
|
||||
expect(decoration.color, equals(fallback.primaryColor));
|
||||
|
||||
final RenderParagraph paragraph = tester.renderObject(find.text('Z'));
|
||||
expect(paragraph.text.style.color, equals(foregroundColor));
|
||||
@@ -73,7 +73,7 @@ void main() {
|
||||
final RenderConstrainedBox box = tester.renderObject(find.byType(CircleAvatar));
|
||||
final RenderDecoratedBox child = box.child;
|
||||
final BoxDecoration decoration = child.decoration;
|
||||
expect(decoration.backgroundColor, equals(theme.primaryColor));
|
||||
expect(decoration.color, equals(theme.primaryColor));
|
||||
|
||||
final RenderParagraph paragraph = tester.renderObject(find.text('Z'));
|
||||
expect(paragraph.text.style.color, equals(theme.primaryTextTheme.title.color));
|
||||
|
||||
@@ -24,9 +24,7 @@ void main() {
|
||||
content: new Container(
|
||||
height: 5000.0,
|
||||
width: 300.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.green[500]
|
||||
)
|
||||
color: Colors.green[500],
|
||||
),
|
||||
actions: <Widget>[
|
||||
new FlatButton(
|
||||
|
||||
@@ -20,7 +20,7 @@ void main() {
|
||||
),
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.green[500],
|
||||
color: Colors.green[500],
|
||||
),
|
||||
),
|
||||
footer: new GridTileBar(
|
||||
|
||||
@@ -80,9 +80,7 @@ void main() {
|
||||
children: <Widget>[
|
||||
new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -269,9 +269,7 @@ void main() {
|
||||
home: new Scaffold(
|
||||
body: new SingleChildScrollView(
|
||||
child: new Container(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.amber[500],
|
||||
),
|
||||
color: Colors.amber[500],
|
||||
height: 5000.0,
|
||||
child: const Text('body'),
|
||||
),
|
||||
|
||||
@@ -406,9 +406,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.green[500]
|
||||
)
|
||||
color: Colors.green[500],
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -483,9 +481,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.green[500]
|
||||
)
|
||||
color: Colors.green[500],
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -52,12 +52,12 @@ class AsyncTestImageProvider extends ImageProvider<int> {
|
||||
}
|
||||
}
|
||||
|
||||
class BackgroundImageProvider extends ImageProvider<BackgroundImageProvider> {
|
||||
class DelayedImageProvider extends ImageProvider<DelayedImageProvider> {
|
||||
final Completer<ImageInfo> _completer = new Completer<ImageInfo>();
|
||||
|
||||
@override
|
||||
Future<BackgroundImageProvider> obtainKey(ImageConfiguration configuration) {
|
||||
return new SynchronousFuture<BackgroundImageProvider>(this);
|
||||
Future<DelayedImageProvider> obtainKey(ImageConfiguration configuration) {
|
||||
return new SynchronousFuture<DelayedImageProvider>(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -66,7 +66,7 @@ class BackgroundImageProvider extends ImageProvider<BackgroundImageProvider> {
|
||||
}
|
||||
|
||||
@override
|
||||
ImageStreamCompleter load(BackgroundImageProvider key) {
|
||||
ImageStreamCompleter load(DelayedImageProvider key) {
|
||||
return new OneFrameImageStreamCompleter(_completer.future);
|
||||
}
|
||||
|
||||
@@ -91,24 +91,24 @@ class TestImage extends ui.Image {
|
||||
|
||||
void main() {
|
||||
test("Decoration.lerp()", () {
|
||||
final BoxDecoration a = const BoxDecoration(backgroundColor: const Color(0xFFFFFFFF));
|
||||
final BoxDecoration b = const BoxDecoration(backgroundColor: const Color(0x00000000));
|
||||
final BoxDecoration a = const BoxDecoration(color: const Color(0xFFFFFFFF));
|
||||
final BoxDecoration b = const BoxDecoration(color: const Color(0x00000000));
|
||||
|
||||
BoxDecoration c = Decoration.lerp(a, b, 0.0);
|
||||
expect(c.backgroundColor, equals(a.backgroundColor));
|
||||
expect(c.color, equals(a.color));
|
||||
|
||||
c = Decoration.lerp(a, b, 0.25);
|
||||
expect(c.backgroundColor, equals(Color.lerp(const Color(0xFFFFFFFF), const Color(0x00000000), 0.25)));
|
||||
expect(c.color, equals(Color.lerp(const Color(0xFFFFFFFF), const Color(0x00000000), 0.25)));
|
||||
|
||||
c = Decoration.lerp(a, b, 1.0);
|
||||
expect(c.backgroundColor, equals(b.backgroundColor));
|
||||
expect(c.color, equals(b.color));
|
||||
});
|
||||
|
||||
test("BoxDecorationImageListenerSync", () {
|
||||
final ImageProvider imageProvider = new SynchronousTestImageProvider();
|
||||
final BackgroundImage backgroundImage = new BackgroundImage(image: imageProvider);
|
||||
final DecorationImage backgroundImage = new DecorationImage(image: imageProvider);
|
||||
|
||||
final BoxDecoration boxDecoration = new BoxDecoration(backgroundImage: backgroundImage);
|
||||
final BoxDecoration boxDecoration = new BoxDecoration(image: backgroundImage);
|
||||
bool onChangedCalled = false;
|
||||
final BoxPainter boxPainter = boxDecoration.createBoxPainter(() {
|
||||
onChangedCalled = true;
|
||||
@@ -125,9 +125,9 @@ void main() {
|
||||
test("BoxDecorationImageListenerAsync", () {
|
||||
new FakeAsync().run((FakeAsync async) {
|
||||
final ImageProvider imageProvider = new AsyncTestImageProvider();
|
||||
final BackgroundImage backgroundImage = new BackgroundImage(image: imageProvider);
|
||||
final DecorationImage backgroundImage = new DecorationImage(image: imageProvider);
|
||||
|
||||
final BoxDecoration boxDecoration = new BoxDecoration(backgroundImage: backgroundImage);
|
||||
final BoxDecoration boxDecoration = new BoxDecoration(image: backgroundImage);
|
||||
bool onChangedCalled = false;
|
||||
final BoxPainter boxPainter = boxDecoration.createBoxPainter(() {
|
||||
onChangedCalled = true;
|
||||
@@ -149,13 +149,13 @@ void main() {
|
||||
test("BoxDecoration backgroundImage clip", () {
|
||||
void testDecoration({ BoxShape shape, BorderRadius borderRadius, bool expectClip}) {
|
||||
new FakeAsync().run((FakeAsync async) {
|
||||
final BackgroundImageProvider imageProvider = new BackgroundImageProvider();
|
||||
final BackgroundImage backgroundImage = new BackgroundImage(image: imageProvider);
|
||||
final DelayedImageProvider imageProvider = new DelayedImageProvider();
|
||||
final DecorationImage backgroundImage = new DecorationImage(image: imageProvider);
|
||||
|
||||
final BoxDecoration boxDecoration = new BoxDecoration(
|
||||
shape: shape,
|
||||
borderRadius: borderRadius,
|
||||
backgroundImage: backgroundImage,
|
||||
image: backgroundImage,
|
||||
);
|
||||
|
||||
final List<Invocation> invocations = <Invocation>[];
|
||||
@@ -168,7 +168,7 @@ void main() {
|
||||
onChangedCalled = true;
|
||||
});
|
||||
|
||||
// _BoxDecorationPainter._paintBackgroundImage() resolves the background
|
||||
// _BoxDecorationPainter._paintDecorationImage() resolves the background
|
||||
// image and adds a listener to the resolved image stream.
|
||||
boxPainter.paint(canvas, Offset.zero, imageConfiguration);
|
||||
imageProvider.complete();
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
test("should size to render view", () {
|
||||
final RenderBox root = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
color: const Color(0xFF00FF00),
|
||||
gradient: new RadialGradient(
|
||||
center: FractionalOffset.topLeft, radius: 1.8,
|
||||
colors: <Color>[Colors.yellow[500], Colors.blue[500]],
|
||||
@@ -31,7 +31,7 @@ void main() {
|
||||
);
|
||||
final RenderBox inner = new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
child: size,
|
||||
);
|
||||
@@ -46,7 +46,7 @@ void main() {
|
||||
);
|
||||
final RenderBox outer = new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
color: const Color(0xFF0000FF),
|
||||
),
|
||||
child: flex,
|
||||
);
|
||||
|
||||
@@ -15,15 +15,15 @@ void main() {
|
||||
|
||||
final RenderBox red = new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFF0000)
|
||||
color: const Color(0xFFFF0000),
|
||||
),
|
||||
child: size
|
||||
);
|
||||
|
||||
final RenderBox green = new RenderDecoratedBox(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFF0000)
|
||||
)
|
||||
color: const Color(0xFFFF0000),
|
||||
),
|
||||
);
|
||||
|
||||
final RenderBox stack = new RenderStack(children: <RenderBox>[red, green]);
|
||||
|
||||
@@ -10,8 +10,8 @@ void main() {
|
||||
testWidgets('AnimatedContainer.debugFillDescription', (WidgetTester tester) async {
|
||||
final AnimatedContainer container = new AnimatedContainer(
|
||||
constraints: const BoxConstraints.tightFor(width: 17.0, height: 23.0),
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xFF00FF00)),
|
||||
foregroundDecoration: const BoxDecoration(backgroundColor: const Color(0x7F0000FF)),
|
||||
decoration: const BoxDecoration(color: const Color(0xFF00FF00)),
|
||||
foregroundDecoration: const BoxDecoration(color: const Color(0x7F0000FF)),
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
padding: const EdgeInsets.all(7.0),
|
||||
transform: new Matrix4.translationValues(4.0, 3.0, 0.0),
|
||||
@@ -28,11 +28,11 @@ void main() {
|
||||
final GlobalKey key = new GlobalKey();
|
||||
|
||||
final BoxDecoration decorationA = const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
color: const Color(0xFF00FF00),
|
||||
);
|
||||
|
||||
final BoxDecoration decorationB = const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
color: const Color(0xFF0000FF),
|
||||
);
|
||||
|
||||
BoxDecoration actualDecoration;
|
||||
@@ -47,7 +47,7 @@ void main() {
|
||||
|
||||
final RenderDecoratedBox box = key.currentContext.findRenderObject();
|
||||
actualDecoration = box.decoration;
|
||||
expect(actualDecoration.backgroundColor, equals(decorationA.backgroundColor));
|
||||
expect(actualDecoration.color, equals(decorationA.color));
|
||||
|
||||
await tester.pumpWidget(
|
||||
new AnimatedContainer(
|
||||
@@ -59,21 +59,19 @@ void main() {
|
||||
|
||||
expect(key.currentContext.findRenderObject(), equals(box));
|
||||
actualDecoration = box.decoration;
|
||||
expect(actualDecoration.backgroundColor, equals(decorationA.backgroundColor));
|
||||
expect(actualDecoration.color, equals(decorationA.color));
|
||||
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
|
||||
actualDecoration = box.decoration;
|
||||
expect(actualDecoration.backgroundColor, equals(decorationB.backgroundColor));
|
||||
expect(actualDecoration.color, equals(decorationB.color));
|
||||
});
|
||||
|
||||
testWidgets('AnimatedContainer overanimate test', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
new AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
);
|
||||
expect(tester.binding.transientCallbackCount, 0);
|
||||
@@ -82,9 +80,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
new AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
);
|
||||
expect(tester.binding.transientCallbackCount, 0);
|
||||
@@ -93,9 +89,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
new AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
)
|
||||
color: const Color(0xFF0000FF),
|
||||
)
|
||||
);
|
||||
expect(tester.binding.transientCallbackCount, 1); // this is the only time an animation should have started!
|
||||
@@ -104,9 +98,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
new AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
)
|
||||
color: const Color(0xFF0000FF),
|
||||
)
|
||||
);
|
||||
expect(tester.binding.transientCallbackCount, 0);
|
||||
|
||||
@@ -16,7 +16,7 @@ void main() {
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: new Border.all(width: 10.0, color: const Color(0x80FF00FF)),
|
||||
backgroundColor: Colors.teal[600]
|
||||
color: Colors.teal[600]
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -12,8 +12,9 @@ void main() {
|
||||
final Container container = new Container(
|
||||
alignment: FractionalOffset.bottomRight,
|
||||
padding: const EdgeInsets.all(7.0),
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xFF00FF00)),
|
||||
foregroundDecoration: const BoxDecoration(backgroundColor: const Color(0x7F0000FF)),
|
||||
// uses color, not decoration:
|
||||
color: const Color(0xFF00FF00),
|
||||
foregroundDecoration: const BoxDecoration(color: const Color(0x7F0000FF)),
|
||||
width: 53.0,
|
||||
height: 76.0,
|
||||
constraints: const BoxConstraints(
|
||||
@@ -27,7 +28,8 @@ void main() {
|
||||
width: 25.0,
|
||||
height: 33.0,
|
||||
child: const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xFFFFFF00)),
|
||||
// uses decoration, not color:
|
||||
decoration: const BoxDecoration(color: const Color(0xFFFFFF00)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -993,16 +993,12 @@ void main() {
|
||||
},
|
||||
child: new Draggable<dynamic>(
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
)
|
||||
color: const Color(0xFFFFFF00),
|
||||
),
|
||||
feedback: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFF0000)
|
||||
)
|
||||
color: const Color(0xFFFF0000),
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1028,16 +1024,12 @@ void main() {
|
||||
onTap: () { /* registers a tap recognizer */ },
|
||||
child: new Draggable<dynamic>(
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
)
|
||||
color: const Color(0xFFFFFF00),
|
||||
),
|
||||
feedback: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFF0000)
|
||||
)
|
||||
color: const Color(0xFFFF0000),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -83,9 +83,7 @@ void main() {
|
||||
const Text('drawer'),
|
||||
new Container(
|
||||
height: 1000.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.blue[500]
|
||||
)
|
||||
color: Colors.blue[500],
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
@@ -192,9 +192,7 @@ void main() {
|
||||
key: const ValueKey<int>(0),
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
),
|
||||
color: const Color(0xFFFFFFFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -444,9 +442,7 @@ void main() {
|
||||
key: const ValueKey<int>(0),
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
),
|
||||
color: const Color(0xFFFFFFFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -12,9 +12,7 @@ void main() {
|
||||
bool didReceiveTap = false;
|
||||
await tester.pumpWidget(
|
||||
new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
child: new Stack(
|
||||
children: <Widget>[
|
||||
new Positioned(
|
||||
@@ -27,8 +25,7 @@ void main() {
|
||||
didReceiveTap = true;
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)),
|
||||
color: const Color(0xFF0000FF),
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
child: const Center(
|
||||
|
||||
@@ -43,9 +43,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text('$i')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -22,9 +22,7 @@ void main() {
|
||||
didEndDrag = true;
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -69,9 +67,7 @@ void main() {
|
||||
onHorizontalDragUpdate: (DragUpdateDetails details) { fail("gesture should not match"); },
|
||||
onHorizontalDragEnd: (DragEndDetails details) { fail("gesture should not match"); },
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
);
|
||||
await tester.pumpWidget(widget);
|
||||
@@ -107,9 +103,7 @@ void main() {
|
||||
didEndPan = true;
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -141,9 +135,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
),
|
||||
new Container(
|
||||
|
||||
@@ -27,9 +27,7 @@ void main() {
|
||||
log.add(state);
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text(state),
|
||||
),
|
||||
);
|
||||
@@ -95,9 +93,7 @@ void main() {
|
||||
log.add(state);
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text(state),
|
||||
),
|
||||
);
|
||||
@@ -310,7 +306,7 @@ void main() {
|
||||
|
||||
final Container container = new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: green,
|
||||
color: green,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ void main() {
|
||||
|
||||
testWidgets('DecorationTween control test', (WidgetTester tester) async {
|
||||
final DecorationTween tween = new DecorationTween(
|
||||
begin: const BoxDecoration(backgroundColor: const Color(0xFF00FF00)),
|
||||
end: const BoxDecoration(backgroundColor: const Color(0xFFFFFF00))
|
||||
begin: const BoxDecoration(color: const Color(0xFF00FF00)),
|
||||
end: const BoxDecoration(color: const Color(0xFFFFFF00))
|
||||
);
|
||||
final BoxDecoration result = tween.lerp(0.25);
|
||||
expect(result.backgroundColor, const Color(0xFF3FFF00));
|
||||
expect(result.color, const Color(0xFF3FFF00));
|
||||
});
|
||||
|
||||
testWidgets('EdgeInsetsTween control test', (WidgetTester tester) async {
|
||||
|
||||
@@ -72,21 +72,17 @@ void main() {
|
||||
reverse: reverse,
|
||||
children: <Widget>[
|
||||
new GestureDetector(
|
||||
onTap: () { ++first; },
|
||||
onTap: () { first += 1; },
|
||||
child: new Container(
|
||||
height: 350.0, // more than half the height of the test area
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
)
|
||||
color: const Color(0xFF00FF00),
|
||||
)
|
||||
),
|
||||
new GestureDetector(
|
||||
onTap: () { ++second; },
|
||||
onTap: () { second += 1; },
|
||||
child: new Container(
|
||||
height: 350.0, // more than half the height of the test area
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
)
|
||||
color: const Color(0xFF0000FF),
|
||||
)
|
||||
)
|
||||
]
|
||||
|
||||
@@ -201,9 +201,7 @@ void main() {
|
||||
key: new ValueKey<int>(index),
|
||||
width: 500.0, // this should be ignored
|
||||
height: 220.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
color: Theme.of(context).primaryColor,
|
||||
child: new Text('$index'),
|
||||
);
|
||||
};
|
||||
@@ -223,7 +221,7 @@ void main() {
|
||||
|
||||
DecoratedBox widget = tester.firstWidget(find.byType(DecoratedBox));
|
||||
BoxDecoration decoraton = widget.decoration;
|
||||
expect(decoraton.backgroundColor, equals(Colors.blue[500]));
|
||||
expect(decoraton.color, equals(Colors.blue[500]));
|
||||
|
||||
setState(() {
|
||||
themeData = new ThemeData(primarySwatch: Colors.green);
|
||||
@@ -233,7 +231,7 @@ void main() {
|
||||
|
||||
widget = tester.firstWidget(find.byType(DecoratedBox));
|
||||
decoraton = widget.decoration;
|
||||
expect(decoraton.backgroundColor, equals(Colors.green[500]));
|
||||
expect(decoraton.color, equals(Colors.green[500]));
|
||||
});
|
||||
|
||||
testWidgets('ListView padding', (WidgetTester tester) async {
|
||||
@@ -242,9 +240,7 @@ void main() {
|
||||
key: new ValueKey<int>(index),
|
||||
width: 500.0, // this should be ignored
|
||||
height: 220.0,
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: Colors.green[500]
|
||||
),
|
||||
color: Colors.green[500],
|
||||
child: new Text('$index'),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -13,11 +13,9 @@ class FirstWidget extends StatelessWidget {
|
||||
Navigator.pushNamed(context, '/second');
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
),
|
||||
child: const Text('X')
|
||||
)
|
||||
color: const Color(0xFFFFFF00),
|
||||
child: const Text('X'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -33,11 +31,9 @@ class SecondWidgetState extends State<SecondWidget> {
|
||||
return new GestureDetector(
|
||||
onTap: () => Navigator.pop(context),
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFF00FF)
|
||||
),
|
||||
child: const Text('Y')
|
||||
)
|
||||
color: const Color(0xFFFF00FF),
|
||||
child: const Text('Y'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,9 +210,7 @@ void main() {
|
||||
new Container(
|
||||
width: 2000.0,
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -136,7 +136,7 @@ void main() {
|
||||
'/': (_) => new Scaffold(
|
||||
key: containerKey1,
|
||||
body: new Container(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xff00ffff)),
|
||||
color: const Color(0xff00ffff),
|
||||
child: const Hero(
|
||||
tag: kHeroTag,
|
||||
child: const Text('Home')
|
||||
@@ -147,7 +147,7 @@ void main() {
|
||||
key: containerKey2,
|
||||
body: new Container(
|
||||
padding: const EdgeInsets.all(100.0),
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0xffff00ff)),
|
||||
color: const Color(0xffff00ff),
|
||||
child: const Hero(
|
||||
tag: kHeroTag,
|
||||
child: const Text('Settings')
|
||||
|
||||
@@ -22,9 +22,7 @@ void main() {
|
||||
},
|
||||
child: new Container(
|
||||
height: 200.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text(state),
|
||||
),
|
||||
);
|
||||
@@ -83,9 +81,7 @@ void main() {
|
||||
children: new List<Widget>.generate(10, (int i) {
|
||||
return new Container(
|
||||
key: new ValueKey<int>(i),
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
);
|
||||
}),
|
||||
),
|
||||
|
||||
@@ -27,9 +27,9 @@ class TestOrientedBox extends SingleChildRenderObjectWidget {
|
||||
final Orientation orientation = MediaQuery.of(context).orientation;
|
||||
switch (orientation) {
|
||||
case Orientation.landscape:
|
||||
return const BoxDecoration(backgroundColor: const Color(0xFF00FF00));
|
||||
return const BoxDecoration(color: const Color(0xFF00FF00));
|
||||
case Orientation.portrait:
|
||||
return const BoxDecoration(backgroundColor: const Color(0xFF0000FF));
|
||||
return const BoxDecoration(color: const Color(0xFF0000FF));
|
||||
}
|
||||
assert(orientation != null);
|
||||
return null;
|
||||
@@ -201,7 +201,7 @@ void main() {
|
||||
|
||||
final RenderDecoratedBox renderBox = tester.renderObject(find.byKey(boxKey));
|
||||
BoxDecoration decoration = renderBox.decoration;
|
||||
expect(decoration.backgroundColor, equals(const Color(0xFF00FF00)));
|
||||
expect(decoration.color, equals(const Color(0xFF00FF00)));
|
||||
|
||||
await tester.pumpWidget(new MediaQuery(
|
||||
data: const MediaQueryData(size: const Size(300.0, 400.0)),
|
||||
@@ -209,6 +209,6 @@ void main() {
|
||||
));
|
||||
|
||||
decoration = renderBox.decoration;
|
||||
expect(decoration.backgroundColor, equals(const Color(0xFF0000FF)));
|
||||
expect(decoration.color, equals(const Color(0xFF0000FF)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@ void main() {
|
||||
},
|
||||
child: new Container(
|
||||
height: 200.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text(state),
|
||||
),
|
||||
);
|
||||
@@ -51,9 +49,7 @@ void main() {
|
||||
children: kStates.take(n).map<Widget>((String state) {
|
||||
return new Container(
|
||||
height: 200.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text(state),
|
||||
);
|
||||
}).toList()
|
||||
@@ -87,9 +83,7 @@ void main() {
|
||||
},
|
||||
child: new Container(
|
||||
height: 200.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: new Text(state),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -36,9 +36,7 @@ void main() {
|
||||
await tester.pumpWidget(new SingleChildScrollView(
|
||||
child: new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
));
|
||||
|
||||
@@ -56,9 +54,7 @@ void main() {
|
||||
await tester.pumpWidget(new SingleChildScrollView(
|
||||
child: new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
));
|
||||
|
||||
@@ -66,9 +62,7 @@ void main() {
|
||||
controller: controller,
|
||||
child: new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
));
|
||||
|
||||
@@ -84,9 +78,7 @@ void main() {
|
||||
primary: true,
|
||||
child: new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
),
|
||||
));
|
||||
@@ -107,9 +99,7 @@ void main() {
|
||||
return new SingleChildScrollView(
|
||||
child: new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -126,9 +116,7 @@ void main() {
|
||||
controller: controller,
|
||||
child: new Container(
|
||||
height: 2000.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -200,7 +200,7 @@ void main() {
|
||||
final Key key = const Key('container');
|
||||
|
||||
final BoxDecoration kBoxDecoration = const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
color: const Color(0xFF00FF00),
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
|
||||
@@ -28,38 +28,38 @@ class FooState extends State<Foo> {
|
||||
scrollController.animateTo(200.0, duration: const Duration(milliseconds: 500), curve: Curves.linear);
|
||||
},
|
||||
child: const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0)),
|
||||
decoration: const BoxDecoration(color: const Color(0)),
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
),
|
||||
)
|
||||
),
|
||||
const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0)),
|
||||
decoration: const BoxDecoration(color: const Color(0)),
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
),
|
||||
),
|
||||
const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0)),
|
||||
decoration: const BoxDecoration(color: const Color(0)),
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
),
|
||||
),
|
||||
const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0)),
|
||||
decoration: const BoxDecoration(color: const Color(0)),
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
),
|
||||
),
|
||||
const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0)),
|
||||
decoration: const BoxDecoration(color: const Color(0)),
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
),
|
||||
),
|
||||
const DecoratedBox(
|
||||
decoration: const BoxDecoration(backgroundColor: const Color(0)),
|
||||
decoration: const BoxDecoration(color: const Color(0)),
|
||||
child: const SizedBox(
|
||||
height: 200.0,
|
||||
),
|
||||
|
||||
@@ -7,15 +7,15 @@ import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
final BoxDecoration kBoxDecorationA = const BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFF0000)
|
||||
color: const Color(0xFFFF0000),
|
||||
);
|
||||
|
||||
final BoxDecoration kBoxDecorationB = const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00)
|
||||
color: const Color(0xFF00FF00),
|
||||
);
|
||||
|
||||
final BoxDecoration kBoxDecorationC = const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF)
|
||||
color: const Color(0xFF0000FF),
|
||||
);
|
||||
|
||||
class TestBuildCounter extends StatelessWidget {
|
||||
|
||||
@@ -19,9 +19,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
),
|
||||
),
|
||||
new Positioned(
|
||||
@@ -38,9 +36,7 @@ void main() {
|
||||
didReceiveTap = true;
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FFFF),
|
||||
),
|
||||
color: const Color(0xFF00FFFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -68,9 +64,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
),
|
||||
),
|
||||
new Positioned(
|
||||
@@ -87,9 +81,7 @@ void main() {
|
||||
didReceiveTap = true;
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FFFF),
|
||||
),
|
||||
color: const Color(0xFF00FFFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -116,9 +108,7 @@ void main() {
|
||||
child: new Container(
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF0000FF),
|
||||
),
|
||||
color: const Color(0xFF0000FF),
|
||||
),
|
||||
),
|
||||
new Positioned(
|
||||
@@ -136,9 +126,7 @@ void main() {
|
||||
didReceiveTap = true;
|
||||
},
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FFFF),
|
||||
),
|
||||
color: const Color(0xFF00FFFF),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -166,9 +154,7 @@ void main() {
|
||||
child: new Opacity(
|
||||
opacity: 0.9,
|
||||
child: new Container(
|
||||
decoration: const BoxDecoration(
|
||||
backgroundColor: const Color(0xFF00FF00),
|
||||
),
|
||||
color: const Color(0xFF00FF00),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -18,7 +18,7 @@ void main() {
|
||||
group('DecoratedBoxTransition test', () {
|
||||
final DecorationTween decorationTween = new DecorationTween(
|
||||
begin: new BoxDecoration(
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
color: const Color(0xFFFFFFFF),
|
||||
border: new Border.all(
|
||||
color: const Color(0xFF000000),
|
||||
style: BorderStyle.solid,
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
)],
|
||||
),
|
||||
end: new BoxDecoration(
|
||||
backgroundColor: const Color(0xFF000000),
|
||||
color: const Color(0xFF000000),
|
||||
border: new Border.all(
|
||||
color: const Color(0xFF202020),
|
||||
style: BorderStyle.solid,
|
||||
@@ -65,7 +65,7 @@ void main() {
|
||||
tester.renderObject(find.byType(DecoratedBox));
|
||||
BoxDecoration actualDecoration = actualBox.decoration;
|
||||
|
||||
expect(actualDecoration.backgroundColor, const Color(0xFFFFFFFF));
|
||||
expect(actualDecoration.color, const Color(0xFFFFFFFF));
|
||||
expect(actualDecoration.boxShadow[0].blurRadius, 10.0);
|
||||
expect(actualDecoration.boxShadow[0].spreadRadius, 4.0);
|
||||
expect(actualDecoration.boxShadow[0].color, const Color(0x66000000));
|
||||
@@ -76,7 +76,7 @@ void main() {
|
||||
actualBox = tester.renderObject(find.byType(DecoratedBox));
|
||||
actualDecoration = actualBox.decoration;
|
||||
|
||||
expect(actualDecoration.backgroundColor, const Color(0xFF7F7F7F));
|
||||
expect(actualDecoration.color, const Color(0xFF7F7F7F));
|
||||
expect(actualDecoration.border.left.width, 2.5);
|
||||
expect(actualDecoration.border.left.style, BorderStyle.solid);
|
||||
expect(actualDecoration.border.left.color, const Color(0xFF101010));
|
||||
@@ -93,7 +93,7 @@ void main() {
|
||||
actualBox = tester.renderObject(find.byType(DecoratedBox));
|
||||
actualDecoration = actualBox.decoration;
|
||||
|
||||
expect(actualDecoration.backgroundColor, const Color(0xFF000000));
|
||||
expect(actualDecoration.color, const Color(0xFF000000));
|
||||
expect(actualDecoration.boxShadow, null);
|
||||
}
|
||||
);
|
||||
@@ -117,7 +117,7 @@ void main() {
|
||||
tester.renderObject(find.byType(DecoratedBox));
|
||||
BoxDecoration actualDecoration = actualBox.decoration;
|
||||
|
||||
expect(actualDecoration.backgroundColor, const Color(0xFFFFFFFF));
|
||||
expect(actualDecoration.color, const Color(0xFFFFFFFF));
|
||||
expect(actualDecoration.boxShadow[0].blurRadius, 10.0);
|
||||
expect(actualDecoration.boxShadow[0].spreadRadius, 4.0);
|
||||
expect(actualDecoration.boxShadow[0].color, const Color(0x66000000));
|
||||
@@ -130,7 +130,7 @@ void main() {
|
||||
|
||||
// Same as the test above but the values should be much closer to the
|
||||
// tween's end values given the easeOut curve.
|
||||
expect(actualDecoration.backgroundColor, const Color(0xFF505050));
|
||||
expect(actualDecoration.color, const Color(0xFF505050));
|
||||
expect(actualDecoration.border.left.width, closeTo(1.9, 0.1));
|
||||
expect(actualDecoration.border.left.style, BorderStyle.solid);
|
||||
expect(actualDecoration.border.left.color, const Color(0xFF151515));
|
||||
|
||||
@@ -66,12 +66,12 @@ class MarkdownStyleSheet {
|
||||
listIndent: 32.0,
|
||||
blockquotePadding: 8.0,
|
||||
blockquoteDecoration: new BoxDecoration(
|
||||
backgroundColor: Colors.blue.shade100,
|
||||
color: Colors.blue.shade100,
|
||||
borderRadius: new BorderRadius.circular(2.0)
|
||||
),
|
||||
codeblockPadding: 8.0,
|
||||
codeblockDecoration: new BoxDecoration(
|
||||
backgroundColor: Colors.grey.shade100,
|
||||
color: Colors.grey.shade100,
|
||||
borderRadius: new BorderRadius.circular(2.0)
|
||||
)
|
||||
);
|
||||
@@ -103,12 +103,12 @@ class MarkdownStyleSheet {
|
||||
listIndent: 32.0,
|
||||
blockquotePadding: 8.0,
|
||||
blockquoteDecoration: new BoxDecoration(
|
||||
backgroundColor: Colors.blue.shade100,
|
||||
color: Colors.blue.shade100,
|
||||
borderRadius: new BorderRadius.circular(2.0)
|
||||
),
|
||||
codeblockPadding: 8.0,
|
||||
codeblockDecoration: new BoxDecoration(
|
||||
backgroundColor: Colors.grey.shade100,
|
||||
color: Colors.grey.shade100,
|
||||
borderRadius: new BorderRadius.circular(2.0)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user