答案 0 :(得分:0)
您可以使用容器作为背景,例如使用Linear Gradient来实现以下目的:
Container(
decoration: ShapeDecoration(
gradient: LinearGradient(
colors: [Color(0xFFe6dfd8), Color(0xFFf7f5ec)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: [0.0, 0.4],
tileMode: TileMode.clamp,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
),
child: TextField(
expands: false,
style: TextStyle(fontSize: 20.0, color: Colors.black54),
decoration: InputDecoration(
contentPadding: EdgeInsets.all(12.0),
prefixIcon: Icon(
Icons.email,
color: Colors.black54,
),
hintText: 'email',
hintStyle: TextStyle(color: Colors.black54),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(32.0),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(32.0),
),
),
),
);
您可以使用Radial Gradient,Box Shadow或@Jakk所说的Neumorphic形状来改善效果。
希望有帮助。