[Flutter] iOS emoji keyboard causes UI freeze in chat TextField

OPEN

Hey,

I have a chat screen where switching to the emoji keyboard on iOS causes the entire UI to freeze. On Android it works perfectly. Looking for anyone who has solved this.

My chat screen layout:

Scaffold(
  backgroundColor: AppConstants.offWhite,
  extendBodyBehindAppBar: true,
  appBar: IndividualChatAppBar(...),
  body: SafeArea(
    bottom: false,
    child: Column(
      children: [
        Expanded(
          child: BlocBuilder<IndividualChatBloc, IndividualChatState>(
            builder: (context, state) {
              // messages list
            },
          ),
        ),
        BlocBuilder<IndividualChatBloc, IndividualChatState>(
          builder: (context, state) {
            return MessageInputField(...);
          },
        ),
        SizedBox(height: MediaQuery.of(context).padding.bottom + 8),
      ],
    ),
  ),
)

My TextField inside MessageInputField:

TextField(
  controller: _controller,
  maxLines: null,
  textCapitalization: TextCapitalization.sentences,
  keyboardType: TextInputType.multiline,
  scrollPadding: EdgeInsets.zero,
  autocorrect: false,
  enableSuggestions: false,
  style: const TextStyle(fontSize: 15, color: Colors.black87),
  decoration: InputDecoration(...),
)

Things I've tried (all reverted because they didn't fix it):

  1. resizeToAvoidBottomInset: false + manual MediaQuery.viewInsets.bottom padding via SizedBox
  2. WidgetsBindingObserver + didChangeMetrics() with 80ms debounce to track keyboard height
  3. Wrapping input in SingleChildScrollView(physics: NeverScrollableScrollPhysics())
  4. Isolating the input into a separate StatefulWidget to limit MediaQuery rebuilds
  5. SingleChildScrollView(reverse: true) with Padding(bottom: viewInsets.bottom) wrapping the input
  6. keyboardType: TextInputType.text — this actually broke Android multiline input so had to revert

Question:

Is this a known Flutter engine bug on iOS? Is there any workaround that actually works for a chat layout with a sticky input at the bottom?

Posted Mar 8, 2026, 8:03 PM UTC

22
Loading comments…