backgroundColor method

Widget backgroundColor(
  1. Color color, {
  2. Key? key,
  3. bool animate = false,
})

Implementation

Widget backgroundColor(
  Color color, {
  Key? key,
  bool animate = false,
}) =>
    animate
        ? _StyledAnimatedBuilder(
            key: key,
            builder: (animation) {
              return _AnimatedDecorationBox(
                child: this,
                decoration: BoxDecoration(color: color),
                duration: animation.duration,
                curve: animation.curve,
              );
            },
          )
        : DecoratedBox(
            key: key,
            child: this,
            decoration: BoxDecoration(color: color),
          );