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
2
votes
2 answers
Set Color to Text Widget in App universally in flutter without mentioning the theme inside the Widget everytime
I am new to flutter and trying out things.
I replaced the Scaffold Widget with a Center Widget (Just messing around). All text had a Yellow underline, to overcome this I used TextDecoration
Text(
friend.name,
style: TextStyle(
…

Nikhileshwar
- 1,666
- 1
- 11
- 26
1
vote
0 answers
Implemention of Dark/light theme mode in flutter
i am trying to create a way to start my app with system theme and then giving user a switch to choose between light mode and dark mode
in my main.dart file
import 'package:edubro/pages/Attendance/show_attendance.dart';
import…

Abhishek kushwaha
- 11
- 3
1
vote
2 answers
Flutter ColorScheme not applying colors
I'm trying to use a dark theme in a Flutter app but everything seems wrong. I'm using dark theme like this.
ThemeData darkTheme = ThemeData.from(
useMaterial3: true,
colorScheme: ColorScheme.dark(
brightness: Brightness.dark, // tried with…

Emre
- 111
- 2
- 10
1
vote
1 answer
I'm getting this error when I add theme data in flutter
import 'package:flutter/material.dart';
import 'package:my_application_1/pages/home_page.dart';
void main() {
runApp(my_application_1());
}
class my_application_1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
…

Ayushman Singh
- 11
- 2
1
vote
1 answer
Why tabs text are black in flutter tabs dark mode?
Have a example project with tabs but the tabs text are black with dark gray background, i need chose manualy white text color for each theme or is automatic?
The code:
import 'package:flutter/material.dart';
void main() {
runApp(const…

e-info128
- 3,727
- 10
- 40
- 57
1
vote
2 answers
Updating theme when resuming to Flutter app
I'm new to Flutter and I'm trying to theme my app dynamically so that the user can select his preferred theme either locally or get the system theme.
I managed to get it to work except for when pausing and then resuming to the app after changing the…

dawed1999
- 335
- 1
- 3
- 11
1
vote
1 answer
Primary custom color not working in flutter
I have a problem here I want to change color of textbutton from themedata but its not working. Here is my code :
darkTheme: ThemeData(
primaryColor:Colors.white,
textButtonTheme: TextButtonThemeData(
style:…

Sayed Suliman
- 67
- 4
1
vote
1 answer
Flutter 3 Web App: Custom Colors or Theme
I am (very) new to Flutter. I'm using Flutter 3 and Dart 2.17.
I am making a web app and am trying to set up the color scheme for my app. In CSS, I'd normally do something like this to define a set of colors for light and dark mode:
:root {
…

Clifton Labrum
- 13,053
- 9
- 65
- 128
1
vote
2 answers
Flutter custom widget styling
I'm working on a big app tightly with the designer.
I was a part of the style guide and the component design process,the designer handed off his work and now its my turn to translate some prototypes and styles to real flutter app.
I'm having a…

Br4infreze
- 342
- 3
- 11
1
vote
3 answers
While using GetMaterialApp fontFamily for the Theme is not Changing
I am using Getx for my state management. So When I Change MaterialApp to GetMaterialApp, the fontFamily switched back to the default.
pubspec.yaml file
flutter:
uses-material-design: true
fonts:
- family: Sen
fonts:
- asset:…

Sanjay TM
- 369
- 2
- 17
1
vote
3 answers
How to overwrite textButtonTheme?
I have defined theme for TextButton.
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
scaffoldBackgroundColor: const Color(0xfff9f9f9),
…

Karol Wiśniewski
- 378
- 4
- 15
1
vote
4 answers
The method 'of' isn't defined for the type 'ThemeProvider'. in Flutter
I am Beginner to Flutter just following the YouTube tutorial on building User Profile while doing everything is OK but Theme Provider gave me the error I didn't understand What's going on can You guys help me, the error is The method 'of' isn't…

shanmkha
- 416
- 1
- 8
- 27
1
vote
1 answer
Acces primarySwatch of ThemeData in Flutter
I'm using two different ThemeData classes for switching between dark and light mode. However I am using a color scheme which requires me to access the colors inside the swatch I have defined.
static const int _greyPrimaryValue = 0xFF1E1E1E;
static…

Edblocker
- 430
- 1
- 3
- 15
1
vote
0 answers
On dynamic theme change, Theme.of(context) colors are not updating
I have a conditional theme widget:
return Theme(
data: themeMode == ThemeMode.light ? formThemeTwo : formThemeTwoDark,
child: Scaffold(
That changes the theme depending on the ThemeMode.
When the theme changes, this doesn't…

BeniaminoBaggins
- 11,202
- 41
- 152
- 287
1
vote
1 answer
ButtonStyle padding different from container padding
Why is it that a ButtonStyle's padding property is not equivalent to a Container's padding property in terms of pixels?
I would expect the TextButton and Container text to be aligned when placed together here:
Column(
crossAxisAlignment:…

shennan
- 10,798
- 5
- 44
- 79