{"id":19816366,"url":"https://github.com/vocdoni/dvote-flutter","last_synced_at":"2026-01-11T04:41:19.833Z","repository":{"id":53910269,"uuid":"307518647","full_name":"vocdoni/dvote-flutter","owner":"vocdoni","description":"Decentralized, end-to-end verifiable governance platform client library for Dart.","archived":false,"fork":false,"pushed_at":"2021-04-14T20:38:12.000Z","size":521,"stargazers_count":11,"open_issues_count":6,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-06T12:46:02.625Z","etag":null,"topics":["flutter","vote","vote-application","voting","voting-app","voting-application","voting-system"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vocdoni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-26T22:18:55.000Z","updated_at":"2023-09-27T05:31:53.000Z","dependencies_parsed_at":"2022-08-13T04:01:10.689Z","dependency_job_id":null,"html_url":"https://github.com/vocdoni/dvote-flutter","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vocdoni%2Fdvote-flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vocdoni%2Fdvote-flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vocdoni%2Fdvote-flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vocdoni%2Fdvote-flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vocdoni","download_url":"https://codeload.github.com/vocdoni/dvote-flutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251860300,"owners_count":21655713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","vote","vote-application","voting","voting-app","voting-application","voting-system"],"created_at":"2024-11-12T10:09:17.767Z","updated_at":"2026-01-11T04:41:19.805Z","avatar_url":"https://github.com/vocdoni.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DVote Flutter\n\nA Flutter plugin that provides communication capabilities to interact with decentralized governance processes running on the Vocdoni platform.\n\nIt provides Dart libraries as well as native modules written in Go.\n\nMore details: https://pub.dev/packages/dvote\n\n# DVote example\n\n- [DVote Flutter](#dvote-flutter)\n- [DVote example](#dvote-example)\n  - [Getting Started](#getting-started)\n  - [Entity API](#entity-api)\n  - [Process API](#process-api)\n  - [File API](#file-api)\n  - [Data models and storage](#data-models-and-storage)\n    - [Classes](#classes)\n    - [Parsers](#parsers)\n  - [Example](#example)\n  - [Development](#development)\n\n## Getting Started\nImport the Dart library on your project and use the static functions available on the `Dvote` class\n\n```dart\nimport 'package:dvote/dvote.dart';\n```\n\n## Entity API\nUse a Vocdoni Gateway to fetch the metadata of an Entity\n\n```dart\nimport 'package:dvote/dvote.dart';\n\nEntityReference entityRef = EntityReference();\nentityRef.entityId = \"0x1234...\";\n\nfinal gwInfo = await getRandomDefaultGatewayInfo(\"goerli\");\nfinal DVoteGateway dvoteGw = DVoteGateway(gwInfo.dvote, publicKey: gwInfo.publicKey);\nfinal Web3Gateway web3Gw = Web3Gateway(gwInfo.web3);\n\nfinal entityMeta = await fetchEntity(entityRef, dvoteGw, web3Gw);\ndvoteGw.disconnect();\n```\n\n## Process API\nUse a Vocdoni Gateway to fetch the active voting processes of an Entity\n\n```dart\nimport 'package:dvote/dvote.dart';\n\nEntityReference entityRef = EntityReference();\nentityRef.entityId = \"0x1234...\";\n\nfinal gwInfo = await getRandomDefaultGatewayInfo(\"goerli\");\nfinal DVoteGateway dvoteGw = DVoteGateway(gwInfo.dvote, publicKey: gwInfo.publicKey);\nfinal Web3Gateway web3Gw = Web3Gateway(gwInfo.web3);\n\n// A specific Voting Process\nfinal pid = \"0x1234...\";\nfinal ProcessMetadataprocessMeta = await getProcessMetadata(pid, dvoteGw, web3Gw);\n\ndvoteGw.disconnect();\n```\n\n## File API\nUse a Vocdoni Gateway to fetch static content from the net\n\n```dart\nimport 'package:dvote/dvote.dart';\n\nfinal gwInfo = await getRandomDefaultGatewayInfo(\"goerli\");\nfinal DVoteGateway dvoteGw = DVoteGateway(gwInfo.dvote, publicKey: gwInfo.publicKey);\nfinal Web3Gateway web3Gw = Web3Gateway(gwInfo.web3);\n\nfinal contentUri = ContentURI(\"ipfs://QmSsfizN4rpSDLRZw3X3WooCPpnBktZ5bEShvmLZuf88iw,https://my-server/file.txt\");\n\nfinal content = await fetchFileString(contentUri, dvoteGw, web3Gw);\n```\n\n## Data models and storage\n\nDVote Flutter exports multiple Dart classes that allow to wrap, parse, serialize and deserialize the most relevant data schemes used within the platform.\n\n```dart\nimport 'package:dvote/dvote.dart';\n\n// Parse from JSON\nEntity entity = parseEntityMetadata(\"{ ... }\");\nprint(entity.name[\"en\"]);\nprint(entity.media.avatar);\n\n// Serialize into a binary file\nFile file1 = File(\"./my-entity.dat\");\nfile1.writeAsBytes(entity.writeToBuffer());\n\n// Reading back from a file\nFile file3 = File(\"./my-entity.dat\");\nfinal entityBytes = await file3.readAsBytes();\nEntity entity2 = Entity.fromBuffer(entityBytes);\nprint(entity2.name[\"en\"]);\n\n// Storing a collection of entities\nEntitiesStore store = EntitiesStore();\nstore.entities.addAll([entity, entity2]);\nFile file2 = File(\"./entities.dat\");\nawait file2.writeAsBytes(store.writeToBuffer());\n```\n\n### Classes\n\nThe following classes are exported:\n\n- Entity\n  - EntityMetadataStore\n  - EntityMetadata\n  - EntityMetadata_VotingProcesses\n  - EntityMetadata_Media\n  - EntityMetadata_Action\n  - EntityMetadata_Action_ImageSource\n  - EntityMetadata_EntityReference\n- Process\n  - ProcessMetadataStore\n  - ProcessMetadata\n  - ProcessMetadata_Question\n  - ProcessMetadata_Question_VoteOption\n- Feed\n  - FeedsStore\n  - Feed\n  - FeedPost\n  - FeedPost_Author\n- Gateway\n  - BootNodeGateways\n  - BootNodeGateways_NetworkNodes\n  - BootNodeGateways_NetworkNodes_DVote\n  - BootNodeGateways_NetworkNodes_Web3\n- Identity\n  - IdentitiesStore\n  - Identity\n  - Identity_Type\n  - Identity_Peers\n  - Identity_Claim\n  - PeerIdentity\n  - PeerIdentity_Type\n- Key\n\n### Parsers\n\nRaw JSON data can't be directly serialized into a Protobuf object. For this reason, several parsers are provided:\n\n- `EntityMetadata parseEntityMetadata(String json)`\n  - `List\u003cEntity_Action\u003e parseEntityActions(List actions)`\n  - `List\u003cEntity_EntityReference\u003e parseEntityReferences(List entities)`\n- `ProcessMetadata parseProcessMetadata(String json)`\n  - `List\u003cProcessMetadata_Question\u003e _parseQuestions(List items)`\n- `ProcessResults parseProcessResults(Map\u003cString, dynamic\u003e response)`\n- `ProcessResultsDigested parseProcessResultsDigestedSingleQuestion(ProcessResults rawResults, ProcessMetadata processMetadata, ProcessData processData)`\n- `ProcessResultsDigested parseProcessResultsDigestedMultiQuestion(ProcessResults rawResults, ProcessMetadata processMetadata, ProcessData processData)`\n- `Feed parseFeed(String json)`\n- `BootNodeGateways parseBootnodeInfo(String json)`\n  - `BootNodeGateways_NetworkNodes _parseBootnodeNetworkItems(Map item)` \n\n## Example\n\n- See `example/lib/main.dart` for a usage example.\n\n## Development\n\n- Clone the git repo\n- Run `flutter pub get`\n- Run `git submodule update --init --recursive` to fetch the protobuf subrepo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvocdoni%2Fdvote-flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvocdoni%2Fdvote-flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvocdoni%2Fdvote-flutter/lists"}