Customize the Flutter TextField text selection button - dart

I'm looking for a way to customize the flutter's text selection panel(e.g. copy, paste, select all). Especially, I want to add events for onCopy and onPaste actions.

Try using
SelectableText(
'Your Text',
toolBarOptions: ToolBarOptions(copy: true,)
)
For more info,
https://youtu.be/ZSU3ZXOs6hc

Create on longPressed on InkWell or GestureDetector.
inside longPressed create showMenu
Example:
https://stackoverflow.com/a/58334342/8822337
Or
You can user Selectable Widget. click here

Related

How to disable isEnable and isUserInteraction attributes but keep cursor show in UITextField?

I have a custom framework for UITextField. For now, I want to disable two attribute as the question above but still keep the cursor show in my custom textfield. I already disable the keyboard with set the inputView = UIView(), and that successful for hide the keyboard even show the cursor inside textField.
My goal is disable both attributes like above or another for can not Select All action from my textField, but still keep the cursor available anytime.
Hope to hear the ideas from you guys. Thank a lot!

how to set setNextFocusDown in TextArea

I am try to use setNextFocusDown method in TextArea eg:
textArea.setNextFocusDown(nextTextField);
But in keyboard it does not show next button so how to set setNextFocusDown in TextArea ?
This will only apply if you do it in the beginning and only for TextArea subclasses. Notice this hint will not apply for every case.

UI-GRID Expandable Grid. Programatically expand one row

I want to hide the + icon in the far left column and add another icon.
When the user clicks the new Icon I want to programatically expand that specific row.
I see there is gridApi.expandable.expandAllRows();
Is there a way to expand just one row?
You can use toggleRowExpansion function, add this attribute to the desired element which will be trigger this toggle:
ng-click="grid.api.expandable.toggleRowExpansion(row.entity)"
If all you want is to change the default plus icon to a different icon, you can simply override the template for the expandableRowHeader.
$templateCache.put('ui-grid/expandableRowHeader',
"<div class=\"ui-grid-row-header-cell ui-grid-expandable-buttons-cell\"><div class=\"ui-grid-cell-contents\"><i ng-class=\"{ 'ui-grid-icon-plus-squared' : !row.isExpanded, 'ui-grid-icon-minus-squared' : row.isExpanded }\" ng-click=\"grid.api.expandable.toggleRowExpansion(row.entity)\"></i></div></div>"
);
You can change the ng-class=\"{ 'ui-grid-icon-plus-squared' : !row.isExpanded, 'ui-grid-icon-minus-squared' : row.isExpanded }\" and change them to a different icon of your choice.

Custom gesture to text selection on iOS

How to implement a different gesture to select text in a UITextView or web view in iOS? For instance, after tapping in a button to "enable" text selection, the user would just drag over the text to select it, instead of using the default text selection of iOS. How can that be accomplished?

How do you use the showhide effect found in the Dart Widget Package

I am trying to use the ShowHide effect that comes with Kevin Moore's widget package here:
http://dart-lang.github.io/widget.dart/#showhide
Not sure how to use this. Anyone got an example I can look at ?
Basically all I want is for a dropdown to show with one of those effects if a certain event happens.
Your tips appreciated.
Thanks.
You need to add a listener for an event to an element in the DOM, and then use ShowHide.toggle(element, effect) to trigger an effect. Here is an example which listens for a click on a button, and toggles FadeEffect on an image each time it is pressed:
var button = query("#fadeButton")
..onClick.listen((event) {
ShowHide.toggle(query("#fadeImage"), effect: new FadeEffect());
});
If you wanted to fade in/out a dropdown when you click on a menu bar, then substitute "fadeButton" for the menu which listens for clicks, and "fadeImage" with the dropdown element.
Also, any other effect can be substituted for FadeEffect, such as DoorEffect, ScaleEffect, ShrinkEffect, etc.

Resources