How to Setup a Custom Theme in Flutter for a Light and Dark Theme - 2023

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

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

  • @notorioustofu3482
    @notorioustofu3482 Год назад +4

    As an experienced mobile dev learning Flutter, these videos are essential to learning clean architecture and production-ready code

  • @DeophobicMind
    @DeophobicMind Год назад +2

    This is so far the best flutter tutorials I've ever enjoyed watching. Thank you very much for these.

  • @hoxty
    @hoxty 2 года назад +3

    Truly one of the finest in flutter!
    Google may consider syndicating your channel.

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

    One of the finest flutter course!!

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

    Thank you. This is really good tutorial demystifying the theming and this helps keeping the logic, layout and styling separate and yet customisable. It would be great if you can add a quick tutorial of what has changed or added in new flutter.

    • @CodingwithT
      @CodingwithT  Год назад +1

      Glad you like it! I keep on updating this code to the latest modifications but also about to launch a new tutorial series which will help you in your case.

  • @tamim-rz5us
    @tamim-rz5us Год назад

    great job brother. keep up!😍

  • @alquranalkarim6312
    @alquranalkarim6312 Год назад +1

    شكراً على مجهودك الرائع و المعلومات الرائعة اتمنى لك المزيد
    بالتوفيق 🧑‍💻🖥️🥇

  • @ayseguleren4822
    @ayseguleren4822 Год назад +1

    thank you for this super tutorial, i've learnt a lot i appreciate it. but i don't understand how come we remove the primarySwatch's colors in the video around 13:51 minute ? if we want to theme would be yellow we wouldn't erase that code right ?

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

      Yes, you can use primary Swatch and if you want to customize almost every widget as your own custom design then in that case primary Swatch is not needed.

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

      & you welcome 😁

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

    Great stuff

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

    This is an awsome tutorial, but i have a lot of questions about dynamic sizing. Many of my texts and sizes use the size of the screen how can i create these sizes in the constants or other folder which are not in the same screen as the dart file?

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

      Use the static functions and pass the context

  • @MuhammadFaizan-xq2sh
    @MuhammadFaizan-xq2sh 2 года назад +2

    In last bit, you said that "we don't want user to get theme using instance of the class ", but as we are using static then can user access it using instance ?

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

      Hi Faizan, It's simply a class whose constructor is now private means its instance cannot be created.
      So we will call TAppTheme.lightTheme, instead of creating an instance like TAppTheme appTheme = new TAppTheme();

    • @MuhammadFaizan-xq2sh
      @MuhammadFaizan-xq2sh 2 года назад

      @@CodingwithT can we also use abstract with class so its instance cant be made ? Same thing happening here?

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

      Yes its a class so any class will do the same

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

    Ram Ram bhai. Radhe Radhe

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

    Brilliant.. Keep up the good work brother

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

    very good 👍

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

    this is great!

  • @m.farouqfahmij.8428
    @m.farouqfahmij.8428 Год назад

    14:44 what shortcut did you use to align the code sir?

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

      Ctrl + alt + L

    • @m.farouqfahmij.8428
      @m.farouqfahmij.8428 Год назад

      @@CodingwithT thankyou very much sir.. Your videos are very helpful for a beginner like me. May Allah Bless you 🙏

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

    hey facing the issue during building the app" 42: Error: Type 'Uint8List' not found. " after installing the google fonts

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

    Dear Sir when you paste the yellow color code and use it than where is the yellow color codes gone in theme.dart file are you remove it from the file or copy somewhere else ? i write the all yellow colors codes with shades in theme.dart file

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

    Big Thanks Brother.

  • @bobhero7
    @bobhero7 Год назад +2

    Error while using Material Color in primary swatch -
    Null check operator used on null value

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

      That because whenever we use ! sign that means the value which is using this sign cannot be null but in your case value is null and along with a null value we cannot use !

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

    I'm using vscode with Mac Pro M2 Ventura OS. My hot reload is not working after using all these .dart theme files. I always have to restart the application, which takes longer to see the visual changes. Any tips?

    • @CodingwithT
      @CodingwithT  Год назад +1

      When you do some change in the theme files, you have to restart. Otherwise when the theme is loaded, based on that you can hot reload anything from anyfile.

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

    I am using VS code and for me the primary swatch is not working. Also can someone please tell me what extension can we use in vs code to get the Color changing panel in the side where we can change the intensity and stuff.

    • @CodingwithT
      @CodingwithT  4 дня назад +1

      To fix the primarySwatch issue, ensure you're using MaterialColor with a proper color map.
      For a color-changing panel in VS Code, install the Color Highlight extension. It highlights colors and provides a picker to adjust intensity and shades.

    • @Akash77nag
      @Akash77nag 4 дня назад

      @ thank you, please make more flutter mobile app videos.

  • @mohamaddody1338
    @mohamaddody1338 Год назад +1

    Can you please switch to dart mode? It will be much easier to see the content of your screen

  • @consumatormedia8784
    @consumatormedia8784 Год назад +1

    Hello sir, following your tutorial, the TextTheme does not update when using headline2. It still uses the default Flutter headline2. Any idea how to fix?

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

      Dear textTheme now modified and you can check the latest options at the link given below in the description.

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

      @@CodingwithT okay i will check it out, thank you very much sir also is there a certain pixel resolution we should use for the animated splash screen? Thank you again, very good tutorials 🙏

  • @muhammadyusoffjamaluddin
    @muhammadyusoffjamaluddin 8 месяцев назад

    Can you update this 'How to Setup a Custom Theme in Flutter for a Light and Dark Theme - 2023' to Material 3? It's not the same anymore because the Appbar does not follow the changes you made in ThemeData.
    Thank you in advance!

    • @CodingwithT
      @CodingwithT  8 месяцев назад

      You can watch my latest series of ecommerce app in which I have already done required changes.

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

    brilliant

  • @raaj5779
    @raaj5779 Год назад +1

    2.31 How did you put the image??

  • @EmzyWoo-km6gx
    @EmzyWoo-km6gx Год назад

    for your next totorial you dident use the same main.dart what should i do

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

    The style from my theme file doesn't apply to the text although the theme file is imported and there are no errors on run

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

      First hot reload doesn't work you have to hot restart to make changes effective.
      Also have to call them in Text?

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

      I completely reloaded, there is just one difference, headline 2 is deprecated and now you must use headlineMedium(which is h2)

  • @Error-Solver.
    @Error-Solver. Год назад +1

    bro how do u get this kind of images please post the link

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

      Its already added in the codingwitht.com/flutter-login-app

  • @MuhammadMustafa-uz2bf
    @MuhammadMustafa-uz2bf 2 года назад +1

    good sir

  • @Usamaakhn
    @Usamaakhn Год назад +1

    Sir which emulator you use in this video

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

      Hi Usama, it's my own physical mobile

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

      @@CodingwithT How do you bring it on screen? I know of Scrcpy but it doesn't show device frame like yours is showing.

  • @faizanahmed8844
    @faizanahmed8844 Год назад +1

    Man you are good but one thing everyone cannot have money to buy this source code like 16 dollars.....you have to give this code to everyone free of cost

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

      Thank you Faizan. I always try my best to help as much as I can but you know YT is not paying enough to keep this going therefore I decided to add each tutorial code separately in each blog post and only if you need the whole project, you have to pay once.

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

    The subtitle is not defined what can i do?

    • @CodingwithT
      @CodingwithT  6 месяцев назад

      You can use the new methodology like Heading, Title, body, Label etc

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

    Sir my emulator does not have dark mode system

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

      If your Android studio is updated. You must have a dark mode in settings.
      Check it out 🤠

  • @Abdullah-so9xq
    @Abdullah-so9xq 2 года назад +1

    Sir ap ak course Urdu ma bhe banaye flutter Ka please

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

    What emulator are you using

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

    May ALLAH bless you

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

    can anyone tell me where to get all source code ?

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

      Link is in the description

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

    best

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

    Project attachments

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

    Anaya is watching

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

    i am expecting custom them as own styling of colors. How i can set colors of my own on every widget of my choice? I have this colors for example:
    import 'package:flutter/material.dart';
    bool darkTheme = false;
    Color background = darkTheme? const Color(0xFF040C23): const Color(0xFFF8EBD4);
    Color textMain = darkTheme? const Color(0xFFFFFFFF): const Color(0xFF000000);
    Color text = darkTheme? const Color(0xFFA19CC5): const Color(0xFF575D5B);
    Color orange = const Color(0xFFF9B091);
    Color primary = darkTheme? const Color(0xFFA44AFF): const Color(0xFF000000);
    Color circles = darkTheme? const Color(0xFFA44AFF): const Color(0xFF704214);
    Color gray = darkTheme? const Color(0xFF121931): const Color(0x59BBC4CE);
    Color logo = darkTheme? const Color(0xFFFFFFFF): const Color(0xFF704214);
    Color gradient1 = darkTheme? const Color(0xFFDF98FA): const Color(0xFF704214);
    Color gradient2 = darkTheme? const Color(0xFFB070FD): const Color(0xFFA87242);
    Color gradient3 = darkTheme? const Color(0xFF9055FF): const Color(0xFFE2A674);

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

    Thank you😍.
    1. Theme.of(context)textTheme.heading1⬅ When I call this line It shows me default Headline1
    2. MyTextTheme.lightTextTheme.heading1⬅ This line of code shows me my Theme Headline1. But as you can see this line of code did not support dark theme or not responsive.
    So kindly tell me why (1) line of code didnot change according to my custom theme?

    • @CodingwithT
      @CodingwithT  Год назад +1

      Reason could be that headline 1,2 etc are now obsolete and you should use Headline large, medium small etc

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

      @@CodingwithT as you use headline1 to 6 and outlinedButtonTheme and elevatedButtonTheme you did not call style again and again but in my case it still does not show

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

      @@CodingwithT As you say use HeadlineLarge I used it know but still it did not show my theme but Defualt headlineLarge style

    • @chillvibeReels
      @chillvibeReels Год назад +1

      @@CodingwithT After soo many trying I found an issue that I did not add theme lines in my Main.dart file 🥲. Thanks Sir

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

    import 'package:login_flutter_app/src/utils/theme/theme.dart';
    I am getting this error
    can you guide me about this

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

      Dear check if the import path is accurate