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
4
votes
2 answers
How to set status bar color if using sliver app bar
As I am having sliver app bar in my screen, I am not using AppBar() widget. So by default the status bar color is white.
Is there a way to change the color of status bar from sliver.
Below code works for Android as expected, but not for…

Jitan Gupta
- 454
- 6
- 18
4
votes
3 answers
How to set the color based on dark / light theme?
I want to set a dark and a light color scheme and use it as a background color of containers.
Here is my code:
Container(
padding: const EdgeInsets.all(kDefaultPadding),
//change required here:
decoration: const BoxDecoration(color:…

Jitan Gupta
- 454
- 6
- 18
4
votes
1 answer
Flutter: How to theme material widgets in Cupertino theme?
I have a Flutter app which uses Material theme for Android and Cupertino theme for iOS. But I use Card widget, which is a Material widget, in both themes. Now I have the following code in main.dart
Widget build(BuildContext context) =>…

Kavin Zhao
- 45
- 5
4
votes
2 answers
Flutter: Change Statusbar Text Color not working properly
Almost all the Q/A referred on Stackoverflow related to the same topic but didn't get proper solutions.
Main Question: My app having the primary color blue and I want to set Statusbar Text Color white.
What I have tried:
Using SystemChrome: (Using…

Pratik Butani
- 60,504
- 58
- 273
- 437
4
votes
1 answer
Can you change flutter text theme?
If the theme is set in main.dart as
return MaterialApp(
title: 'MY APP',
theme: ThemeData(
primarySwatch: Colors.blue,
fontFamily: 'Cabin',
textTheme: TextTheme(
headline1: TextStyle(
fontFamily: 'Raleway',
…

Maria PapaG
- 175
- 2
- 14
4
votes
2 answers
How to fill color inside of checkbox in flutter?
Here is what I am using for checkbox in flutter.
But I can set only border color for unchecked state, not method found for fill color inside of the checkbox.
Please help me with this.
Theme(
data: ThemeData(unselectedWidgetColor: Colors.white),
…

Haley Huynh
- 1,392
- 9
- 16
4
votes
2 answers
Elevated Button themedata border - Flutter
How can I implement sideBorder to elevatedButton through themedata.enter image description here
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(side: MaterialStateProperty//Stuck here),
),

Raj A
- 544
- 9
- 21
4
votes
4 answers
Flutter search unable to override certain theme styles
I am trying to customized the appearance of search using a custom SearchDelegate, but it appears that overriding appBarTheme only updates certain theme styles. I am able to change the color of the app bar and text style, but I appears to ignore…

Your Friend Ken
- 8,644
- 3
- 32
- 41
3
votes
1 answer
Toggle theme mode using bloc in flutter
I'm new to flutter, I'm building an app using bloc for state management.
I'm trying to toggle theme mode using IconButton on the appBar but the theme won't change when I press the button.
how can I fix that ? I'm creating this app by watching a…

Ahmed Thomas
- 31
- 3
3
votes
0 answers
Flutter ThemeExtension: What to to if lerp is not support by property
I am Trying to work with flutter ThemeExtension and I don't have quit understood how lerp works.
Here a example ThemeExtension:
enum MyButtonVariant {
solid,
soft,
outlined,
text,
}
class MyButtonStyle extends ThemeExtension…

socramm
- 71
- 3
3
votes
2 answers
What is difference between primary and onPrimary properties in ColorScheme Flutter
While defining ThemeData of the Flutter app, we can define colorScheme property.
This property has inner-properties such as background & onBackground, primary & onPrimary, secondary & onSecondary, etc. Also, all these properties are set as…

Jaineel Mamtora
- 498
- 4
- 10
3
votes
2 answers
Flutter TextStyle (not TextTheme) difference between apply() and copyWith()
I'm creating theme for my app.
I'm confusing these 2 methods (apply, copyWith) of TextStyle.
What should be used?
There're also 2 methods with the same names in TextTheme.
I understand them, but can not get the idea in TextStyle.
Logic of these 2 in…

vietstone
- 8,784
- 16
- 52
- 79
3
votes
1 answer
Flutter : How to set 2 different styles for text button in both light and dark mode
I am trying to create custom theme data something like this.
class CustomTheme {
static ThemeData get lightTheme {
return ThemeData(
textTheme: TextTheme(
headline1: h1.copyWith(color: Color(0xff444444)),
…

Midhun Murali
- 921
- 6
- 11
3
votes
2 answers
how do i use provider in this situation
I want to create a change app theme mode and I saw a way of creating it with Provider but I'm new to Provider. For Example, I want to add some codes like this
(the highlighted code)
in my main which consists of many routes

Priscilla
- 53
- 9
3
votes
2 answers
Flutter How to set onPressed to change ThemeData?
I want to change the theme to dark theme & return to light theme with this button:
IconButton(
icon: Icon(
Icons.brightness,
),
onPressed: () {
setState(() {
// Change to dark theme?
} else {
…

Shop Plus
- 33
- 3