import 'package:fis_i18n/i18n.dart';
import 'package:fis_ui/base_define/page.dart';
import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/define.dart';
import 'package:flyinsono/pages/remedical/consultation/controller.dart';

class SearchInput extends FisView<ConsultationController> {
  ///父级节点
  final FPage businessParent;

  SearchInput({required this.businessParent, Key? key}) : super(key: key);
  @override
  FWidget build(BuildContext context) {
    return FContainer(
      margin: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
      color: Colors.white,
      child: FRow(
        children: [
          FExpanded(
            child: FContainer(
              height: 45,
              child: FRow(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  FBorderInput(
                    focusNode: controller.searchFocusNode,
                    controller: controller.serachInput,
                    hintSize: 16,
                    contentSize: 16,
                    maxLength: 20,
                    borderColor: Color.fromARGB(255, 187, 180, 180),
                    suffixIcon: FMaterial(
                      color: Colors.transparent,
                      child: FIconButton(
                        name: "search",
                        onPressed: () {
                          controller.state.parameterPatientCode = null;
                          controller.patientInfoController.getPatients(true);
                        },
                        icon: FIcon(
                          Icons.search,
                        ),
                        businessParent: businessParent,
                      ),
                    ),
                    height: 55,
                    hintText: i18nBook.remedical.searchPatient.t,
                    onChanged: (value) {
                      controller.state.keyWord = value;
                    },
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
