How to use Environment Variables in Flutter with flutter_dotenv

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 35

  • @manueltylan827
    @manueltylan827 3 месяца назад

    Such an excellent way to explain things. The tutorial is a whole environment variable package!
    Kudos!🎉

  • @murilomedeiros8132
    @murilomedeiros8132 2 года назад +7

    Really good video, short and concise. Showed everything I needed to know about the package.

  • @vancityexe
    @vancityexe 2 года назад +1

    I was stuck on trying to figure this out for wayyy too long until I watched this. Thanks alot man!

  • @yordanyordanov4466
    @yordanyordanov4466 2 года назад +2

    HI, thank you for this video. If you don't add these to source control, how would you set them during the build time?

  • @isurujn
    @isurujn 2 года назад +2

    Thanks for this video. Short but covers everything from basics to advanced usage gradually.
    What's that theme you're using btw? Looks nice.

    • @paulhalliday
      @paulhalliday  2 года назад +2

      I use Pop and Lock (marketplace.visualstudio.com/items?itemName=Luxcium.pop-n-lock-theme-vscode) in this video. Here’s a link to all my uses: developer.school/uses

  • @AbinPS-ov5qp
    @AbinPS-ov5qp 5 месяцев назад +1

    Hi Paul, Is there any way to load API_KEYS from the .env file to the AndroidManifest.xml file? Can you guide me to store my GMap_API_KEY safely and retrieve it?

  • @AaronKelton
    @AaronKelton 2 года назад +2

    At 8:06 are the "release modes" just another way of saying "Flutter Flavors"? If so, would you call these release modes "inline flavors"? I.e. the flavor is handled in a single file conditional rather than in main_development.dart and main_production.dart, etc.
    I'm trying to determine if I even need to use flutter_dotenv if I instead use flutter_flavor. Would you recommend using one instead of the other? Or can both be used together complimentary?

    • @paulhalliday
      @paulhalliday  2 года назад +2

      Hey Aaron! In this circumstance, this would be separate from flavors.
      The release/profile/debug modes can be thought of as production/development build(s) that would have specific configurations.
      Flavors can be thought of as specific configurations of an app, so you’d want to take advantage of environment variables here too.
      That specific flavor can be in release/profile/debug mode depending on whether you’re building the application for production or local development.
      Hope that helps!

  • @ezhemati
    @ezhemati Год назад

    that is the best solution, thank you very much

  • @张哲-l5e
    @张哲-l5e Год назад +1

    Thanks. local PC works well. But when I run in GIT Actions,
    "Error detected in pubspec.yaml:
    No file or variants found for asset: .env."

    • @BlockCylinder
      @BlockCylinder 10 месяцев назад

      I would love to see this addressed. The whole thing can't really be used if the app won't build in the actual production environment.

  • @BlockCylinder
    @BlockCylinder 10 месяцев назад

    I have not implemented multiple environments but I have implemented flutter_dotenv and I've created a couple of variables including an API key. My .env file is on the .gitignore list.
    I'm trying to deploy via Netlify, and the build is failing because there is no .env file found. I plan to follow the guide in this video but I don't think it will help with this issue, will it?
    How can I implement environment variables in a Flutter app that work with Netlify or similar hosting services?

  • @cristhianandresapolocevall8905
    @cristhianandresapolocevall8905 2 года назад +1

    Greate! Thanks, but one question. For the flutter web, what's up?

    • @juanmacias5922
      @juanmacias5922 Год назад

      in my experience flutter web doesn't like the file to be named '.env' you need to call it 'dotenv' or something similar.

  • @ramzez_uk
    @ramzez_uk Год назад

    Wouldn't including all env files in the assets leak the dev environment in production? someone disaabmeling the files can get potentially exposure to all your environments ?

  • @realaliarain
    @realaliarain 2 года назад +1

    We really needed this thank you!

    • @paulhalliday
      @paulhalliday  2 года назад +1

      Glad it helped! Any other issues you’d like covering?

  • @javagladiator3476
    @javagladiator3476 Год назад

    awesome!!! thanks for sharing

  • @gergesnady557
    @gergesnady557 2 года назад

    Really good video , thank you so mush , 💖💖💖💖

  • @brokercl
    @brokercl Год назад

    great video thanks

  • @DholaSain
    @DholaSain 2 года назад

    What is it giving suggestions of code all around?

  • @ferdiangunawan1237
    @ferdiangunawan1237 2 года назад

    Thank you

  • @carlosalbertobotinacarpio5650
    @carlosalbertobotinacarpio5650 4 месяца назад

    awesome

  • @GustavoO64
    @GustavoO64 7 месяцев назад

    Please, i need to see the github, anyone else have the link?

  • @amsyary1
    @amsyary1 2 года назад

    great tutorial thanks man :)

  • @faisalfotoh1909
    @faisalfotoh1909 2 года назад

    please explain get_cli 1.7.1 at windos

  • @devillspdr
    @devillspdr 2 года назад +1

    why did you stop making flutter videos ?

  • @mustafasahin7867
    @mustafasahin7867 2 года назад +2

    VS Code Theme name ? please..

    • @KaBiL16
      @KaBiL16 Год назад

      material icons

  • @vicenterusso
    @vicenterusso 2 года назад

    totally unsafe. stay away from dotenv variables. easily decodable from app

  • @razifromli7828
    @razifromli7828 2 года назад +1

    tak membantu pun.
    dislike dislike dislike!!!

  • @DiegoPerez-qh4tm
    @DiegoPerez-qh4tm 2 года назад

    I needed this tutorial, thanks!!!