RaisedPickerStyle.dark constructor

RaisedPickerStyle.dark({
  1. bool haveRadius = false,
  2. String? title,
  3. Color? color,
})

夜间

Implementation

RaisedPickerStyle.dark({
  bool haveRadius = false,
  String? title,
  Color? color,
}) {
  headDecoration = BoxDecoration(
    color: Colors.grey[800],
    borderRadius: haveRadius
        ? const BorderRadius.vertical(top: Radius.circular(10))
        : null,
  );

  commitButton = Container(
    padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
    margin: const EdgeInsets.only(right: 22),
    decoration: BoxDecoration(
      color: color ?? Colors.blue,
      borderRadius: BorderRadius.circular(4),
    ),
    child: const Text(
      '确定',
      style: TextStyle(color: Colors.white, fontSize: 15.0),
    ),
  );

  cancelButton = Container(
    padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
    margin: const EdgeInsets.only(left: 22),
    decoration: BoxDecoration(
      border: Border.all(color: Colors.white, width: 1),
      borderRadius: BorderRadius.circular(4),
    ),
    child: const Text(
      '取消',
      style: TextStyle(color: Colors.white, fontSize: 15.0),
    ),
  );

  if (title != null && title.isNotEmpty) {
    this.title = Center(
      child: Text(
        title,
        style: const TextStyle(color: Colors.white, fontSize: 14),
      ),
    );
  }

  backgroundColor = Colors.grey[800]!;
  textColor = Colors.white;
}