-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Vote referendum logic * voice model handling referendum voice * Igonre added * Igonre removed * Ignore2 * add referendum condition to show status label * Fix vote model serialization for referendums votes
- Loading branch information
1 parent
102c351
commit dbb2d87
Showing
12 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletions
11
...ore_screens/vote_screens/proposal_details/interactor/usecases/vote_proposal_use_case.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import 'package:async/async.dart'; | ||
import 'package:seeds/datasource/local/settings_storage.dart'; | ||
import 'package:seeds/datasource/remote/api/proposals_repository.dart'; | ||
import 'package:seeds/screens/explore_screens/vote_screens/proposals/viewmodels/proposal_view_model.dart'; | ||
|
||
class VoteProposalUseCase { | ||
Future<Result> run({required int id, required int amount}) { | ||
return ProposalsRepository().voteProposal(id: id, amount: amount, accountName: settingsStorage.accountName); | ||
Future<Result> run({required ProposalViewModel proposal, required int amount}) { | ||
final ProposalsRepository _proposalsRepository = ProposalsRepository(); | ||
final String accountName = settingsStorage.accountName; | ||
if (proposal.proposalCategory == ProposalCategory.referendum) { | ||
return _proposalsRepository.voteReferendum(id: proposal.id, amount: amount, accountName: accountName); | ||
} else { | ||
return _proposalsRepository.voteProposal(id: proposal.id, amount: amount, accountName: accountName); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters