import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class LabelScanInputBox extends StatelessWidget { const LabelScanInputBox({ Key? key, required this.idCTRL, required double deviceBlockSize, }) : _deviceBlockSize = deviceBlockSize, super(key: key); final TextEditingController idCTRL; final double _deviceBlockSize; @override Widget build(BuildContext context) { return TextFormField( validator: (val) { if (val!.isEmpty) { return 'Id required!!'; } return null; }, controller: idCTRL, decoration: InputDecoration( icon: Icon( FontAwesomeIcons.sortNumericDown, size: 6 * _deviceBlockSize, ), labelStyle: TextStyle( fontWeight: FontWeight.w100, fontSize: 4 * _deviceBlockSize, ), labelText: 'Or enter a label ID', isDense: true, contentPadding: EdgeInsets.symmetric( vertical: 2, horizontal: 3, ), focusedBorder: UnderlineInputBorder( // borderRadius: BorderRadius.only(Radius.circular(4)), borderSide: BorderSide( color: Colors.grey, ), ), ), style: TextStyle( fontWeight: FontWeight.w700, fontSize: 5 * _deviceBlockSize, ), keyboardType: TextInputType.number, ); } }