var creationId = Random().nextInt(1000000); print(creationId); var fcmToken = await PushNotificationService().getFCMToken(); var url = "https://sendnewimagecreation-gehtwzctpa-uc.a.run.app"; var httpClient = HttpClient(); Map body = { "endpoint": "fal-ai/luma-dream-machine/image-to-video", "input": { "prompt": "Make them hug", "image_url": imageUrl, }, "fcmtoken": fcmToken, "language": "en", "creationId": creationId, "webHookUrl": "https://imagecreated-gehtwzctpa-uc.a.run.app", }; //Add headers to the request var request = await httpClient.postUrl(Uri.parse(url)); request.headers.add("Content-Type", "application/json"); request.headers.add("X-Api-Key", "G9twHKFQd3t4WJceiDhE2TI72LhsmBZC0UzSYVxUdUCuTRz1"); request.write(jsonEncode(body)); var response = await request.close(); print(response.statusCode); // Read the response StreamTransformer, String> transformer = const Utf8Decoder(); response.transform(transformer).listen((data) { print(data); });