GitHub

    Table of contents

  1. 示例
  2. 相关链接

DecoratedBox

Edit this page

A widget that paints a Decoration either before or after its child paints.

示例

DecoratedBox(
  position: DecorationPosition.background,
  decoration: BoxDecoration(
    color: const Color(0xFFFFFFFF),
    border: Border.all(
      color: const Color(0xFF000000),
      style: BorderStyle.solid,
      width: 4.0,
    ),
    borderRadius: BorderRadius.zero,
    shape: BoxShape.rectangle,
    boxShadow: const <BoxShadow>[
      BoxShadow(
        color: Color(0x66000000),
        blurRadius: 10.0,
        spreadRadius: 4.0,
      )
    ],
  ),
  child: Container(
    child: Container(
      width: 200,
      height: 200,
      padding: EdgeInsets.all(20),
      child: FlutterLogo(),
    ),
  ),
)

相关链接