The flutter theme widget can be used to define application wide colors, fonts and text styles in a flutter app.
Questions tagged [flutter-theme]
118 questions
3
votes
0 answers
Flutter - IconThemeData. Icon color changes for dark mode but doesn't change for light mode in Drawer()
IconTheme Color doesn't change in light mode for the icons in drawer but changes color accordingly in dark mode.

Raj A
- 544
- 9
- 21
3
votes
3 answers
Flutter - How can I change the background color of LicensePage?
I'd like to set the background colour of every screen except LicensePage to some colour, so I've specified the scaffoldBackbroundColor via the theme argument of MaterialApp as follows.
class App extends StatelessWidget {
@override
Widget…

kaboc
- 814
- 1
- 6
- 23
2
votes
1 answer
Changing the themeColor of CheckBoxListTile globally using material3
In Flutter documentation, it's given
The Material widgets Switch, SwitchListTile, Checkbox, CheckboxListTile, Radio, RadioListTile now use ColorScheme.secondary color for their toggleable widget.
ThemeData.toggleableActiveColor is deprecated and…

krishnaacharyaa
- 14,953
- 4
- 49
- 88
2
votes
1 answer
Flutter iOS Brightness undefined name
I'm building an App for iOS on Flutter. in the ColorScheme there's the brightness property and on Windows there's no error and it works, but when i open the code on the mac OS it says "undefined name 'Brightness'
Can anyone help me how to fix it?
I…

ssa
- 31
- 3
2
votes
1 answer
Better approach to set font size in flutter
I've seen some posts recommending to set fontSize or TextStyle for Text widget using Theme
// textStyle
Theme.of(context).textTheme.bodySmall
OR
// fontSize
Theme.of(context).textTheme.bodySmall.fontSize
What benefit will I get by setting…

ASAD HAMEED
- 2,296
- 1
- 20
- 36
2
votes
2 answers
Flutter, the textTheme property of the AppBarTheme class is deprecated, what should I use instead?
I am curently learning Flutter on the Maximilian Udemy Course, and when I reached the section when I have to use the textTheme property of the AppBarTheme class, it's telling me that it's deprecated. What should I replace it with. Here is what im…

Mikelenjilo
- 171
- 1
- 12
2
votes
1 answer
Differences of using ThemeExtension vs class with static theme
Flutter 3 is out and I've been experimenting a little.
I have used the ThemeExtension
yt ref: https://www.youtube.com/watch?v=8-szcYzFVao
api ref: https://api.flutter.dev/flutter/material/ThemeData/extensions.html
and its great. However I'm starting…

GhoSt
- 321
- 2
- 12
2
votes
1 answer
Dynamic theme properties in Flutter which can be set in runtime
I would like to create my own theme properties which can be set in runtime dynamically.
I tried to create an extension for the TextTheme which looks like that:
extension CustomTextTheme on TextTheme {
TextStyle get heading => themeMode ==…

saibot
- 331
- 2
- 13
2
votes
5 answers
Apply ButtonStyle Properties to All Buttons Globally
I've implemented several long ListViews containing ElevatedButtons in my flutter project, and would now like to apply various ButtonStyle properties to all of them. I am certain there is a way to avoid applying these properties to each button…

John Harrington
- 1,314
- 12
- 36
2
votes
2 answers
flutter, what is the right way to change appbar leading icon at app theme level?
flutter, what is the right way to change appbar leading icon at app theme level? so I no need to change on each screen?
I know the following code work for specific screen...
AppBar(
title: Text("Hello Appbar"),
leading: Icon(
…

ramya
- 121
- 9
2
votes
0 answers
How to dispose the theme after navigating to other route?
When I am using the navigation in it, the previous page theme is getting selected. My previous page theme is getting selected automatically even after navigating to new page. I just want to remove the previous logged in user theme data. Or simply…

Bishal Rana
- 21
- 1
- 5
2
votes
2 answers
Flutter specify Button Theme for each button type
I am working on a Flutter app and need to specify custom ButtonTheme for each button type, i.e. raised, outlined and flat.
The parameter I found in ThemeData class is only buttonTheme, and this has ButtonThemeData that is defined for all…

Amani Elsaed
- 1,558
- 2
- 21
- 36
2
votes
1 answer
Flutter: How I Can Change Theme Using Switch in Flutter - I have Implemented this Light and Dark Theme Using Provider, But can not change with switch
I have used the provider for changing themes, this is the code for light and dark theme. The main purpose of my question is to change the theme with a switch, not with a button.
The theme can be changed with a button correctly using "int mode".
But…

NASEER ULLAH
- 87
- 3
- 11
2
votes
1 answer
Why am I getting an error in the build function when changing the theme of the application?
My main file down below;
import 'package:flutter/material.dart';
import 'package:ajanda/screens/mainmenu.dart';
Future main() async{
runApp(MaterialApp(
debugShowCheckedModeBanner: false, title: "Takvim", home:…

Apple
- 141
- 2
- 7
2
votes
1 answer
Appbar color, toolbar color, text, font and buttons are not changing by applying Theme Data in flutter App
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Personal Expenses',
theme: ThemeData(
brightness: Brightness.light,
primaryColor: Colors.lightGreen[800],
primarySwatch:…

Zoraiz Ejaz
- 127
- 11