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
23
votes
18 answers

Flutter ThemeData Primary color not changing from theme when trying to add a primary color

Im following the BMI Calculator app from the London App Brewery on LinkedIn Learning. when attempting to set the primaryColor to red, my emulator still shows the Light Blue default AppBar even though i am overriding the Primary Color. here's the…
17
votes
2 answers

how to add animation for theme switching in flutter?

I want to add animation for switching theme from light to dark or vice versa in flutter like telegram do : telegram's switch animation telegram's switch animation source can't see any way to do it in flutter, is it possible in flutter? thx for any…
Peyman
  • 173
  • 1
  • 10
12
votes
4 answers

Flutter change page transition speed/duration in the theme

How do I change the duration/speed on transitions set in app's theme? I am able to change the transition animation using a theme for a MaterialApp. The example below replaces the default transitions with a FadeTransition. When using the fade…
Your Friend Ken
  • 8,644
  • 3
  • 32
  • 41
11
votes
1 answer

body2 is deprecated and shouldn't be used. This is the term used in the 2014 version of material design. - warning message in flutter

If you update flutter SDK from version v1.12.13 to any version after v1.13.8, you will receive several warning messages related to textTheme usage. For example, one of them given below. info: body2 is deprecated and shouldn't be used. This is the…
Darish
  • 11,032
  • 5
  • 50
  • 70
10
votes
2 answers

Getting failed assertion with setting brightness: Brightness.dark for darkTheme

I'm getting this error: 'package:flutter/src/material/theme_data.dart': Failed assertion: line 412 pos 12: 'colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness': is not true. I've used this brightness:…
u2tall
  • 450
  • 1
  • 7
  • 12
10
votes
2 answers

How to set Flutter app theme as to dark by default?

I've created a simple login UI in flutter, but I don't know how to make the overall theme of the app as dark. What I mean is that in the future, if I add more functionality to the app, it should all be in the dark theme. Is there any way to do…
CodeSadhu
  • 376
  • 2
  • 4
  • 15
9
votes
2 answers

Understanding what default styles are used in a Flutter + Material app

Just starting out with Flutter + Material design. I notice that when a create a theme using ThemeData, if I use something like this: ThemeData( textTheme: TextTheme(bodyText1: TextStyle(color: Colors.white)), ) It doesn't seem to colour the text…
shennan
  • 10,798
  • 5
  • 44
  • 79
7
votes
3 answers

Flutter/Material 3: AppBar ignores icon themes

In my AppBar the title is displayed with white text, but the icons are a dark grey or something. I Would like to have the icons white, too. But the colors in the icon themes have no effect! Not when added directly to the AppBar... Scaffold( …
7
votes
2 answers

How do I store my default padding in Theme.of() in Flutter?

As far as I understand I'm supposed to access my style constants in flutter via Theme.of(). In Android I would have stored them in dimens.xml. None of the entries in ThemeData look to me like they are about padding amounts and it also seems…
Christian
  • 25,249
  • 40
  • 134
  • 225
6
votes
1 answer

Changing icon color in light theme doesn't have any affect

I'm writing a flutter application and I'm trying to define my own themes for light and dark themes. coding with android studio and testing it using the regular android emulator that comes with it. I noticed that when I change icon color in dark…
Anaïs
  • 73
  • 1
  • 5
5
votes
3 answers

How to change bgcolor of space below bottom navigation in Flutter

When using Gestures for Navigation, how can I change the background color of the area beneath bottom Navigation.
Suman Baul
  • 133
  • 1
  • 11
5
votes
4 answers

ThemeData primaryColor not changing appBar background color

class BMICalculator extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( primaryColor: Colors.red, ), home: InputPage(), ); I am taking this course:…
Sam
  • 51
  • 1
  • 2
5
votes
1 answer

Flutter - Access ThemeData.primarySwatch in widgets

I have this themeData: import 'package:flutter/material.dart'; import 'package:vepo/fonts.gen.dart'; import 'theme_utils.dart'; MaterialColor primarySwatch = generateMaterialColor(primaryColorMid); MaterialColor lightGreenSwatch =…
BeniaminoBaggins
  • 11,202
  • 41
  • 152
  • 287
5
votes
2 answers

Get ThemeData from static area

I am saving my Text Styles in seperate text_styles.dart file. When i want to use theme colors just like Theme.of(context).primaryColor, I cant reach ThemeData object from text_styles.dart .I solved my problem with this kind of solution but this is…
Emirhan Soylu
  • 681
  • 6
  • 12
5
votes
1 answer

How to change the Text color for a subtree in Flutter?

I want that every Text inside a particular Widget will have a white color, although they all can have different sizes. I know I can change every singe Text to have a white color, but I want to make it smart and change the Theme for that particular…
Michel Feinstein
  • 13,416
  • 16
  • 91
  • 173
1
2 3 4 5 6 7 8