Widget _buildOptions()

in lib/ui/aliplayer_custom_selector_widget.dart [107:136]


  Widget _buildOptions() {
    // 默认显示内容
    final bool isEmpty = widget.initialValue == null ||
        widget.options == null ||
        widget.options!.isEmpty;

    return // 如果为空,显示默认内容
        isEmpty
            ? const Expanded(
                child: Text(
                  "No options available",
                  style: TextStyle(
                    fontSize: 12,
                    color: Colors.grey,
                  ),
                ),
              )
            :
            // 横滑列表
            Expanded(
                child: SingleChildScrollView(
                  scrollDirection: Axis.horizontal,
                  child: Row(
                    children: widget.options!
                        .map((option) => _buildSingleItem(option))
                        .toList(),
                  ),
                ),
              );
  }