InputLookup constructor
InputLookup({})
Implementation
InputLookup({
Key? key,
required this.name,
required this.label,
required this.telaPesquisa,
this.function,
this.visivel = true,
this.valorinicial,
this.obrigatorio = false,
}) : super(key: key) {
id = Input(
name: "ID",
label: "Codigo",
width: 90,
onChanged: (valor) async {
if (valor.isNotEmpty) {
if (function != null) {
function!(valor);
}
final res = await telaPesquisa.controller
.pesquisarid(valor: [int.parse(valor)]);
if (res != null) {
descricao.controller.text = res['descricao'];
} else {
descricao.controller.text = "";
}
} else {
descricao.controller.text = "";
}
},
);
descricao = Input(
name: "DESCRICAO",
label: label,
editable: false,
obrigatorio: obrigatorio,
);
}