Skip to content

Instantly share code, notes, and snippets.

@theoctober19th
Created February 27, 2021 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theoctober19th/27c82959ad009be707d79e4252cadf6c to your computer and use it in GitHub Desktop.
Save theoctober19th/27c82959ad009be707d79e4252cadf6c to your computer and use it in GitHub Desktop.
  1. Clone the repo https://github.com/theoctober19th/cosmos_astrology at a different location somewhere in your machine. Create a new temporary branch and checkout to the branch.
  2. Run flutter pub get since a new package has been added (named flutter_dotenv)
  3. Create a file .env at the root of the project. (at the same level as pubspec.yaml file). This file will contain the credentials as environment variables, but it will not be tracked by git (already added to gitignore). Sample content of the file .env is:
ESEWA_CLIENT_ID='xxx'
ESEWA_SECRET_KEY='xxx'

KHALTI_PUBLIC_KEY='xxx'

This file will automatically be loaded in main method of the Flutter app, and will be available everywhere in the app as a map/dictionary. Wherever needed, just import 'package:flutter_dotenv/flutter_dotenv.dart'; and then use variables like env['ESEWA_CLIENT_ID'].

  1. Manually perform the changes you performed in this commit: https://github.com/theoctober19th/astrologer_v2/pull/3/files/a6700ecfca8579a10b7c850cdab68709b82df82f#diff-9526ccfd1d1813ed49c39f8c54dbeb512607376a007d824b905bc8b4e4d202d9R87

  2. git add the changes manually, ensuring that credentials have not been exposed in the code. Do not add .env file.

  3. Commit the changes and push to origin (temporary branch named same as the local branch)

  4. Create PR from that branch to payment-gateway-intregration-native.

  5. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment