mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-05 17:37:37 +08:00
feat: change icons
This commit is contained in:
@@ -59,26 +59,37 @@ class _TvDetailsPageState extends ConsumerState<TvDetailsPage> {
|
||||
Opacity(
|
||||
opacity: 0.7,
|
||||
child: ep.status == "downloading"
|
||||
? const Icon(Icons.cloud_download)
|
||||
? const Icon(Icons.downloading)
|
||||
: (ep.status == "downloaded"
|
||||
? const Icon(Icons.cloud_done)
|
||||
? const Icon(Icons.download_done)
|
||||
: const Icon(Icons.cloud_off))),
|
||||
),
|
||||
DataCell(IconButton(
|
||||
onPressed: () async {
|
||||
var f = ref
|
||||
.read(seriesDetailsProvider(seriesId).notifier)
|
||||
.searchAndDownload(seriesId, ep.seasonNumber!,
|
||||
ep.episodeNumber!);
|
||||
setState(() {
|
||||
_pendingFuture = f;
|
||||
});
|
||||
if (!Utils.showError(context, snapshot)) {
|
||||
var name = await f;
|
||||
Utils.showSnakeBar(context, "开始下载: $name");
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.search)))
|
||||
DataCell(Row(
|
||||
children: [
|
||||
IconButton.filledTonal(
|
||||
onPressed: () async {
|
||||
var f = ref
|
||||
.read(
|
||||
seriesDetailsProvider(seriesId).notifier)
|
||||
.searchAndDownload(seriesId, ep.seasonNumber!,
|
||||
ep.episodeNumber!);
|
||||
setState(() {
|
||||
_pendingFuture = f;
|
||||
});
|
||||
if (!Utils.showError(context, snapshot)) {
|
||||
var name = await f;
|
||||
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) {
|
||||
|
||||
@@ -29,7 +29,7 @@ class Utils {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user