By default ToolbarOptions contains copy, cut, paste, selectAll options. Can we add a custom action? For example, an action which will keep the selected text and remove unselected one.

Solution 1: Pegasis

It's currently not possible in flutter, you can only control show or don't show default actions by the toolbarOptions property of TextField.

There is a pull request on github to add this functionality but it's not fully done.

Solution 2: E G

You can use Selectable to customize the toolbar options and assign actions upon press. You can also grab the selected text.