mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 17:46:24 +08:00
tweaks (#1142)
* opt: unused layout * mod: semantics * opt: DanmakuMsg type * opt: avoid cast * opt: unnecessary_lambdas * opt: use isEven * opt: logger * opt: invalid common page * tweak * opt: unify DynController
This commit is contained in:
committed by
GitHub
parent
56ffc2781f
commit
5f8313901b
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
|
||||
class SimpleVoteInfo {
|
||||
int? choiceCnt;
|
||||
int? defaultShare;
|
||||
@@ -73,7 +75,7 @@ class VoteInfo extends SimpleVoteInfo {
|
||||
title = json['title'];
|
||||
uid = json['vote_publisher'];
|
||||
ctime = json['ctime'];
|
||||
myVotes = (json['my_votes'] as List?)?.cast(); // doVote
|
||||
myVotes = (json['my_votes'] as List?)?.fromCast(); // doVote
|
||||
options =
|
||||
(json['options'] as List?)?.map((v) => Option.fromJson(v)).toList() ??
|
||||
<Option>[];
|
||||
@@ -87,7 +89,7 @@ class VoteInfo extends SimpleVoteInfo {
|
||||
|
||||
factory VoteInfo.fromSeparatedJson(Map<String, dynamic> json) {
|
||||
return VoteInfo.fromJson(json['vote_info'])
|
||||
..myVotes = (json['my_votes'] as List?)?.cast(); // voteInfo
|
||||
..myVotes = (json['my_votes'] as List?)?.fromCast(); // voteInfo
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
||||
Reference in New Issue
Block a user