Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buidly/flutter-template
https://github.com/buidly/flutter-template
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/buidly/flutter-template
- Owner: buidly
- Created: 2023-12-12T08:37:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-06T08:52:00.000Z (11 months ago)
- Last Synced: 2024-06-25T19:00:48.225Z (6 months ago)
- Language: Dart
- Size: 317 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flutter Template Readme
## Project Overview
This Flutter project serves as a template for connecting to xPortal and signing transactions. It supports three flavors: `dev` (devnet), `qa` (testnet), and `prod` (mainnet).
## Getting Started
To begin, use the following command to run the app:
```bash
flutter run --flavor
Replace with dev, qa, or prod based on your environment.
```## Connection and Authentication
Use the WalletConnectButton widget for connection and disconnection. If separate buttons are needed, interact directly with the WalletConnectBloc:
```bash
# To connect:
walletConnectBloc.add(const ConnectWalletEvent());# To disconnect:
walletConnectBloc.add(const DisconnectWalletEvent());# If you want to authenticate your requests, you can use native auth token:
SharedPreferences.getString(AppConstants.nativeAuthTokenKey);
```## Transaction Signing
Sign transactions with the SignTransactionButton widget. The TransactionBloc listens to the SignTransactionsEvent event, requiring a list of unsigned transactions.
Note: A dummy EGLD transfer transaction is hardcoded. To test, fill in the sender, receiver, and set the correct nonce for the sender:
```bash
Transaction(
nonce: 0, // set nonce of the sender
value: '1000000000000000',
sender: '', // Fill in sender address
receiver: '', // Fill in receiver address
gasPrice: 1000000000,
gasLimit: 70000,
data: '',
version: 1,
options: 0,
chainID: 'D',
)
```Feel free to adapt the template to meet your specific needs.