mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
feat: change progress display
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:ui/providers/APIs.dart';
|
||||
import 'package:ui/providers/server_response.dart';
|
||||
|
||||
final tvWatchlistDataProvider = FutureProvider.autoDispose((ref) async {
|
||||
final dio = APIs.getDio();
|
||||
final dio = APIs.getDio();
|
||||
var resp = await dio.get(APIs.watchlistTvUrl);
|
||||
var sp = ServerResponse.fromJson(resp.data);
|
||||
List<MediaDetail> favList = List.empty(growable: true);
|
||||
@@ -155,22 +155,23 @@ class MediaDetail {
|
||||
String? resolution;
|
||||
int? storageId;
|
||||
String? airDate;
|
||||
String? status;
|
||||
int? monitoredNum;
|
||||
int? downloadedNum;
|
||||
|
||||
MediaDetail({
|
||||
this.id,
|
||||
this.tmdbId,
|
||||
this.mediaType,
|
||||
this.name,
|
||||
this.originalName,
|
||||
this.overview,
|
||||
this.posterPath,
|
||||
this.createdAt,
|
||||
this.resolution,
|
||||
this.storageId,
|
||||
this.airDate,
|
||||
this.status,
|
||||
});
|
||||
MediaDetail(
|
||||
{this.id,
|
||||
this.tmdbId,
|
||||
this.mediaType,
|
||||
this.name,
|
||||
this.originalName,
|
||||
this.overview,
|
||||
this.posterPath,
|
||||
this.createdAt,
|
||||
this.resolution,
|
||||
this.storageId,
|
||||
this.airDate,
|
||||
this.monitoredNum,
|
||||
this.downloadedNum});
|
||||
|
||||
MediaDetail.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
@@ -184,7 +185,8 @@ class MediaDetail {
|
||||
resolution = json["resolution"];
|
||||
storageId = json["storage_id"];
|
||||
airDate = json["air_date"];
|
||||
status = json["status"];
|
||||
monitoredNum = json["monitored_num"]??0;
|
||||
downloadedNum = json["download_num"]??0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class WelcomePage extends ConsumerWidget {
|
||||
))
|
||||
]
|
||||
: List.generate(value.length, (i) {
|
||||
var item = value[i];
|
||||
final item = value[i];
|
||||
return Card(
|
||||
margin: const EdgeInsets.all(4),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
@@ -68,14 +68,15 @@ class WelcomePage extends ConsumerWidget {
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
value: 1,
|
||||
color: item.status == "downloaded"
|
||||
color: item.downloadedNum ==
|
||||
item.monitoredNum
|
||||
? Colors.green
|
||||
: Colors.blue,
|
||||
),
|
||||
Text(
|
||||
item.name!,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
height: 2.5),
|
||||
|
||||
Reference in New Issue
Block a user