'Flutter JSON Stringfy to get below output

"{\n "checkout": {\n "address": "plot 123, kamloops road, Shopprite kalingalinga",\n "city": "Lusaka",\n "township": "Kalingalinga",\n "comment": "testing comment coming from the app, delete this",\n "country": "Zambia",\n "coupon_amount": "",\n "coupon_code": "",\n "currency": "ZMW",\n "customer_id": "50",\n "email": "[email protected]",\n "first_name": "Julius",\n "last_name": "Banda",\n "platform": "Android App",\n "house_no": "plot 172",\n "land_mark": "Near Kamloops Mall",\n "order_price": "37.00",\n "payment_data": {\n "status": "successful",\n "method": "cash",\n "amount": "32.00"\n },\n "payment_method": "employee",\n "phone_number": "09996404051",\n "products": [\n {\n "id": 684,\n "customer_id": 50,\n "products_id": 44,\n "customer_basket_quantity": 1,\n "final_price": 32,\n "is_order": true,\n "inventory_id": 53\n }\n ],\n "province": "Lusaka",\n "shipping_cost": "5.0",\n "shipping_method": "testing Shipping",\n "townswip": "Mtendere east"\n }\n}"



Solution 1:[1]

Try this

final value = json.decode("Your String");

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anandh Krishnan