attach method Null safety

  1. @override
TextInputConnection attach(
  1. TextInputClient trigger,
  2. TextInputConfiguration configuration
)
override

Allows a TextInputClient to attach to this scope. This method should be called in lieu of TextInput.attach, when the TextInputClient wishes to participate in autofill.

Implementation

@override
TextInputConnection attach(TextInputClient trigger, TextInputConfiguration configuration) {
  assert(trigger != null);
  assert(
    !autofillClients.any((AutofillClient client) => !client.textInputConfiguration.autofillConfiguration.enabled),
    'Every client in AutofillScope.autofillClients must enable autofill',
  );

  final TextInputConfiguration inputConfiguration = _AutofillScopeTextInputConfiguration(
    allConfigurations: autofillClients.map((AutofillClient client) => client.textInputConfiguration),
    currentClientConfiguration: configuration,
  );
  return TextInput.attach(trigger, inputConfiguration);
}