Questions tagged [flutter-material]
45 questions
6
votes
1 answer
Flutter material3 how are colors calculated?
Recently I started using a theme with the material3 option.` I created a colorscheme using the Figma generator. I noticed components have a slightly different color. Dropdowns, cards and pagetitles are all a different color. What is more…

Robin Dijkhof
- 18,665
- 11
- 65
- 116
5
votes
3 answers
Flutter - elegant way to define buttons
I want to create a design system for my new app.
child: ElevatedButton.icon(
icon: Icon(Icons.power_settings_new),
onPressed: () => context.go('/login'),
label: const Text('Log out'),
…

Ensei Tankado
- 270
- 2
- 12
3
votes
3 answers
Flutter CircularProgressIndicator Freeze When Navigate to Another Page for a millisecond
iam new at flutter iam trying to add CircularProgressIndicator at page loading and then change state but its seems like it freeze on navigation
Main.Dart
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
…

Ahmed_Amr
- 93
- 4
3
votes
2 answers
Flutter ReorderableDragStartListener issue detecting gesture on mobile device (but works fine in web browser)
I want to have reorderable list in flutter with custom drag handle (that works immediately, without long press first).
To achieve that I did:
buildDefaultDragHandles: false,
and I used ReorderableDragStartListener.
code:
import…

Maciej Pszczolinski
- 1,623
- 1
- 19
- 38
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
0 answers
Flutter localisation not working when adding a new language
I'm trying to write my simple flutter app for adding localisation for new language name "Hmong" with language code "hmn".
I've written some file of code there as described in docs. But, not working for me,
main.dart file…

Jay Mungara
- 6,663
- 2
- 27
- 49
1
vote
1 answer
flutter: packages auto import problem in VS code
When I create a new Stateless or statefull class in any flutter app then VScode auto imports these three packages :
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/container.dart';
import…

Mahmoud Awad
- 11
- 2
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
Flutter: White space coming while using BoxConstraints
White space coming in horizontal view, while giving max width to Container with BoxConstraints.
Versions
Flutter: 3.3.0
Dart: 2.18.0
My code
return Scaffold(
body: Container(
decoration: ...,
padding: const EdgeInsets.all(16.0),
child:…

parth
- 1,803
- 2
- 19
- 27
1
vote
1 answer
How to achieve CSS class-like styling of buttons in flutter?
I am new to flutter, and I want to reduce code duplication when it comes to UI.
Let's say that I chose some theme. ElevatedButton will have color of that theme.
Now, I want to have some buttons that will by styled alternatively (e.g. 'Cancel'…

Maciej Pszczolinski
- 1,623
- 1
- 19
- 38
1
vote
2 answers
Why is CustomPaint affected by whether it is under a Scaffold?
App〈 MaterialApp〈 MyWidget : all is good
Whether I draw the figure on a canvas with a small or a large scale—by replacing v = 100000.0 with v = 1000.0 in the following code, the image doesn't change, as expected.
(If you are not familiar with the…

Sam
- 563
- 5
- 15
1
vote
1 answer
"No Material widget found. " at Hero image animation between routes
Flutter Newb: I have a grid of image buttons on a menu screen. When clicking a button it animates into the 'leading' element of the new view's AppBar. That works as I was expecting it to. So far so good...
When I Navigator.pop() that 2nd view I get…

Andre Clements
- 634
- 1
- 7
- 15
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
0
votes
3 answers
Advanced and beautiful dropdown menu in Flutter
How can I create this dropdown menu for appbar user profile icon, in Flutter?
I'm using Material 3.
This is an example from Atlassian pages.
Different sections (Account / Recent workspaces / etc) (green marks)
Titles for sections (yellow…

Guiu Mateu
- 11
- 3
0
votes
0 answers
flutter app - screen orientation change cause initial route call issue
My app is in portrait mode, I want it to landscape mode when user click full screen mode in video payer to show video in landscape, once they exit the full screen mode, I want it back to the portrait.
For that, I used below code when user click on…

Santhosh A
- 31
- 3