CreamyTextSelectionControlsProvider constructor

CreamyTextSelectionControlsProvider({
  1. required TextSelectionControlsType type,
  2. required ActionsBuilderCallback actionsBuilder,
})

Provide text selection controls from this package,

Describe the type of selections controls with type. Use actionsBuilder to build actions for the selection controls.

Implementation

factory CreamyTextSelectionControlsProvider({
  required TextSelectionControlsType type,
  required ActionsBuilderCallback actionsBuilder,
}) {
  TextSelectionControls textSelectionControls;

  switch (type) {
    case TextSelectionControlsType.material:
    default:
      textSelectionControls = creamyMaterialTextSelectionControls;
  }

  return CreamyTextSelectionControlsProvider.custom(
    controls: textSelectionControls as CreamyTextSelectionControls,
    actionsBuilder: actionsBuilder,
  );
}