Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Drop frame in 5.x.x version #590

Open
ThanhPhungTien opened this issue Jun 10, 2024 · 2 comments
Open

[Bug] Drop frame in 5.x.x version #590

ThanhPhungTien opened this issue Jun 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ThanhPhungTien
Copy link

Steps to reproduce

  1. I used version 4.7.0 before and everything work fine.
  2. I upgrade package to 5.2.0 and the UI drop frame when it render the view has TypeAheadField

Expected results

Smooth like before

Actual results

The UI become lagging

Package Version

5.2.0

Platform

Android, iOS

Code sample

Code sample
 TypeAheadField<AddressSuggestModel>(
          focusNode: widget.focusNode,
          controller: widget.controller,
          builder: (context, controller, focusNode) => TextFormField(
            decoration: _inputDecoration(),
            style: AppTextStyles.body(
              color: widget.enabled ? AppColors.text : AppColors.disable,
            ),
            controller: controller,
            maxLines: 3,
            minLines: 1,
            inputFormatters: _getInputFormatter(),
            keyboardType: widget.keyboardType,
            enabled: widget.enabled,
            focusNode: focusNode,
            textInputAction: TextInputAction.done,
            autovalidateMode: AutovalidateMode.onUserInteraction,
            onSaved: (value) => _onSaved(value),
            validator: (value) {
              String? error = _validate(value);
              _hasError = error != null;
              return error;
            },
          ),
          debounceDuration: const Duration(milliseconds: 200),
          onSelected: _onSuggestionSelected,
          itemBuilder: (_, suggestion) => ItemSuggestionWidget(
            previousText: _previousText,
            suggestion: suggestion,
          ),
          itemSeparatorBuilder: (context, index) => const Divider(
            height: 0.5,
            thickness: 0.5,
            color: AppColors.onSecondaryContainer,
          ),
          suggestionsCallback: (String pattern) async {
            if (pattern == _previousText && !_hasError) {
              return [];
            }
            pattern = pattern.trim();
            if (pattern.isNullOrEmpty || pattern.length < 2) {
              return [];
            }
            await bloc.query(pattern);
            return bloc.state.suggestions;
          },
          direction: widget.suggestionDirection,
          hideOnEmpty: true,
          retainOnLoading: false,
        )

Logs

Logs
[Paste your logs here]

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2024-06-10.at.16.04.58.mov
@ThanhPhungTien ThanhPhungTien added the bug Something isn't working label Jun 10, 2024
@awaitUsername
Copy link

This seems to happen on pages with many TextFields.
Downgrading for now... :(

@AdamTechAcc
Copy link

I've the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants