'How to make changes in project json file in flutter?

I need to update my Stripe Public Key which get from api

 var jsonText = await rootBundle.loadString('assets/google_pay_payment_profile.json');
 data.value = json.decode(jsonText);
 data['data']['allowedPaymentMethods'][0]['tokenizationSpecification']
     ['parameters']['stripe:publishableKey'] = LocalStorage.stripePublicKey;

I make change in data but how to push this changes in json file?



Sources

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

Source: Stack Overflow

Solution Source