My requirement is to replicate the label text as shown in the below image in my Textform label and hint shown in another image. I have referred this answer but it has limited unicodes, have also used Easy Rich Text library but it is providing me with the widget and not just a string to use in label text and hint text.
How can I achieve this? thanks. Attached code at the bottom.
@override
Widget build(BuildContext context) {
return TextFormField(
controller: controller,
keyboardType: TextInputType.numberWithOptions(signed: true,decimal: true),
decoration: setInputDecoration(text),
cursorHeight: 20,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp("[0-9.]")),
],
validator: (value){
if(value.isEmpty){
return emptyString;
}else if(CalculatorManager().isNotValidDouble(value)){
return invalidInput;
}
return null;
},
);
}
setInputDecoration(String text) {
return InputDecoration(
contentPadding: EdgeInsets.fromLTRB(5.0, 3.0, 1.0, 3.0),
filled: true,
fillColor: Colors.white,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 2.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 1.0),
),
hintText: text,
labelText: text,
hintStyle: TextStyle(
color: Colors.grey,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
borderSide: BorderSide.none,
),
);
}