I'm facing the problem that my cursor color isn't changing when wrapping TextField by Theme widget.
CodePudding user response:
The main problem here is that pointer color isn't changing while wrapping directly it's mentioned in this thread
active
CodePudding user response:
Solution 1 :-
FYI:- Add "cursorColor" property in theme data
import 'package:flutter/material.dart';
MaterialApp(
title: "Solution 1",
theme: ThemeData(
cursorColor: Colors.red,
),
home: splashScreen(),
);
Solution 2 :-
MaterialApp(
title: "Solution 2",
theme: ThemeData(
textSelectionTheme: TextSelectionThemeData(
cursorColor: darkPrimarySwatchColor,
selectionColor: darkPrimarySwatchColor,
selectionHandleColor: darkPrimarySwatchColor,
),
),
home: splashScreen(),
);