getCancelButton method

Widget getCancelButton()

Implementation

Widget getCancelButton() {
  if (_cancelButton != null) return _cancelButton!;

  // 提供安全的默认值,避免 context 为 null 时崩溃
  final unselectedColor = context != null
      ? Theme.of(context!).unselectedWidgetColor
      : Colors.grey;

  return Container(
    alignment: Alignment.center,
    padding: const EdgeInsets.only(left: 22, right: 12),
    child: Text(
      '取消',
      style: TextStyle(
        color: unselectedColor,
        fontSize: 16.0,
      ),
    ),
  );
}