0

I have wrapped a container and a sizedbox around the textform field to fit the error message in the container but its keeps resizing the widget.

 Container(
  decoration: BoxDecoration(
    color: Color(0xffFAFAFA),
    borderRadius: BorderRadius.circular(10.0),
  ),
  height: 73,
  width: 396,
  child: Center(
    child: TextFormField(
      keyboardType: TextInputType.number,
      onSaved: (Value) => print(phonenumber),
      decoration: InputDecoration(
        contentPadding: EdgeInsets.fromLTRB(10.0, 50.0, 0.0, 00.0),
        isDense: true,
        hintStyle: TextStyle(
          fontFamily: "Proxima Nova",
          fontWeight: FontWeight.w300,
        ),
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(5),
          borderSide: BorderSide(
              //color: Colors.amber,
              ),
        ),
        enabledBorder: OutlineInputBorder(
          borderRadius: BorderRadius.circular(5),
          borderSide: BorderSide(width: 1, color: Colors.transparent),
        ),
        focusedBorder: OutlineInputBorder(
          borderSide: const BorderSide(color: Colors.transparent),
        ),
        // labelText: '',
      ),
      inputFormatters: [
        FilteringTextInputFormatter.deny(
          RegExp(
              r'^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{5})(?: *x(\d+))?\s*$'),
        )
      ],
      controller: phonenumber,
      validator: (value) {
        if (value != null && value.isEmpty) {
          return 'Kindly register with another number or Log In';
        } else
          return null;
      },
    ),
  ),
  ),

i wrapped a container around the textformfield and a sizedbox around the textformfield but,the error message keeps resizing the container.

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56

1 Answers1

0

Please remove container height , this is causing shrink.

IonicFireBaseApp
  • 925
  • 3
  • 10