Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aniketambore/Flutter-Blockchain
Flutter and Blockchain DAPPS
https://github.com/aniketambore/Flutter-Blockchain
blockchain dapp ethereum flutter solidity web3dart
Last synced: about 2 months ago
JSON representation
Flutter and Blockchain DAPPS
- Host: GitHub
- URL: https://github.com/aniketambore/Flutter-Blockchain
- Owner: aniketambore
- Archived: true
- Created: 2021-02-09T14:07:31.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-28T04:40:36.000Z (about 1 year ago)
- Last Synced: 2024-08-05T08:08:57.717Z (5 months ago)
- Topics: blockchain, dapp, ethereum, flutter, solidity, web3dart
- Language: Dart
- Homepage:
- Size: 8.61 MB
- Stars: 148
- Watchers: 4
- Forks: 57
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This project is meant for those with a basic knowledge of Ethereum and smart contracts, who have some knowledge of the Flutter framework but are new to mobile dapps.
# [Flutter and Blockchain](https://github.com/aniketambore/Flutter-Blockchain)
## Table of Contents
- [Setting up the development environment](#setting-up-the-development-environment)
- [Directory Structure](#directory-structure)
- [Compiling and Migrating Smart Contract](#compiling-and-migrating-smart-contract)
- [Testing the Smart Contract](#testing-the-smart-contract)
- [Contract Linking](#contract-linking)
- [DAPPS](#dapps)
- [Tutorials](#tutorials)
- [Contributing](#contributing)## Setting up the development environment
Truffle is the most popular development framework for Ethereum with a mission to make your life a whole lot easier. But before we install truffle make sure to install [**node**](https://nodejs.org/en/) .
Once we have node installed, we only need one command to install Truffle:
**`npm install -g truffle`**We will also be using [**Ganache**](http://truffleframework.com/ganache), a personal blockchain for Ethereum development you can use to deploy smart contracts, develop applications, and run tests. You can download Ganache by navigating to http://truffleframework.com/ganache and clicking the “Download” button.
## Directory Structure
- **contracts/** : Contains solidity contract file.
- **migrations/** : Contains migration script files (Truffle uses a migration system to handle contract deployment).
- **test/** : Contains test script files.
- **truffle-config.js** : Contains truffle deployment configurations information.## Compiling and Migrating Smart Contract
### Compilation
In the terminal, make sure you are in the root of the directory that contains the flutter and truffle project, Run the following command:
**`truffle compile`**You should see output similar to the following:
### Migration
Before we can migrate our contract to the blockchain, we need to have a blockchain running.
We’re going to use **Ganache**, a personal blockchain for Ethereum development you can use to deploy contracts,
develop applications, and run tests.
If you haven’t already, download [**Ganache**](http://truffleframework.com/ganache) and double-click the icon to launch the application. This will generate a blockchain running locally on port 7545.
- Migrating the contract to the blockchain, run: **`truffle migrate`**
You should see output similar to the following:
- Take a look into the Ganache, the first account originally had 100 ether, it is now lower, due to the transaction costs of migration.
## Testing the Smart Contract
- Running the test as: **`truffle test`**
- If all the test pass, you’ll see the console output similar to this:
## Contract Linking
```
📁 project(eg. helloworld,bidder,...)
📁 lib
🎯 contract_linking.dart
- Update _rpcUrl, _wsUrl, _privateKey as per your needs.
```
- You can get the RPC URL from the ganache :
- Get the Private Key from ganache:
- After Contract Linking, Just run the Flutter Project.
## DAPPS
Hello World Dapp | Population Dapp |
:--------------------------------------------------------------------------:|:------------------------------------------------------------------------:|
| |Bidder | Minter |
:---------------------------------------------------------------:|:----------------------------------------------------------------:|
| |Cat Adoption | Election |
:--------------------------------------------------------------------------:|:-----------------------------------:|
| |## Tutorials
- [Flutter and Blockchain – Hello World Dapp](https://www.geeksforgeeks.org/flutter-and-blockchain-hello-world-dapp/)
- [Flutter and Blockchain – Population Dapp](https://www.geeksforgeeks.org/flutter-and-blockchain-population-dapp/)## Contributing:
- Fork it!
- Create your feature branch: `git checkout -b my-new-feature`
- Commit your changes: `git commit -am 'Add some feature'`
- Push to the branch: `git push origin my-new-feature`
- Submit a pull request.Show some ❤ and star the repo to support the project