Flutter:如何在TextField中更改光标的半径?

时间:2020-09-15 08:27:04

标签: flutter flutter-layout

我想在TextField中更改光标的半径。在Flutter中,可以执行任何操作。

1 个答案:

答案 0 :(得分:1)

在TextField中,有一个名为cursorRadius的属性。您可以使用它设置所需的cursorRadius。

这是代码。

TextField (
     cursorRadius: Radius.circular(5.0), //you can play with the number to get the result you want
      decoration: InputDecoration(
        border: OutlineInputBorder(),
        labelText: 'Username',
      ),
    ),

默认结果

enter image description here

使用cursorRadius属性后的结果

enter image description here