Flutter blockchain explorer app. Riverpod, Dio, GoRouter. Dashboard, block explorer, wallet management, mining.
| lib | ||
| .gitignore | ||
| CLAUDE.md | ||
| pubspec.yaml | ||
| README.md | ||
blockchain-flutter
Flutter app for blockchain explorer, wallet management, and mining. Connects to the blockchain node via REST API.
Architecture
Clean Architecture with feature-based organization:
lib/
├── main.dart
├── core/
│ ├── network/
│ │ └── api_client.dart # Dio HTTP client setup
│ ├── theme/
│ │ └── app_theme.dart # Dark theme, crypto aesthetic
│ └── utils/
│ └── formatters.dart # Amount, hash, date formatting
├── features/
│ ├── dashboard/ # Home: chain stats, recent blocks
│ │ ├── dashboard_screen.dart
│ │ └── dashboard_provider.dart
│ ├── blocks/ # Block explorer (list + detail)
│ │ ├── blocks_screen.dart
│ │ ├── block_detail_screen.dart
│ │ └── blocks_provider.dart
│ ├── wallet/ # Create, view balance, list wallets
│ │ ├── wallet_screen.dart
│ │ └── wallet_provider.dart
│ ├── transactions/ # Send tx, pending list
│ │ ├── transactions_screen.dart
│ │ ├── send_tx_screen.dart
│ │ └── transactions_provider.dart
│ └── mining/ # Mine button, difficulty info
│ ├── mining_screen.dart
│ └── mining_provider.dart
└── routing/
└── app_router.dart # GoRouter navigation
Tech Stack
| Component | Choice | Rationale |
|---|---|---|
| State management | Riverpod | Less boilerplate than BLoC, familiar |
| HTTP client | Dio | Interceptors, retry support |
| Navigation | GoRouter | Declarative routing |
| Models | Freezed + json_serializable | Immutable data classes |
| Secure storage | flutter_secure_storage | Wallet private keys |
| Charts | fl_chart | Chain visualization |
| Real-time | Polling (5-10s) | Simple, no WebSocket needed |
Features
- Dashboard: chain height, difficulty, block reward, recent blocks
- Block Explorer: browse blocks, view transactions per block
- Wallet: generate keypairs, check balances, manage multiple wallets
- Transactions: send signed transactions, view pending pool
- Mining: one-tap mining, difficulty display, reward info
Screens
- Dashboard - overview with chain stats and recent activity
- Blocks - paginated block list with expandable details
- Block Detail - full block info with transaction list
- Wallets - wallet list with balances, create new
- Send Transaction - form: from, to, amount, sign & submit
- Pending Transactions - current mempool
- Mining - mine button with result display
Quick Start
# Install dependencies
flutter pub get
# Generate code (Freezed models)
dart run build_runner build --delete-conflicting-outputs
# Run (blockchain-node must be running on localhost:3000)
flutter run
# Run on web
flutter run -d chrome
Configuration
Node URL is configured in lib/core/network/api_client.dart. Defaults to http://localhost:3000.
For Android emulator, use http://10.0.2.2:3000 to reach host localhost.
Related Repos
- blockchain-core - Core library + REST API node
- blockchain-cli - Rust CLI tool
License
MIT