Official SDK for Flutter and Dart applications.
Flutter / Dart SDK
Flutter / Dart SDK
Official package for Flutter and Dart — iOS, Android, Web, and Desktop
The flasho_merchant_sdk package brings the full Flasho Merchant API to Flutter and Dart apps.
Install
Add to your pubspec.yaml:
dependencies:
flasho_merchant_sdk: ^1.0.0Then run:
flutter pub getOr for plain Dart:
dart pub getQuick start
import 'package:flasho_merchant_sdk/flasho_merchant_sdk.dart';
void main() async {
final flasho = FlashoClient(apiKey: 'flsh_YOUR_KEY');
// Load account, wallet, branches and pricing in one call
final data = await flasho.account.bootstrap();
print(data.account.walletBalance); // "10.000"
// Get a price quote
final quote = await flasho.pricing.calculate(
CalculatePriceRequest(
fromLatitude: 29.3764,
fromLongitude: 47.9785,
toLatitude: 29.3117,
toLongitude: 48.0034,
),
);
print('Fee: ${quote.price} KWD');
// Book a delivery
final delivery = await flasho.deliveries.create(
CreateDeliveryRequest(
customerName: 'Ahmed Ali',
customerNumber: '99887766',
pickupLatitude: 29.3764,
pickupLongitude: 47.9785,
deliveryLatitude: 29.3117,
deliveryLongitude: 48.0034,
),
);
print(delivery.orderNumber); // FLH4001
}Modules
flasho.account
Bootstrap, branches, wallet, pricing, and schedule settings.
flasho.deliveries
Create, list, track, and poll deliveries.
flasho.pricing
Calculate delivery price quotes.
flasho.auth
Email/password login for mobile apps.
pub.dev
The package is published at pub.dev/packages/flasho_merchant_sdk.