ReinBentdal / styled_widget

Simplifying widget style in Flutter.
https://pub.dev/packages/styled_widget
MIT License
1.27k stars 103 forks source link

Newfeature : Add selectable merhod #53

Open wer-mathurin opened 3 years ago

wer-mathurin commented 3 years ago

Add support for https://api.flutter.dev/flutter/material/SelectableText-class.html

This is something very useful for flutter web.

ReinBentdal commented 2 years ago

Could you give an example on how you think this should work? I would gladly accept a pull request which implements this in a nice way!

wer-mathurin commented 2 years ago

@ReinBentdal I can imagine the same way as it work for the widget Text. Currently I d not have time for PR. But, I usually do when I have time !
But I think commun use case is const SelectableText( 'Hello! How are you?', textAlign: TextAlign.center, style: TextStyle(fontWeight: FontWeight.bold), )

So if the widget is a SelectableText....using the usual styling method would be a great addition. var selectable = SelectableText('SOME_TEXT).fontSize().textColor(...);

And nice to have: var text = Text('SOME_TEXT').selectable(web: true, android: false, ios: false)