mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-10 03:57:39 +08:00
feat: change icons
This commit is contained in:
@@ -59,26 +59,37 @@ class _TvDetailsPageState extends ConsumerState<TvDetailsPage> {
|
|||||||
Opacity(
|
Opacity(
|
||||||
opacity: 0.7,
|
opacity: 0.7,
|
||||||
child: ep.status == "downloading"
|
child: ep.status == "downloading"
|
||||||
? const Icon(Icons.cloud_download)
|
? const Icon(Icons.downloading)
|
||||||
: (ep.status == "downloaded"
|
: (ep.status == "downloaded"
|
||||||
? const Icon(Icons.cloud_done)
|
? const Icon(Icons.download_done)
|
||||||
: const Icon(Icons.cloud_off))),
|
: const Icon(Icons.cloud_off))),
|
||||||
),
|
),
|
||||||
DataCell(IconButton(
|
DataCell(Row(
|
||||||
onPressed: () async {
|
children: [
|
||||||
var f = ref
|
IconButton.filledTonal(
|
||||||
.read(seriesDetailsProvider(seriesId).notifier)
|
onPressed: () async {
|
||||||
.searchAndDownload(seriesId, ep.seasonNumber!,
|
var f = ref
|
||||||
ep.episodeNumber!);
|
.read(
|
||||||
setState(() {
|
seriesDetailsProvider(seriesId).notifier)
|
||||||
_pendingFuture = f;
|
.searchAndDownload(seriesId, ep.seasonNumber!,
|
||||||
});
|
ep.episodeNumber!);
|
||||||
if (!Utils.showError(context, snapshot)) {
|
setState(() {
|
||||||
var name = await f;
|
_pendingFuture = f;
|
||||||
Utils.showSnakeBar(context, "开始下载: $name");
|
});
|
||||||
}
|
if (!Utils.showError(context, snapshot)) {
|
||||||
},
|
var name = await f;
|
||||||
icon: const Icon(Icons.search)))
|
if (context.mounted) {
|
||||||
|
Utils.showSnakeBar(context, "开始下载: $name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.search)),
|
||||||
|
const SizedBox(width: 10,),
|
||||||
|
IconButton.filledTonal(
|
||||||
|
onPressed: () {},
|
||||||
|
icon: const Icon(Icons.manage_search))
|
||||||
|
],
|
||||||
|
))
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (m[ep.seasonNumber] == null) {
|
if (m[ep.seasonNumber] == null) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static showSnakeBar(BuildContext context, String msg) {
|
static showSnakeBar(BuildContext context, String msg) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg)));
|
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg), showCloseIcon: true,));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool showError(BuildContext context, AsyncSnapshot snapshot) {
|
static bool showError(BuildContext context, AsyncSnapshot snapshot) {
|
||||||
|
|||||||
Reference in New Issue
Block a user