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())),
);
}
}
TextField set enableInteractiveSelection
property to false can resolve this issue.
enableInteractiveSelection: true,
-
2this parameter disable selection at all– user14631430Dec 11, 2020 at 11:40
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,
),