Flutter / Dart Native Integration
Native Dart HTTP client and strongly-typed models for Flutter apps.
Mobile App SDKs
Connect Flutter cross-platform applications to the BaZi calculation engine using a native Dart HTTP client.
Quick Start
Dart BaziClient Implementation
Dart
import 'package:http/http.dart' as http;
import 'dart:convert';
class BaziClient {
final String apiKey;
BaziClient({required this.apiKey});
Future<Map<String, dynamic>> calculate({required String birthDate, required String birthTime, required String gender}) async {
final res = await http.post(
Uri.parse('https://api.baziapi.pro/api/v1/bazi/calculate'),
headers: {'x-api-key': apiKey, 'Content-Type': 'application/json'},
body: jsonEncode({'birthDate': birthDate, 'birthTime': birthTime, 'gender': gender}),
);
return jsonDecode(res.body)['data'];
}
}Something unclear? Contact developer support.