Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/buidly/flutter-template


https://github.com/buidly/flutter-template

Last synced: 17 days ago
JSON representation

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.