width: 57,
height: 57,
decoration: BoxDecoration(
color: Color.fromARGB(255, 111, 124, 132),
boxShadow: [
BoxShadow(
color: Color.fromARGB(44, 29, 30, 32),
offset: Offset(2, 2),
blurRadius: 3,
),
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Container(),
)
/// 更改后的代码
Container(
width: 57,
height: 57,
decoration: BoxDecoration(
color: Color.fromARGB(255, 111, 124, 132),
boxShadow: [
BoxShadow(
color: Color.fromARGB(44, 29, 30, 32),
offset: Offset(2, 2),
blurRadius: 3,
),
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: TextField(
style: TextStyle(
color: Color.fromARGB(255, 0, 0, 0),
fontWeight: FontWeight.w400,
fontSize: 12,
),
maxLines: 1,
autocorrect: false,
),
)
还是可以的,只要稍加修改就可以使用。
从上面的代码来看,Spuernova
虽然生成的代码不能直接使用,但是到小组件级别还是可是省不少气力的。
个人认为最好用的其实是帮我们把UI里面的样式全部提取了出来,放在values
目录下:
// colors.dart
import ‘dart:ui’;
class AppColors {
static const Color primaryBackground = Color.fromARGB(255, 38, 173, 211);
static const Color secondaryBackground = Color.fromARGB(255, 36, 38, 44);
static const Color ternaryBackground = Color.fromARGB(255, 74, 78, 122);
static const Color primaryElement = Color.fromARGB(255, 38, 43, 47);
static const Color secondaryElement = Color.fromARGB(255, 243, 64, 61);
static const Color accentElement = Col