PollTally constructor
PollTally(
- dynamic proposals
Create a Poll Tally from a List<List
Implementation
PollTally(dynamic proposals) {
if (proposals is Iterable) {
for (final proposal in proposals) {
if (proposal is ProposalTally) {
this.proposals.add(proposal);
} else if (proposal is List<int>) {
this.proposals.add(ProposalTally(proposal));
} else if (proposal is List<num>) {
this.proposals.add(ProposalTally(proposal as List<int>));
} else {
throw Exception('PollTally expects a List<ProposalTally>.');
}
}
} else {
throw Exception('PollTally expects a List<List<int>>.');
}
}