mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-27 21:17:50 +08:00
feat: add tool tip
This commit is contained in:
@@ -25,7 +25,8 @@ class ActivityPage extends ConsumerWidget {
|
|||||||
DataColumn(label: Text("状态")),
|
DataColumn(label: Text("状态")),
|
||||||
DataColumn(label: Text("操作"))
|
DataColumn(label: Text("操作"))
|
||||||
],
|
],
|
||||||
source: ActivityDataSource(activities: activities, onDelete: onDelete(ref)),
|
source: ActivityDataSource(
|
||||||
|
activities: activities, onDelete: onDelete(ref)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -62,17 +63,27 @@ class ActivityDataSource extends DataTableSource {
|
|||||||
DataCell(() {
|
DataCell(() {
|
||||||
if (activity.status == "uploading") {
|
if (activity.status == "uploading") {
|
||||||
return const SizedBox(
|
return const SizedBox(
|
||||||
width: 20, height: 20, child: Tooltip(message: "正在上传到指定存储",child: CircularProgressIndicator(),) );
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: Tooltip(
|
||||||
|
message: "正在上传到指定存储",
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
));
|
||||||
} else if (activity.status == "fail") {
|
} else if (activity.status == "fail") {
|
||||||
return const Tooltip(message: "下载失败",child: Icon(
|
return const Tooltip(
|
||||||
|
message: "下载失败",
|
||||||
|
child: Icon(
|
||||||
Icons.close,
|
Icons.close,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
));
|
));
|
||||||
} else if (activity.status == "success") {
|
} else if (activity.status == "success") {
|
||||||
return const Tooltip(message: "下载成功",child: Icon(
|
return const Tooltip(
|
||||||
|
message: "下载成功",
|
||||||
|
child: Icon(
|
||||||
Icons.check,
|
Icons.check,
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
),) ;
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
double p =
|
double p =
|
||||||
@@ -85,7 +96,11 @@ class ActivityDataSource extends DataTableSource {
|
|||||||
progressColor: Colors.green,
|
progressColor: Colors.green,
|
||||||
);
|
);
|
||||||
}()),
|
}()),
|
||||||
DataCell(IconButton(onPressed:() => onDelete(activity.id!), icon: const Icon(Icons.delete)))
|
DataCell(Tooltip(
|
||||||
|
message: "删除任务",
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () => onDelete(activity.id!),
|
||||||
|
icon: const Icon(Icons.delete))))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user