/*
 * @Author       : WuWei
 * @LastEditors: ChenYaJin
 * @Date         : 2022-08-10 16:12:48
 * @LastEditTime: 2022-12-21 15:32:25
 * @Description  : Do not edit
 */
part of '../index.dart';

/// 搜索输入框
class _BuildSearchInput extends StatefulWidget {
  _BuildSearchInput({Key? key, this.onInput, this.onCancel, this.title})
      : super(key: key);

  final Function(dynamic v)? onInput;
  final Function()? onCancel;
  final String? title;
  @override
  _SearchInputState createState() => _SearchInputState();
}

class _SearchInputState extends State<_BuildSearchInput> {
  @override
  Widget build(BuildContext context) {
    return Wisdom.row(
      color: Colors.white,
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: <Widget>[
        /// 输入框
        Expanded(
          child: WSearch(
            hintText: '输入姓名/手机号搜索',
            onSubmitted: (v) => widget.onInput!(v),
            onCancel: () => widget.onCancel!(),
            isControlOutside: true,
            initValue: widget.title,
            moonlight: false,
            padding: EdgeInsets.symmetric(vertical: 10.pt),
            isDark: true,
          ),
        ),
      ],
    );
  }
}
