Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SelectionArea does not show a magnifying glass when selecting text #104555

Closed
@nilsreichardt

Description

@nilsreichardt

When I select text on my Android, Android shows a magnifying glass when selecting text. Flutter does't do it.

IMG_0020.MOV

I would expect the behavior for the SelectionArea in my Flutter App.

I used Pixel 4a with Android 12.

iOS has a similar feature:

RPReplay_Final1653432012.MP4
My app
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This example shows how to make a screen selectable..

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // You need to add the "SelectionArea" to make the text selectable.
      home: SelectionArea(
        child: Scaffold(
          body: Padding(
            padding: const EdgeInsets.all(16),
            child: Center(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                  Text(
                    'Fast',
                    style: Theme.of(context).textTheme.titleLarge,
                  ),
                  const Text(
                    'Flutter code compiles to ARM or Intel machine code as well as JavaScript, for fast performance on any device.',
                  ),
                  ElevatedButton(
                    onPressed: () {},
                    child: const Text('Try it in DartPad'),
                  )
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}

cc: @chunhtai

Extracted this issue from #104551 (comment).

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsframeworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyplatform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions