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

Tap outside of select #6

Closed
ezequiel88 opened this issue Jun 5, 2021 · 6 comments
Closed

Tap outside of select #6

ezequiel88 opened this issue Jun 5, 2021 · 6 comments

Comments

@ezequiel88
Copy link

I'm getting an error when I tap outside the select to cancel.

Erro:

[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: Bad state: No element
#0      ListMixin.firstWhere (dart:collection/list.dart:167:5)
#1      _SelectFormFieldState._showSelectFormFieldMenu (package:select_form_field/select_form_field.dart:524:29)
<asynchronous suspension>

.dart:

SelectFormField(
  controller: _categoria,
  labelText: 'Categoria',
  items: _items,
  decoration: InputDecoration(
    labelText: "Categoria",
    border: OutlineInputBorder(),
  ),
  onChanged: (val) => print(val),
  onSaved: (val) => print(val),
  validator: (value) {
    if (value == null || value.isEmpty) {
    return 'Selecione uma Categoria';
    }
    return null;
  },
),

items provider:

final List<Map<String, dynamic>> _items = [
    {
      'value': 'despesa',
      'label': 'Despesas',
    },
    {
      'value': 'receita',
      'label': 'Receitas',
    },
    {
      'value': 'pagar',
      'label': 'Contas a Pagar',
    },
    {
      'value': 'receber',
      'label': 'Contas a Receber',
    },
  ];

pubspec.yaml:

environment:
  sdk: ">=2.12.0 <3.0.0"

select_form_field: ^2.0.0
@pabloismael90
Copy link

pabloismael90 commented Jun 15, 2021

hi @ezequiel88, i have the same problem as you solved it?

@ezequiel88
Copy link
Author

oi @ ezequiel88 , estou com o mesmo problema que você resolveu?

Não ainda.

@pjvillanueva
Copy link

I got the same error

@childon4god
Copy link

I have same issue

@LuisFerRosas
Copy link

mismo problema , cuando lo solucionaran?

@hslbetto
Copy link
Member

hslbetto commented Jul 7, 2021

The bug has been fixed and the new version is now available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants