How to use Environment Variables in Flutter with flutter_dotenv

Поділитися
Вставка
  • Опубліковано 27 січ 2025

КОМЕНТАРІ •

  • @murilomedeiros8132
    @murilomedeiros8132 3 роки тому +7

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

  • @vancityexe
    @vancityexe 3 роки тому +1

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

  • @manueltylan827
    @manueltylan827 7 місяців тому

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

  • @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?

  • @AbinPS-ov5qp
    @AbinPS-ov5qp 8 місяців тому +2

    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?

  • @张哲-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 Рік тому

      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.

  • @ezhemati
    @ezhemati Рік тому

    that is the best solution, thank you very much

  • @AaronKelton
    @AaronKelton 3 роки тому +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  3 роки тому +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!

  • @realaliarain
    @realaliarain 3 роки тому +1

    We really needed this thank you!

    • @paulhalliday
      @paulhalliday  3 роки тому +1

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

  • @isurujn
    @isurujn 3 роки тому +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  3 роки тому +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

  • @cristhianandresapolocevall8905
    @cristhianandresapolocevall8905 2 роки тому +1

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

    • @juanmacias5922
      @juanmacias5922 2 роки тому

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

  • @javagladiator3476
    @javagladiator3476 Рік тому

    awesome!!! thanks for sharing

  • @BlockCylinder
    @BlockCylinder Рік тому

    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?

  • @gergesnady557
    @gergesnady557 2 роки тому

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

  • @ramzez_uk
    @ramzez_uk 2 роки тому

    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 ?

  • @amsyary1
    @amsyary1 3 роки тому

    great tutorial thanks man :)

  • @GustavoO64
    @GustavoO64 10 місяців тому

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

  • @brokercl
    @brokercl 2 роки тому

    great video thanks

  • @DholaSain
    @DholaSain 2 роки тому

    What is it giving suggestions of code all around?

  • @carlosalbertobotinacarpio5650
    @carlosalbertobotinacarpio5650 7 місяців тому

    awesome

  • @faisalfotoh1909
    @faisalfotoh1909 3 роки тому

    please explain get_cli 1.7.1 at windos

  • @mustafasahin7867
    @mustafasahin7867 2 роки тому +2

    VS Code Theme name ? please..

    • @KaBiL16
      @KaBiL16 Рік тому

      material icons

  • @ferdiangunawan1237
    @ferdiangunawan1237 2 роки тому

    Thank you

  • @devillspdr
    @devillspdr 2 роки тому +1

    why did you stop making flutter videos ?

  • @razifromli7828
    @razifromli7828 2 роки тому +1

    tak membantu pun.
    dislike dislike dislike!!!

  • @vicenterusso
    @vicenterusso 2 роки тому

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

  • @DiegoPerez-qh4tm
    @DiegoPerez-qh4tm 3 роки тому

    I needed this tutorial, thanks!!!