platform_text 0.2.0 copy "platform_text: ^0.2.0" to clipboard
platform_text: ^0.2.0 copied to clipboard

A Flutter package to make your text selectable for web and non-selectable for native builds.

PlatformText #

A Flutter package to make your text selectable for web and non-selectable for native builds.

pipeline status coverage report latest release

Features #

PlatformText returns Text or SelectableText widget depending on the platform it's running on.

Getting started #

Follow official installation guide. see more...

Usage #

PlatformText supports two constructors/widget classes: Text and SelectableText.

To migrate existing code just replace Text/SelectableText widget with PlatformText.

PlatformText('Hello mom!');
PlatformText.rich(
  TextSpan(
    text: 'Hello',
    children: <TextSpan>[
      TextSpan(
        text: ' beautiful ',
        style: TextStyle(fontStyle: FontStyle.italic),
      ),
      TextSpan(
        text: 'mom!',
        style: TextStyle(fontWeight: FontWeight.bold),
      ),
    ],
  ),
);

Support #

If you like my package you can buy me a coffee.

buymeacoffee.com/rozpo.dev

Additional information #

  • Package maintainer: Piotr Rozpończyk rozpo.dev
  • Technical writer: Dawid Ratusz
  • Bug reporting: issues
  • Source code: gitlab
7
likes
120
pub points
0%
popularity

Publisher

verified publisherrozpo.dev

A Flutter package to make your text selectable for web and non-selectable for native builds.

Homepage

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on platform_text