0

I have a DateTimeFormField who's InkWell height is way too much. I tried controlling it by putting a Container with a fixed height above it but it didn't seem to do anything. I also tried it with a SizedBox and still nothing. I do use a GridView.count to build the fields side-by-side.

Here's my setup:

Expanded(
  child: GridView.count(
    crossAxisCount: 2,
    padding: EdgeInsets.zero,
    primary: false,
    crossAxisSpacing: 10,
    shrinkWrap: true,
    children: formBloc.startEndTimeFields.map((field) {
      return BlocBuilder(
        bloc: field,
        builder: (context, state) {
          return Container(
            height: 100,
            child: DateTimeFormField(
              formatter: DateFormat("HH:mm a"),
              onlyTime: true,
              label: "",
              initialValue: DateTime.now(),
              onSaved: (value) {
                field.updateValue(value);
              },
            ),
          );
        },
      );
    }).toList(),
  ),
),

I have a picture with the InkWell clicked on to show you what it looks like.

picture

Benjamin
  • 5,783
  • 4
  • 25
  • 49
  • May be related https://stackoverflow.com/questions/50400529/how-to-update-flutter-textfields-height-and-width – Pavel Dec 29 '19 at 14:29
  • It's from a package, I can't change the source. @Pavel – Benjamin Dec 29 '19 at 14:30
  • Do you mean `flutter_datetime_formfield` package? It's has just 130 lines of code: https://github.com/jczhong/flutter_datetime_formfield/tree/master/lib Fork/copy and modify it – Pavel Dec 29 '19 at 14:34

0 Answers0