Questions tagged [flutter-theme]

The flutter theme widget can be used to define application wide colors, fonts and text styles in a flutter app.

https://flutter.dev/docs/cookbook/design/themes

118 questions
0
votes
0 answers

App theme is not changing in flutter getx library

Below mentioned code is theme changes. can any one please tell me where i'm going wrong. The problem is -> when i get the app color codes from the custom common class it's not working but if i put it directly when it needed it is working. this is…
0
votes
0 answers

how to switch theme smoothy in flutter project?

I found some pubs like animated_theme_switcher,it caches the screen into a image. If you click the floatbutton and click the switcher, you will find the number increase stoped. that's not I want.animated_theme_switcher so how to switch theme really…
0
votes
1 answer

Flutter: How can I use different colors for IconButtons in the AppBar versus everywhere else

Im applying a global theme to the IconButtons within a MaterialApp, so I set up an iconButtonTheme. This theme handles color changes to the IconButtons when the IconButton is disabled. This appears to be working. However, I want my action…
sails
  • 11
  • 3
0
votes
0 answers

MaterialState in NavigationBarThemeData is not working

I'm tring to change labels color depends on if it selected or not, but flutter sets 1 color for all NavigationBarTheme( data: NavigationBarThemeData( backgroundColor: Theme.of(context) …
0
votes
1 answer

What are differences between text theme of material specification 2014 and text theme of material specification 2018 and 2021?

What are differences between text theme of material specification 2014 and text theme of material specification 2018 and 2021? If you update flutter SDK to latest version, you will receive several warning messages related to textTheme usage.
GOKU
  • 430
  • 1
  • 4
  • 20
0
votes
0 answers

How to use Flutter's built in TextTheme instead of creating our custom themes?

I am noticing this description in Flutter's TextTheme description: Rather than creating a TextTheme directly, you can obtain an instance as Typography.black or Typography.white. at https://api.flutter.dev/flutter/material/TextTheme-class.html Does…
giorgio79
  • 3,787
  • 9
  • 53
  • 85
0
votes
1 answer

Flutter Theme Dark/Lights Theme toggle doesn't work

there is a dark/light theme toggle function in this snap of code. There is no error when I compile, debuging this code. But It doesn't work. For example, I never define scaffoldbackgroundColor(0xfffafafa) and What I define color in dark, light theme…
John Han
  • 31
  • 6
0
votes
1 answer

is there an advantage of using TextTheme in Flutter?

themeData.copyWith( colorScheme: //... scaffoldBackgroundColor: //... textTheme: const TextTheme( headline1: TextStyle(/*...*/), subtitle1: TextStyle(/*...*/), button: TextStyle(/*...*/), bodyText1:…
0
votes
0 answers

I need my toggle switch in the appBar to be visible

I have created a toggle switch in the appBar but its not visible because of the code. It changes themes between light to dark when clicked main.dart class MyApp extends StatelessWidget { static const String title = "User Profile"; const…
Devendiran
  • 99
  • 9
0
votes
0 answers

How to chain extension in flutter

I found out intersting way of reducing the work required for customizing widgets via extension Ex: To make the text red i would make an extension like the following Container( child: "Krishna".redText(), ) extension TextTheme on String { …
krishnaacharyaa
  • 14,953
  • 4
  • 49
  • 88
0
votes
1 answer

Forcing child widget to inherit its parent's style in flutter

Many flutter widgets forces their child to inherit their style, like: ElevatedButton( child: Text("Click Me."), onPressed: (){}, ); this ElevatedButton() will force its Text() child to inherit a specific text color, weight and so on... My…
0
votes
0 answers

Changing the color latex render in Flutter

I was trying to render a latex document using "flutter_tex" package on a dark background(Not in Dark Mode) so the render must be white for contrast reasons.....but the texts only change color while the the renders wont change to white unless I…
0
votes
1 answer

How to change the keyboard color to dark?

My app uses dark theme as ThemeData.dark().copyWith( ... ), that defined for theme property of MaterialApp. As far as the keyboardAppearance property does work only in ios there is no way how to make the same on android. Is there?
rozerro
  • 5,787
  • 9
  • 46
  • 94
0
votes
2 answers

Advatanges and disadvantages of using theme extensions for storing colors instead of class

What are the advantages of using theme extension for storing custom colors instead of class containing static consts? class AppColors { static const Color brandColor = Color(0xFF1E88E5); static const Color danger = Color(0xFFE53935); …
Chris
  • 839
  • 1
  • 12
  • 30
0
votes
0 answers

When overriding the TextTheme without any changes, the text color gets updated to color white in the light theme

I want to extract the TextTheme customization in it's own class so I have a single point where I configure the text. In this class I have tried the following with the same result: var lightTextTheme =Typography().black.copyWith(); var darkTextTheme…
Răzvan Puiu
  • 671
  • 1
  • 6
  • 24