feat:更新图表模块

This commit is contained in:
2025-07-27 22:28:04 +08:00
parent a2ed0f3d98
commit 34780651a8
7 changed files with 305 additions and 115 deletions

View File

@@ -3,6 +3,7 @@ import 'package:food_hub_app/api/recipe.dart';
import 'package:food_hub_app/models/recipe.dart';
import 'package:food_hub_app/utils/date_util.dart';
import 'package:food_hub_app/utils/index.dart';
import 'package:food_hub_app/widgets/common/index.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
@@ -145,12 +146,10 @@ class _RecipeCalendarState extends State<RecipeCalendar> {
],
),
),
SizedBox(width: 10),
TDButton(
icon: TDIcons.arrow_right,
type: TDButtonType.fill,
shape: TDButtonShape.circle,
theme: TDButtonTheme.primary,
circleIconButton(
context: context,
icon: Icons.chevron_right,
onPressed: () => {}
),
],
),

View File

@@ -4,7 +4,7 @@ import 'package:food_hub_app/config/app_config.dart';
import 'package:food_hub_app/models/recipe.dart';
import 'package:food_hub_app/widgets/common/image.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import 'package:food_hub_app/widgets/common/index.dart';
class RecipeCard extends StatelessWidget {
final Recipe recipe;
@@ -92,22 +92,15 @@ class RecipeCard extends StatelessWidget {
),
Row(
children: [
TDButton(
circleIconButton(
context: context,
icon: Icons.edit,
size: TDButtonSize.small,
type: TDButtonType.fill,
shape: TDButtonShape.circle,
theme: TDButtonTheme.primary,
onTap: () => {},
onPressed: () => {},
),
SizedBox(width: 10),
TDButton(
circleIconButton(
context: context,
icon: Icons.book,
size: TDButtonSize.small,
type: TDButtonType.fill,
shape: TDButtonShape.circle,
theme: TDButtonTheme.primary,
onTap: () => {},
onPressed: () => {},
),
],
),

View File

@@ -60,9 +60,15 @@ Widget timelineContainer(List<Record> recordList) {
builder: TimelineTileBuilder.connected(
itemCount: recordList.length,
connectorBuilder:
(context, index, type) => Connector.solidLine(thickness: 2),
(context, index, type) => Connector.solidLine(
thickness: 2,
color: Theme.of(context).primaryColor,
),
indicatorBuilder: (context, index) {
return Indicator.dot(size: 12.0);
return Indicator.dot(
size: 12.0,
color: Theme.of(context).primaryColor,
);
},
contentsBuilder: (context, index) {
return TimelineCard(record: recordList[index]);