zubairehman / flutter_boilerplate_project

A boilerplate project created in flutter using MobX and Provider.
http://zubairehman.surge.sh/
MIT License
2.26k stars 908 forks source link

How to Add Dynamic AppKey and SecretKey at Interceptor #85

Closed wahyukodar closed 3 years ago

wahyukodar commented 3 years ago

If there two endpoint type (public api and private api)

for public api is not required for appKey and secretKey for private api it's required to include appKey, secretKey, custom Header param, and build signature param HASH_MAC

Thanks in advance.

zubairehman commented 3 years ago

Hi @wahyukodar,

You can check the request type and add your headers based on that. Please have a look at this file: https://github.com/zubairehman/flutter-boilerplate-project/blob/1df9b861504a04a4b748ec281eb28be4b82d6e98/lib/di/module/network_module.dart#L31

Thanks.