Make text selectable

Flutter tips Published on

By default, text in Flutter apps isn't selectable. This means users can't long-press and copy important information shown on the screen.

Why is Selection Important?

Being able to select text makes your app more user-friendly. It allows people to copy details like addresses, phone numbers, or website links easily.

How to Make Text Selectable?

Flutter provides two main ways to add text selection:

Using SelectionArea

The SelectionArea widget is great when you want to make text selectable within a certain part of your app, or even the whole app. You wrap the part of your widget tree where you want text selection enabled with SelectionArea.

Example:
return MaterialApp(
  home: SelectionArea(
    child: Scaffold(
      appBar: AppBar(title: const Text('SelectionArea Sample')),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text('Row 1'),
            Text('Row 2'),
            Text('Row 3'),
          ],
        ),
      ),
    ),
  ),
);

Just add SelectionArea high up in your widget tree, like around your Scaffold or even MaterialApp, and all the text widgets inside it become selectable.

Using SelectableText

If you only need to make a single Text widget selectable, you can simply replace Text with SelectableText. This widget is specifically designed for making individual text elements selectable.

Example:
const SelectableText(
  'Hello! How are you?',
  textAlign: TextAlign.center,
  style: TextStyle(fontWeight: FontWeight.bold),
)

This is simpler if you just have one specific text you want users to be able to copy.

SelectionArea vs SelectableText

Save 3 months of work

Create your app using our 6 years of making Flutter apps and more than 50+ apps

kickstarter for flutter apps

Frequently Asked Questions

Why can't I select text in my Flutter app by default?

By default, Flutter's Text widget doesn't come with text selection behavior enabled.

How can I make text selectable in Flutter?

You can use the SelectionArea widget to wrap multiple widgets or the SelectableText widget for a single text widget.

When should I use SelectionArea?

Use SelectionArea when you want to enable text selection for many text widgets or other selectable content within a certain part of your app.

When should I use SelectableText?

Use SelectableText when you only need a single text element to be selectable.

Does SelectionArea make *all* widgets inside it selectable?

SelectionArea enables text selection for text widgets and other selectable widgets within its scope by handling the rendering and interaction.

Read more
You may also be interested in
Observe application lifecycle  blog card image
Observe application lifecycle
Published on 2025-05-12T10:59:54.868Z
Optimize code generation  blog card image
Optimize code generation
Published on 2025-05-13T07:04:51.703Z
ApparenceKit is a flutter template generator tool by Apparence.io © 2025.
All rights reserved