Flavors in Flutter - Multiple apps from one source code - Icon Generation

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ส.ค. 2024
  • We want to look at how #Flavors work in #Flutter and Dart. In this video, you will see how we create two completely different apps from one source code. It will include app icons, own install names and more.
    If you like our work and want to support us, feel free to join us on Patreon.
    / flutterexp
    If you are interested in some live coding with me, checkout my Kick account:
    kick.com/devcafe
    GitHub Repository: github.com/Flutter-Explained/...
    GitHub Tutorial Branch: github.com/Flutter-Explained/...
    Flutter Flavors Ressources: flutter.dev/docs/deployment/f...
    Flutter Very Good CLI: github.com/VeryGoodOpenSource...
    Timetable:
    00:00 Introduction to Flutter Flavors
    03:00 Creating two Dart Entry Points
    06:40 Startup configurations in Android Studio
    08:40 iOS Configuration of Scheme´s
    15:40 Android Configuration of Flavors
    23:15 Flutter Icon Generator - Generate App Icons for Android + iOS
    24:53 Setup iOS App Icon for Schemas
    28:22 Thank you Flutter Explained Members
    Join this channel to get access to perks:
    / @flutterexplained
    ** New Mentorship Program to boost your Flutter career **
    gumroad.com/products/ydgtfV
    **BOOKS I RECOMMEND**
    geni.us/flutterbook
    geni.us/clean-code
    ** TH-cam OPTIMIZATION PLUG-INS I USE **
    TUBEBUDDY: www.tubebuddy.com/flutterexpl...
    VIDIQ: vidiq.com?afmc=7jl
    **ALL THE TH-cam EQUIPMENT I USE**:
    Our current TH-cam gear
    💻 MacBook Pro: geni.us/mac-book
    📹 Lumix FZ1000: geni.us/fz-1000
    🎙 Samson Mic: geni.us/samson-mic
    🎉 ACCESSORIES:
    Satechi USB-C Adapter: geni.us/P9R0
    SD Card for 4k Videos: geni.us/PTAc
    Disclaimer Flutter Explained (Max & Mahtab) are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to www.amazon.com.
    ** Social Medias **
    Website: flutter-explained.dev
    Say hi to Max
    Twitter: / flutter_exp
    GitHub Max: github.com/md-weber
    LinkedIn: / max-weber-9889a3ba
    Discord: / discord
    Say hi to Mahtab
    Twitter Mahtab: / mahtab_dev
    GitHub Mahtab: github.com/mt-tadayon
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 93

  • @bigdreams3953
    @bigdreams3953 ปีที่แล้ว +5

    I love how he is the only one making these challengin things while others are flooding the internet with how to make your first flutter app

  • @R3d_Devil
    @R3d_Devil 3 ปีที่แล้ว +4

    I used to implement flavors in a very rudimentary manner...this is much more intuitive. You sir, have a new subscriber.

  • @ppassa1
    @ppassa1 2 ปีที่แล้ว +1

    Wow this helps a lot! I like Max's youtube because he understands what we need to know for making a production-level application.

  • @kanaanzafar8080
    @kanaanzafar8080 11 หลายเดือนก่อน +1

    Very simply explained. Just Amazing

  • @kerimamanov7760
    @kerimamanov7760 2 ปีที่แล้ว +8

    Hey, great content!
    Another use-case for flavors in flutter:
    "We need app for 2 markets: global and china (use different auth, payment, notification methods), so we did it with flavors".
    Thank you.

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว +1

      That is an amazing use case, thanks for the example!

    • @ivanyoed
      @ivanyoed 2 ปีที่แล้ว

      amazing use case, indeed

  • @FlutterExplained
    @FlutterExplained  3 ปีที่แล้ว +3

    Flutter Flavors are an exciting topic because you can create multiple apps right out of one codebase. Additionally, it allows you to manage different stages of Development with them like Dev, Testing and Production. If you have any questions, please feel free to write them right below. If you want to see how we learned all that about Flutter Flavors, have a look into our Live Stream!
    th-cam.com/video/nW2F4ao7gEM/w-d-xo.html

    • @lenaklus4844
      @lenaklus4844 3 ปีที่แล้ว

      Was meinst du?
      Kannst du mal was auf Deutsch machen.?

    • @lenaklus4844
      @lenaklus4844 3 ปีที่แล้ว

      Bitte

  • @muzykina
    @muzykina 2 ปีที่แล้ว +1

    Very useful video! Thanks for your job!

  • @alexey5174
    @alexey5174 3 ปีที่แล้ว +2

    Amazing tutorial. Thanks! Helped a lot

  • @chamikapeiris
    @chamikapeiris ปีที่แล้ว

    This is great. You have good teaching skills.

  • @sallytimmer5643
    @sallytimmer5643 2 ปีที่แล้ว +1

    Great tutorial. Thanks!

  • @aliozer9082
    @aliozer9082 6 หลายเดือนก่อน

    Thank you for the wonderful explanation

  • @kirill4531
    @kirill4531 3 ปีที่แล้ว +1

    Like without even watching! I'll add it to my watchlater playlist and get back to it when I have time for it to watch without interruptions. Thanks for great topic!
    More comments later.

  • @ShawnBlais
    @ShawnBlais 3 ปีที่แล้ว +1

    Very exhaustive video, thanks!

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Yeah it was very long but I hope it is helpful :)

  • @user-kw4kp7eq9m
    @user-kw4kp7eq9m ปีที่แล้ว

    Good job! Thank you very much!

  • @charithasds
    @charithasds ปีที่แล้ว +1

    Thanks for the clear explanation! 😇

  • @SlavrilLavigne
    @SlavrilLavigne หลายเดือนก่อน

    thanks so much, you help me a lot

  • @konradbejger2232
    @konradbejger2232 2 ปีที่แล้ว +1

    Nicely done

  • @pravinprince3221
    @pravinprince3221 ปีที่แล้ว

    Thank you for the wonderful video sir

  • @matthieuregnauld9648
    @matthieuregnauld9648 3 ปีที่แล้ว +1

    Worked first try! No better way to start the day ;)

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Great to hear! Enjoy the rest of this fantastic week :)

    • @matthieuregnauld9648
      @matthieuregnauld9648 3 ปีที่แล้ว +1

      @@FlutterExplained That being said, I noticed something strange for the iOS part: when you go to Runner.xcodeproj, then Targets, then Build Settings, then go to the User-Defined part, the FLUTTER_TARGET setting always has the same value, regardless of the scheme... Is it normal?

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      ​@@matthieuregnauld9648 To be honest, I do not know :), I checked two of my projects and at least for my examples that is correct it looks normal to me :)

  • @tessertaha
    @tessertaha 3 ปีที่แล้ว +2

    Very professioinal video!

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Glad you think so! Thanks Taha :) hope you are very well!

  • @user-lj4ti4ny4r
    @user-lj4ti4ny4r ปีที่แล้ว +1

    Thanks, very usefull!!!

  • @TheCass240
    @TheCass240 3 ปีที่แล้ว +1

    Great topic, not enough information out there about it!

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      Thank you for your feedback. That was exactly the issue I had and why I thought a video would be helpful.

  • @nuriddinburkhonov5214
    @nuriddinburkhonov5214 ปีที่แล้ว +1

    Hey great tutorial! Thank you very much! Like and a Sub

    • @FlutterExplained
      @FlutterExplained  ปีที่แล้ว

      Thanks for the sub and the amazing feedback 🥰

  • @sushantkumar7630
    @sushantkumar7630 8 หลายเดือนก่อน

    Thanks.

  • @iabhishekpatil4415
    @iabhishekpatil4415 2 ปีที่แล้ว

    Great Thanx 👍
    Is this method still recommended in 2022 with flutter 3.0?

  • @purvsonani4597
    @purvsonani4597 2 ปีที่แล้ว

    nice content

  • @danielborges123
    @danielborges123 3 ปีที่แล้ว +1

    Great video! I have one question: if I have 5 flavors, for example, where each one have a list of assets. All the 5 app builds will have all the 5 list of assets, resulting in a build with unused assets, whereas I need only one.

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      That is correct, it will bundle all the assets that you define in the pubspec.yaml and maybe also a very interesting downside of Flavours. I do unfortunatly have not so much experience to tell you if there is a way to improve the treeshaking in that area, but it is worth investigating!

  • @m.husnulaqib1458
    @m.husnulaqib1458 2 ปีที่แล้ว

    thanks

  • @stefaandeconinck1531
    @stefaandeconinck1531 3 ปีที่แล้ว +2

    Great video, question 🙋‍♂️: is there a way to configure the settings for IOS by the IDE because I do t have an apple computer?

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +2

      Hi Stefaan, thank you :). Regarding your question I am not sure, it could be possible but it will be very challenging like iOS development is in general. But you can skip the iOS part and just set it up for Android.

  • @jidechiukor3284
    @jidechiukor3284 2 หลายเดือนก่อน +1

    This video has been my go to any time I start a new project. I have a question - I notice you use schema for creating the flavours. I saw a friend use target in React Native. My question is what is can you do the same for flutter. I think so because I have read a medium post where some use it. What is the benefit of using target or schema.

    • @FlutterExplained
      @FlutterExplained  2 หลายเดือนก่อน

      Very good question. In Xcode, a "target" specifies what to build and includes all necessary files and settings, while a "scheme" defines how to build, run, and manage the workflow for one or more targets.

  • @nils.reichardt
    @nils.reichardt 3 ปีที่แล้ว +1

    7:15 Why do you not use the "Build flavor" textfield in Android Studio (under Additional attach args)?

    • @FlutterExplained
      @FlutterExplained  3 ปีที่แล้ว +1

      I did not know about that :) thanks for the suggestion!

  • @Adityaharikishan
    @Adityaharikishan ปีที่แล้ว

    Excellent explanation, When I upgraded my Rivier pod library to the latest version, during the runtime I got this error
    Class 'FlavorConfig' has no instance getter 'state'.
    Receiver: Instance of 'FlavorConfig'
    Tried calling: state.
    Can you help me with what I'm supposed to do here?
    I really appreciate any help you can provide.

  • @abhipanchal787
    @abhipanchal787 2 ปีที่แล้ว

    final config = context.read(flavorConfigProvider); in this line getting error "The method 'read' isn't defined for the type 'BuildContext'."

    • @AbhishekVijayBajaj
      @AbhishekVijayBajaj ปีที่แล้ว

      Hlo, Did you find any solution?

    • @shole7035
      @shole7035 ปีที่แล้ว

      @@AbhishekVijayBajaj this is for the older version of riverpod, now u need to do it in this way: ref.read(flavorConfigProvider).appTitle etc

  • @rohitbarge9876
    @rohitbarge9876 ปีที่แล้ว

    How can I use a theme like i need to set the Elevated Button background color of its primary color.

  • @marllon_drion
    @marllon_drion 2 ปีที่แล้ว

    Hi thank you for your video! I would like to know if you or someone Know a different way to do it, because in my case I need to build over than 30 apps for each operation system. So, I need some an easy way….

  • @ivanyoed
    @ivanyoed 2 ปีที่แล้ว

    How can you debug through android studio when running your app through a flavor command? It does not seem to be possible.

  • @manishgautam2424
    @manishgautam2424 11 หลายเดือนก่อน

    is there any approach where we can get --flavor argument in main() without defining any folder scheme , just in main.dart

  • @diogosequeira4873
    @diogosequeira4873 3 ปีที่แล้ว

    Hi there, great video! Was just wondering at min 5:00, what's the advantage of using cascade operator after instanciating the class to set the properties values rather than populating them straight in the constructor? Is it just a matter of readability or its more performant?
    Thanks for the video

  • @keithbacalso9433
    @keithbacalso9433 24 วันที่ผ่านมา

    I dont get it why do we have to create 3 separate files for `main_dev, ,main_stg, main_prod`. If there is already a launch.json that can target one `main.dart` ???

  • @Hamzakhan-kx2ql
    @Hamzakhan-kx2ql 2 ปีที่แล้ว

    Awesome tutorial. But unfortunately I am not able generate ios build. Can you please guid me what extra we can do to generate ios build from xcode

  • @cleopatria1346
    @cleopatria1346 2 ปีที่แล้ว +1

    Could you tell me how to use the apiEndpoint without context? I need to call it in file where I keep the constants for the API url.

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว

      Hi Cleo, very good question. Probably you would need a build runner that generates the constant file with the flavor name. Another option would be to make the file a none constant file. I hope that helps you :).

  • @SandunPerera
    @SandunPerera 2 ปีที่แล้ว

    Common thing is google services file from Firebase, and how to apply flavor wise google services files into the source code would be helpful.

  • @gabrielamat596
    @gabrielamat596 2 ปีที่แล้ว

    Hey, how can i delete a scheme? i created 3 but now i'm gonna use just 2, prod and qa. Since when I deleted the "main_dev.dart" file i can't build the app, got this error "error when reading "lib/main_dev.dart""

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว

      Hi I hope I understand you correctly, then you need to change your Android Studio executable or your cmd line. Around 8:06 I explain that part.
      That should solve your problem inside of Flutter if you want to remove a scheme in XCode you will need to do it there.

  • @Rodrigo29948
    @Rodrigo29948 9 หลายเดือนก่อน

    is there a way to flavor a package/plugin?

  • @CatalinPatrascu
    @CatalinPatrascu 2 ปีที่แล้ว

    Nice video mate, I see you left Runner as well so I have duplicated the same I have dev, live and Runner (which is the same as live). I do have a problem with Firebase TestLab and integration testing, maybe you can help.
    Before the flavors was working fine (and on android after flavors works fine as well, but not on iOS).
    If I run flutter drive --driver=test_driver/integration_driver.dart --target=integration_test/app_test.dart works fine -> routing to Runner flavor if nothing is mentioned
    But
    flutter build ios integration_test/app_test.dart --release
    and then
    xcodebuild -workspace Runner.xcworkspace -scheme Runner -config Flutter/Release.xcconfig -derivedDataPath $output -sdk iphoneos build-for-testing
    Fails some tests. Any idea how these flavors and integration testing and TestLab fit in all together?

  • @minhnguyennhat56
    @minhnguyennhat56 2 ปีที่แล้ว

    I have problem when open folder android and build. Error with Error when reading 'lib/main.dart': No such file or directory. Please help me

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว

      Hi there, that sounds like a very weird error, but you do usually not want to open the android folder, you want to be in the parent folder to build the project. it searches for "lib/main.dart" inside of the android folder probably. But it is hard to analyse the problem without the correct error log.

    • @minhnguyennhat56
      @minhnguyennhat56 2 ปีที่แล้ว

      @@FlutterExplained OH, when i generate apk or aab, i alway open file android inside project to build.Because i want build by android studio tool, not terminal. But when i build this error arrive.

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว

      That is because it searches for a different entry point if you rename the main.dart file. One solution is to work then via the cmd stackoverflow.com/a/58514075/3690032
      Another solution would be to find out how to set the correct Entrypoint in Android Studio.

    • @minhnguyennhat56
      @minhnguyennhat56 2 ปีที่แล้ว

      @@FlutterExplained oh no! this problem still :((((

  • @369Funny
    @369Funny 2 ปีที่แล้ว

    ok so how about firebase and Google map api?

  • @shilpavania4113
    @shilpavania4113 2 ปีที่แล้ว

    Great video i have followed all the config but when i run in ios i am getting below error. acn anybody please tell what i am missing or any help would be appreciate. Thanks
    Error: Error when reading 'lib/main.dart': No such file or directory

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว

      AFAIK we changed the filename of main.dart to something else could you try to change the config file name of the file to the correct name.

  • @AndresJimenezS
    @AndresJimenezS 2 ปีที่แล้ว +1

    how can i use flavors for macos ?

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว

      Hi Andres, this is a really good question and I am not absolutely sure if this is possible. I will have a look and if I find a solution I will let you know.

  • @lenaklus4844
    @lenaklus4844 3 ปีที่แล้ว +1

    Blablabla

  • @sajadrahmdel2385
    @sajadrahmdel2385 2 ปีที่แล้ว +1

    Please stop zooming the camera in and out.
    Good contents, keep it up

    • @FlutterExplained
      @FlutterExplained  2 ปีที่แล้ว +1

      I got that feedback now more and more and will do it :) thanks a lot!

  • @lenaklus4844
    @lenaklus4844 3 ปีที่แล้ว +1

    Kann mir jemand antworten?

    • @lenaklus4844
      @lenaklus4844 3 ปีที่แล้ว

      *_*

    • @lenaklus4844
      @lenaklus4844 3 ปีที่แล้ว

      Hāļľô

    • @ivanyoed
      @ivanyoed 2 ปีที่แล้ว

      @@lenaklus4844 hi. Ich habe auch gemerkt, dass er Deutsch spricht.

  • @lenaklus4844
    @lenaklus4844 3 ปีที่แล้ว +1

    Hallo

  • @lenaklus4844
    @lenaklus4844 3 ปีที่แล้ว +1

    Max kann Deutsch und Englisch sprechen.

  • @lenaklus4844
    @lenaklus4844 3 ปีที่แล้ว +1

    Kann jemand Deutsch sprechen?

  • @HimanshuKumar-vl1tf
    @HimanshuKumar-vl1tf 3 ปีที่แล้ว

    cant we just --dart-define everything?

  • @belaidaitzeggane2945
    @belaidaitzeggane2945 ปีที่แล้ว +1

    i am using very_good_cli