Add the breez_sdk_spark_flutter as a dependency in your pubspec file.
dependencies:
breez_sdk_spark_flutter:
git:
url: https://github.com/breez/breez-sdk-spark-flutterTo start using this package first import it in your Dart file.
import 'package:breez_sdk_spark_flutter/breez_sdk_spark.dart';
Future<void> main() async {
await BreezSdkSparkLib.init();
...
}Extending the Config to set the API key:
extension ConfigCopyWith on Config {
Config copyWith({
String? apiKey,
Network? network,
int? syncIntervalSecs,
Fee? maxDepositClaimFee,
}) {
return Config(
apiKey: apiKey ?? this.apiKey,
network: network ?? this.network,
syncIntervalSecs: syncIntervalSecs ?? this.syncIntervalSecs,
maxDepositClaimFee: maxDepositClaimFee ?? this.maxDepositClaimFee,
);
}
}Please refer to Flutter examples on Breez SDK - Nodeless (Spark Implementation) documentation for more information on how to use the SDK.