Q:

TextField doesn't take input after adding 2 decimal positive numbers configuration in whitelistingtextinputformatter

                keyboardType: TextInputType.number,
                inputFormatters: [
                  WhitelistingTextInputFormatter(
                      RegExp("^\s*(?=.*[1-9])\d*(?:\.\d{1,2})?\s*\$"))
                ],
              ),

I'm using this settings in my TextFormField and using this regex which I took from another SO post. Tests seem fine on regex101.com but I can't put any input on my form with this regexp.
My goal with regex is get two decimal positive floating point numbers.
Regex greater than zero with 2 decimal places

A:

You may use
RegExp(r"^\s*\d*(?:\.\d{1,2})?\s*$")
       ^                         ^

Or, if you want to keep the "at least one non-zero digit in string" requirement (as the regex you tried hints at that):
RegExp(r"^(?=.*[1-9])\s*\d*(?:\.\d{1,2})?\s*$")

The point here is that:

You should use a raw string literal for regex escapes to work with a single backslash
$ is an end of string anchor only if it is not escaped and is out of square brackets
The lookahead must be placed after ^ for better performance.

Pattern details

^ - start of string
(?=.*[1-9]) - there must be a non-zero digit after any 0+ chars other than line break chars
\s* - 0+ whitespaces
\d* - 0+ digits
(?:\.\d{1,2})? - an optional sequence of

\. - a dot
\d{1,2} - 1 or 2 digits

\s* - 0+ whitespaces
$ - end of string.

