简体   繁体   English

颤动:如何更改选择光标颜色

[英]flutter : How to change selectetion cursor color

I want to change blue selection cursor how will to do this.我想改变蓝色选择光标如何做到这一点。

在此处输入图片说明

Try changing the primary color in your theme or the cursorColor in the theme or TextField尝试更改主题中的cursorColor或主题或 TextField 中的cursorColor

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

MaterialApp(
  title: "Rate your Colleagues",
  theme: ThemeData(
    // for iOS
    cupertinoOverrideTheme: CupertinoThemeData(
      primaryColor: Colors.red,
    ),
    // for others(Android, Fuchsia)
    cursorColor: Colors.red,
    home: SplashScreen(),
  );
  ...

Or或者

new MaterialApp(
  title: "Flutter App",
  theme: ThemeData(
    cursorColor: Colors.red,
    home: HomeScreen(),
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM