实现

想要实现如下效果:
屏幕快照 2019-07-24 下午5.08.03.png
代码如下:

  1. TextFormField(
  2. cursorColor: Color(0xFFffc542),
  3. maxLines: 3,
  4. decoration: const InputDecoration(
  5. filled: true,
  6. fillColor: Color(0xFFfef7ec),
  7. enabledBorder: const OutlineInputBorder(
  8. borderSide: const BorderSide(color: Color(0xFFfef7ec), width: 0.0),
  9. ),
  10. ),
  11. )

注意

想要更改TextFormField下划线的颜色,需要更改Theme的primaryColor。

  1. Theme(
  2. data: ThemeData(primaryColor: Color(0xFFffc542)),
  3. child: ...
  4. )