how to remove text field cursor bubble in flutter

Viewed 1449

enter image description here

How to remove this bubble in flutter while typing in the text field. Any solution for this?

3 Answers
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        textSelectionTheme: TextSelectionThemeData(
          selectionHandleColor: Colors.transparent,
        ),
      ),
      home: Scaffold(body: Center(child: TextField())),
    );
  }
}

enter image description here

TextField set enableInteractiveSelection property to false can resolve this issue.

 enableInteractiveSelection: true,

You will have to change the theme property to change the color of the cursor bubble. In your theme change the textSelectionHandleColor to transparent . Like this.

Theme(
      data: Theme.of(context).copyWith(
        textSelectionHandleColor: Colors.transparent, 
      ),
Related