Skip to main content
Version: Next

Flutter Quickstart

Install​

dependencies:
echomirror_sdk: ^0.1.0

Initialize​

import 'package:echomirror_sdk/echomirror_sdk.dart';

void main() async {
await EchoMirror.initialize(
apiKey: 'your_api_key',
network: StellarNetwork.testnet,
);
runApp(const MyApp());
}

Query balances and mood streaks​

final balance = await EchoMirror.instance.stellar.getBalance(publicKey);
final streak = await EchoMirror.instance.mood.getStreak();

Real-time blockchain sync​

final sync = BlockchainSyncClient(EchoMirror.instance.config);
sync.watch(publicKey).listen((event) {
if (event is LedgerSyncEvent) {
print('New ledger: ${event.ledgerSequence}');
}
});

Next steps​