Questions tagged [flatbutton]

22 questions
32
votes
10 answers

Flutter FlatButton is deprecated - alternative solution with width and height

After Flutter Upgrade "FlatButton" is deprecated and I have to use TextButton instead. I didn't find a solution for a new button-type with width and height. This is my working FlatButton. How can I solve it with textButton or…
Moo
  • 670
  • 1
  • 6
  • 11
8
votes
3 answers

After upgrade Flutter 3.3.0 RaisedButton showing error: The method 'FlatButton' isn't defined for the type 'CartScreen'. (undefined_method

FlatButton( child: Text('ORDER NOW'), onPressed: () { Provider.of(context, listen: false).addOrder( cart.items.values.toList(), cart.totalAmount, ); cart.clear(); }, textcolor:…
farouk sherif
  • 93
  • 1
  • 1
  • 4
2
votes
2 answers

How do I change a flatbutton.icon to a textbutton in Flutter?

I have made a flatbutton icon, but it seems this is depreciated in the current flutter version. I have tried to upgrade it to a text button, but it does not show the text next to the icon. This is the original code that has to be adapted to become a…
giannik28
  • 403
  • 2
  • 6
  • 14
1
vote
1 answer

How to convert a "FlatButton" to "TextButton" in Flutter?

I got following code: FlatButton.icon( minWidth: double.infinity, padding: EdgeInsets.symmetric( vertical: kDefaultPadding, ), shape: RoundedRectangleBorder( borderRadius:…
best_of_man
  • 643
  • 2
  • 15
1
vote
3 answers

Flutter FlatButton is deprecated - alternative solution

This is my FlatButton. How can I solve it with textButton or elevatedButton? Center( child: FlatButton( onPressed: () { }, child: Container( margin:EdgeInsets.only(top: 25), child: image != null ?…
aaryan
  • 19
  • 1
  • 2
1
vote
1 answer

Flat Button Style - Hide border and Focus Cue when the Button is active

I created a flat Button with a transparent border, also setting FlatAppearance.BorderSize = 0. The border is hidden on a mouse click and the Button background uses a custom Color when the Mouse button is pressed. My problem is that cannot remove the…
alex
  • 31
  • 6
1
vote
1 answer

flutter: Bug? only FlatButton but not CupertinoButton showing Text

Did you ever experience this? Does it make sense to register this as a bug and how would I do this? For one of my screens I have now this situation for the 2nd time: I insert a CupertinoButton with Text as a child, however, the text does not show…
w461
  • 2,168
  • 4
  • 14
  • 40
1
vote
0 answers

FlatButton different text color while holding

I'm new in Flutter. I want to make a simple example. I want to change color of the flat button while holding. Essentially I did but I'm not sure it's the right way. Isn't there an easier way? For example, could be a property like…
kursat sonmez
  • 818
  • 1
  • 12
  • 22
1
vote
1 answer

Flutter Flat Button is clickable outside its visible border

Problem: I would like the user to not be able to tap a button if they click outside of its visible border. I created two FlatButton with no padding whatsoever inside them, the problem is that my button is still clickable even if I tap between the…
user13848261
1
vote
3 answers

Flutter - How can I align the buttons on the appBar to the left?

The action buttons on the appBar in Flutter are aligned to the right side as default, I would like to align my FlatButton to the left, next to the title/logo. Can anyone advise please? Below are my codes: @override Widget build(BuildContext…
Karen Chan
  • 164
  • 1
  • 1
  • 16
1
vote
2 answers

Flutter FlatButton inner space

In one of my flutter application, have a FlatButton like following FlatButton( child: Text("Forgot ist ?", style: TextStyle(color: Color.fromRGBO(107, 106, 106, 1),fontFamily: 'ActoBook'), textAlign: TextAlign.left ), …
ramesh
  • 4,008
  • 13
  • 72
  • 117
0
votes
1 answer

onChanged doesn't work while assigning a value to a variable flutter

I have to use call back to raise the variable value, but while I am trying to test that if my variable gets initialized of not using a print statement, it returns null which means the variable is not initialized. //Here is my code: note that I have…
0
votes
1 answer

After upgrading to flutter 3.3.0 I got these errors

Currently, I am having this error: Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns…
keven
  • 35
  • 5
0
votes
2 answers

The named parameter 'child' is required, but there's no corresponding argument. (Documentation) Try adding the required argument. FlatButton flutter

So I've tried remaking a project I had but with newer versions of plugins and flutter, which led to some problems of course haha, now I'm dealing with the last issue (I hope so) to which I cant find an answer. part of it in main.dart : Expanded…
Shon22
  • 57
  • 2
  • 11
0
votes
1 answer

I can't change the screen with MDFlatButton in a loop

I can't change screen by the buttons that I define in a for loop and it shows this error: AttributeError: type object 'ScreenManager' has no attribute 'manager' I want to define it in the .py file because it must be in the for loop to create a…
1
2