feat:更新Card样式

This commit is contained in:
2025-11-19 22:48:25 +08:00
parent 5151430132
commit e6ee934a3e
5 changed files with 32 additions and 33 deletions

View File

@@ -15,7 +15,7 @@ Widget formLabelText({required String labelText, bool isRequired = false}) {
}
InputDecoration formInputDecoration({
required String hintText, // 使用命名参数并标记为必填
required String hintText,
IconData? prefixIcon,
}) {
return InputDecoration(
@@ -38,9 +38,9 @@ Widget buildCard({required BuildContext context, required Widget child}) {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: colors.outline.withAlpha(50)),
// border: Border.all(color: colors.outline.withAlpha(50)),
),
child: Padding(padding: EdgeInsets.all(10 ), child: child),
child: Padding(padding: EdgeInsets.all(10), child: child),
),
);
}
@@ -181,7 +181,7 @@ Widget buildLoadingIndicator(BuildContext context) {
child: Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: colors.surface,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(color: Colors.black12, blurRadius: 8, offset: Offset(0, 2)),

View File

@@ -18,6 +18,7 @@ class _RecipeCalendarState extends State<RecipeCalendar> {
return TableCalendar(
locale: 'zh_CN',
headerStyle: const HeaderStyle(
headerPadding: EdgeInsets.symmetric(vertical: 0),
formatButtonVisible: false,
titleCentered: true,
),

View File

@@ -36,39 +36,34 @@ class _RecipeListState extends State<RecipeList> {
padding: EdgeInsets.symmetric(horizontal: 16),
child: DropdownButton<String>(
value: provider.queryCategory,
hint: Text(
'请选择菜谱类别',
style: TextStyle(color: Colors.grey[500]),
),
hint: Text('请选择菜谱类别', style: TextStyle(color: Colors.grey[500])),
isExpanded: true,
borderRadius: BorderRadius.circular(12),
dropdownColor: Colors.white,
elevation: 6,
underline: Container(),
items: provider.categoryList.map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Row(
children: [
Container(
width: 8,
height: 8,
decoration: BoxDecoration(
color: colors.primary,
shape: BoxShape.circle,
),
items:
provider.categoryList.map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Row(
children: [
Container(
width: 8,
height: 8,
decoration: BoxDecoration(
color: colors.primary,
shape: BoxShape.circle,
),
),
SizedBox(width: 8),
Expanded(
child: Text(value, style: TextStyle(fontSize: 14)),
),
],
),
SizedBox(width: 8),
Expanded(
child: Text(
value,
style: TextStyle(fontSize: 14),
),
)
],
),
);
}).toList(),
);
}).toList(),
onChanged: (value) {
setState(() {
provider.queryCategory = value!;
@@ -86,6 +81,7 @@ class _RecipeListState extends State<RecipeList> {
return Column(
children: [
_buildSelectCategory(provider),
SizedBox(height: 5),
Expanded(
child: ListView.builder(
itemCount: provider.recipeSummaryList.length,