Switch Themes with Flutter Bloc - Dynamic Theming Tutorial (Dark & Light Theme)

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • 📗 Learn from the written tutorial & get the code 👇👇
    resocoder.com/flutter-switch-...
    👨‍💻 Do you write good code? Find out now 👇
    resocoder.com/good-code-quiz
    Themes are a sure way to add a vibrant touch to your apps. With Flutter's theming support, you can customize literally everything with only a few lines of code. What if you want to let your users change the themes on the fly though? At the very least, every app should support light and dark mode.
    One option is to hack something together using StatefulWidgets. Another, and better option, is to use the flutter_bloc library to create an extensible and manageable theme switching framework.
    Go to the website for more information, code examples, and articles:
    ● resocoder.com
    Follow me on social media:
    ● / resocoder
    ● / resocoder
    ● / resocoder

Komentáře • 46

  • @Hicham_SaAh
    @Hicham_SaAh Před 4 lety

    awesome and clear , thank you so much , you makes me love flutter

  • @ThEGeEeK
    @ThEGeEeK Před 4 lety

    The best of the best explanation. Love you bro.

  • @mengyan3214
    @mengyan3214 Před rokem

    Great video. Always let me learn a lot. Thanks!! Please keep up. 💪

  • @sabujmahbubul5581
    @sabujmahbubul5581 Před 4 lety

    You are Awesome i must say👍👍👍hope you will upload videos more frequently

    • @ResoCoder
      @ResoCoder  Před 4 lety +1

      Of course I will! Working on something big right now.

  • @intelxd
    @intelxd Před 4 lety +2

    amazing content, I like how clear your explanations are... If I could recommend something, I'd like to see some more advanced UI builds, not only in terms of different widgets, but rather in terms of modern looks.
    Thanks for sharing this content!

  • @alvin3171997
    @alvin3171997 Před 4 lety

    Hey ResoCoder, awesome tutorial as always! Could you make a video on flutter dynamic widget package? It uses Json file to dynamically build flutter widgets

  • @vianeyvargas7736
    @vianeyvargas7736 Před 2 lety

    Thanks for your video, and please and how would it be with MiltiBlocProvider inside the Main class?.

  • @samirdesigner3324
    @samirdesigner3324 Před 4 lety

    thanks
    if make about change language app how do this? is very good

  • @harikrishnang8181
    @harikrishnang8181 Před 3 lety +2

    Can you explain it for latest bloc and equatable?

  • @amaromem1
    @amaromem1 Před 4 lety

    Hi, your channel and explanations are so simple and yet so complete, I think is the best programming channel in CZcams.
    Have you ever done a tutorial for getting notifications from FCM when phone is in Doze/ Standby/Idle state?
    I think is not possible to achieve..

  • @yooscripts5947
    @yooscripts5947 Před 4 lety

    hello, is it possible to do navigation in flutter with bloc ?

  • @RobertWildling
    @RobertWildling Před 4 lety

    ResoCoder, this is a very nice tutorial and puts knowledge from earlier tutorials into another practical use case! Thank you very much!!!
    Can you please let us know, which icon theme in VSCode you use? I have the material icons activated, but the bloc folders will not turn yellow as they do in your setup... Thank you!

    • @ResoCoder
      @ResoCoder  Před 4 lety +1

      I use the very extension you have. You can associate your own folder names with predefined icons in the settings - check the docs on the extension's repo.

  • @irakliish
    @irakliish Před 4 lety +4

    I don' t know why, but theme not change :/

  • @sokheangkhun6634
    @sokheangkhun6634 Před 4 lety

    Can you do splash screen for both Android and iOS?

  • @Abhishek_Pal
    @Abhishek_Pal Před 4 lety +3

    Hello @Reso Coder,
    This tutorial seems to be old as the bloc now no longer creates 4 files and instead does 3. and the management seems to be changed as well. Can you please create a new video about the newer one ?

    • @nivellemendiola5039
      @nivellemendiola5039 Před 4 lety

      check his flutter bloc crash course. i just learn it yesterday and it work like charm

    • @nivellemendiola5039
      @nivellemendiola5039 Před 2 lety

      @Juan Sin Miedo im not sure if i still have it on my github account

  • @MoAdel92
    @MoAdel92 Před 3 lety

    can i follow this tutorial with provider rather than bloc??

  • @ran0100
    @ran0100 Před rokem

    Hi!
    Thank you!
    Have new version of this because its not works :(

  • @Just_JasonZA
    @Just_JasonZA Před 4 lety +3

    Man i could not follow this as of the latest March 2020 there is a new "part of" that the auto block creates and the block.dart is removed please could you do an up to date version of this

  • @jaserjsk
    @jaserjsk Před 4 lety +3

    Awsome tutorial but your code needs to an update.
    Does not work with current version of Flutter UI.

  • @richardamare3575
    @richardamare3575 Před 4 lety

    what is the name of this system?

  • @abanahmed4683
    @abanahmed4683 Před 3 lety

    😍

  • @sokheangkhun6634
    @sokheangkhun6634 Před 4 lety

    How did you do that at 22:34?

  • @SahharYoucef
    @SahharYoucef Před 4 lety +2

    nice video , but i think ChangeNotifier would be faster and less coded

    • @narcodico
      @narcodico Před 4 lety

      True

    • @ResoCoder
      @ResoCoder  Před 4 lety +5

      Maybe yes, once you get going with Bloc though, it's easier to do everything using that pattern.

    • @narcodico
      @narcodico Před 4 lety

      BLoC is a cool pattern but simply overkill for this feature. But a nice showcase of the pattern nonetheless. Really like your work man :)

    • @SahharYoucef
      @SahharYoucef Před 4 lety

      Sincerely, i use both provider and bloc. I like bloc, it give me more abilities to manage states 'yield'.

    • @miklosnemeth8566
      @miklosnemeth8566 Před 4 lety

      @@ResoCoder I fully agree, Mr Angelov made a brilliant job of making the architecture of his package so clean and straightforward, consistent a complete. A big thank you that you have shown this package. I was experimenting with the Provider package, too, but, honestly, flutter_block is a lot easier and more reliable to use. Reactive UI programming is really challenging, and not really a fun; with flutter_block however, it is a lot more straightforward. Actually, the plain old setState when smartly used with a nice architecture is more than enough for most situations. But, this flutter_block is really awesome for medium to more feature rich business applications.

  • @el4040
    @el4040 Před 3 lety +1

    BlocProvider.of(context).dispatch(ThemeChanged(theme: itemAppTheme)); dispatch method does not exist flutter_bloc: ^6.1.1 solved : BlocProvider.of(context)
    .add(ThemeChanged(theme: itemAppTheme));

  • @ThEGeEeK
    @ThEGeEeK Před 4 lety

    How to persist the theme in every app launch.