/*
 * @Author: XianKaiQun
 * @LastEditors  : WuWei
 * @Date: 2020-10-26 11:07:50
 * @LastEditTime : 2021-04-28 15:57:13
 */
import 'package:flutter/material.dart';
import 'package:wisdom_cli/wisdom_cli.dart';
import 'form_layout.dart';

///单项选择
class WFInfinityPicker extends StatelessWidget {
  const WFInfinityPicker({
    Key? key,
    this.isRequired,
    this.hintText,
    this.title,
    this.initialValue,
    this.onChanged,
    this.dataList,
    this.onGetData,
    this.field,
    required this.child,
  }) : super(key: key);

  ///是否必须
  final bool? isRequired;
  final String? hintText;
  final Widget? title;
  final initialValue;

  /// 选择数据列表
  final dataList;

  ///选择
  final void Function(dynamic value)? onChanged;

  final Function(dynamic value)? onGetData;

  final field;

  final Widget child;
  @override
  Widget build(BuildContext context) {
    // final style = WTheme.of(context);
    // final colorScheme = style.colorScheme;
    // var _initialValue = initialValue;
    return WisFormLayoutComponent(
      title: title,
      isRequired: isRequired,
      axis: Axis.horizontal,
      child: StatefulBuilder(
        builder: (BuildContext context, setState) {
          return Row(
            children: [child],
          );
        },
      ),
    );
  }
}
