Flutter and Blockchain DAPPS
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 .
Once we have node installed, we only need one command to install Truffle:npm install -g truffle
We will also be using 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.
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:
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 and double-click the icon to launch the application. This will generate a blockchain running locally on port 7545.
truffle migrate
You should see output similar to the following:
truffle test
📁 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.
Hello World Dapp | Population Dapp | |
---|---|---|
![]() |
![]() |
Bidder | Minter | |
---|---|---|
![]() |
![]() |
Cat Adoption | Election | |
---|---|---|
![]() |
![]() |
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature