"You also need to spell image correctly", your sense of humour is awesome. That is something a very good teacher should have. Cheers to great teaching mate!
Flutter changes too quickly! Just to put in a bit - around 3:15 he adds a color property to the RaisedButton (which is now called ElevatedButton, as many commentors pointed out). However, as far as I can tell, the ElevatedButton class no longer allows you to simply add a color parameter, it's a longer process. After a bit of hair-pulling, this is the code that eventually gave me what I wanted: body: const Center( child: ElevatedButton( onPressed: null, style: ButtonStyle( backgroundColor: MaterialStatePropertyAll(Colors.lightBlue), To change the style of the button, the class ButtonStyle is used within the ElevatedButton widget, and then to set a background color you have to use this MaterialStatePropertyAll widget, which you then nest the color inside of as you see above. After trying various methods and getting a lot of errors messages, I'm pretty sure this is how it must be done now. Let me know if anyone has a simpler method! EDIT: Strangely, the IconButton widget does allow you to use a color parameter, so you won't have to use the code above to change color. The only odd thing on my machine is that I had to put the color: parameter BEFORE the icon: parameter. So my code looked a bit more like: body: Center( child: IconButton( color: Colors.amber, iconSize: 75.0, onPressed: () { print('Why did you click me?'); }, icon: const Icon(Icons.alternate_email), As you can see, I increased the size of the icon as well. Hope it helps if anyone is having issues!
If you use null for onPressed, it won't do the click animation when you press it (granted it is not doing anything at the moment so it's not a big deal). To do onPressed () {}, you just have to remove the const before Center. Also, for the color part I did Style: ElevatedButton.styleFrom( background color: red, ), Nonetheless, there are no wrong ways to do it and as you said, it has changed quite a bit since the tutorial so cheers to us all finding ways around.
RaisedButton has been deprecated Use instead ElevatedButton An example: child: ElevatedButton( onPressed: () {}, child: Text('click me'), style: ElevatedButton.styleFrom( primary: Colors.lightBlue, ), Although without using color my button was already blue so you can substitute any of the other colors
@@TenDigitGrid because a function will be executed when the button is pressed, the content of the "Center" class will no longer be static, then the "const" keyword that precedes "Center" must be removed.
The UI / UX part of me screamed internally with the contrast between the black text on that blue and then with the button that doesn't look like it's supposed to be clickable... (Love your tutorials as always, keep up the awesome work)
Thank you for playing a vital role in placing such kind of tutorials that are worth. God bless you, sir when I get my first cheque al make sure I avail myself on your Patreon. Honour master! under your guidance, I'm humbled to be a student as a ninja, Keep the tuts coming!.#From Downtown Nairobi
RaisedButton was depreciated, and replaced with ElevatedButton. I don't get why the developers behind Flutter, thought a name change was a good idea. Hopefully Net Ninja's Flutter MasterClass addresses these issues. Still best Flutter Tutorial Series ever!
RaisedButton is now deprecated, You should use ElevatedButton. Heres an example. child: ElevatedButton( onPressed: () { print('Clicked'); }, child: Text('Click me'), style: ButtonStyle( backgroundColor: MaterialStateProperty.all(Colors.red), ))
around 3:15 body: Center( child: ElevatedButton( onPressed: (){}, child: Text('click me'), style: ElevatedButton.styleFrom(backgroundColor: Colors.red), ), ), this is what worked for me.
Some buttons are deprecated and not working as 2023 May So below are new ones: FlatButton -> TextButton RaisedButton -> ElevatedButton OutlineButton -> OutlinedButton
What about the delete function that we achieve in the constructor ? i try to access the delete function inside the onPressed property and it said : "The argument type 'Function' can't be assigned to the parameter type 'void Function()?' . Hope you can help mate
@@delfinlimriadi3840 Sorry mate, I have no idea which constructor you are mentioning. We don't have delete function in this course isn't it ? Or from another video # ?
As of May 2021 the RaisedButton class in flutter is deprecated. ElevatedButton class should be used instead. The later class will eventually be removed from flutter SDK, so it is suggested to move to the newer class.
Thank you for these perfect clear tutorials. Is it possible to right align AppBar for Scaffold? my app language is rtl and this is better to have the title and leading start from the right edge.
Android studio is laging like crazy after every minute it says not responding and freezes for couple of minutes My PC has 4 gb ram Intel i3 64 bit , nvidia GeForce GT 710 What should I upgrade???? and windows 10
Nice tutorial, but I don't like that you delete parts of code after finishing explanation, when I followed thenewboston android tutorial (long time ago), he made all parts as separate screens accessible by buttons - that way you could find what you need in your old code,.. That approach is much better.
@@NetNinja Nice Videos, but if you've got the time I'd really appreciate it if you had updated the videos that have new changes made, e.g. things like RaisedButton is now replaced/renamed to ElevatedButton. It might not be an issue for some but for newcomers, it's puzzling 🙂
hey there, i saved this tutorial and i'm watching every single video . Thanks a lot for your videos, really helpful. But i have one tiny problem, when i click Ctrl+Q either in colors or icons i don't see colors i just have limited colors to use, and even in icons for example : airport_shuffle doesnt exists unless i wrote it manually ( doesn't exists in list). ( i downloaded the same android studio u mentioned in description down below the video) what should i do to solve this problem ?
JULY 26, 2022 For those struggling with ElevatedButton Color here's a code that works. ElevatedButton( onPressed: () {}, style: ElevatedButton.styleFrom( primary: Colors., ), child: Text('Click Me')
RaisedButton is deprecated. Use ElevatedButton: child: ElevatedButton( onPressed: () {}, child: Text('ClickMe'), ) If you have errors on the onPressed: "Invalid constant value.", just remove the "const" word.
Hi, bro....nice tutorial...thank you... We all know in the flutter template this a counter with floating action button. But, can you give some helps for this problem below? (or maybe this is a challenge for you). Make a page/screen with these requirements: 1. several counter buttons in (let's say) a grid with button A, B, C etc.; 2. each button will have each count (onPressed); 3. a widget of total count from those pressed button; 4. the buttons should be able to disable after pressed and re-enabled after specified time. Great thanks...
everyone is stuck at some point , the point is , to give yourself some time for rest but don't ever give up . take a brake , but don't give up . if u are stuck then try to learn it from a different person or book or anything , maybe then u will understand it.
Cause he is always learning, even while making this video he has to go through the documentation at some point in order to provide us with the correct info. Learning never stops
Probably half of the items you're working with no longer work with a 2022 version of the app. For example, RaisedButton is deprecated, so I comment that out. Can't compile. I don't know why, so I start removing things. I get to void main(); and still have errors. #$%@! Flutter seems like a really complicated framework. I looked for a 'hello world' app to start over: import 'package:flutter/material.dart'; void main() { runApp(const GeeksForGeeks()); } class GeeksForGeeks extends StatelessWidget { const GeeksForGeeks({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return const MaterialApp( home: Center(child: Text('Hello World')), ); } }
Hey, it means 'also', or 'in addition to' - I'm not sure what context I used it in, if that explanation doesn't make sense, let me know where I say it in the video and I will check :)
Note: 3:37 It is not FlatButton() anymore instead TextButton(), according to new flutter update.... Hope that helps!!!
Great
Yes, RaisedButton() is now: ElevatedButton() aswell
@@shalazoo8806 OMG I LOVE YOU GUYS SO MUCH!!!!!
Thanks man
@@shalazoo8806 u do not know how long i was searching my code what was wrong thanks brother
"You also need to spell image correctly", your sense of humour is awesome. That is something a very good teacher should have. Cheers to great teaching mate!
Flutter changes too quickly! Just to put in a bit - around 3:15 he adds a color property to the RaisedButton (which is now called ElevatedButton, as many commentors pointed out). However, as far as I can tell, the ElevatedButton class no longer allows you to simply add a color parameter, it's a longer process. After a bit of hair-pulling, this is the code that eventually gave me what I wanted:
body: const Center(
child: ElevatedButton(
onPressed: null,
style: ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.lightBlue),
To change the style of the button, the class ButtonStyle is used within the ElevatedButton widget, and then to set a background color you have to use this MaterialStatePropertyAll widget, which you then nest the color inside of as you see above. After trying various methods and getting a lot of errors messages, I'm pretty sure this is how it must be done now. Let me know if anyone has a simpler method!
EDIT: Strangely, the IconButton widget does allow you to use a color parameter, so you won't have to use the code above to change color. The only odd thing on my machine is that I had to put the color: parameter BEFORE the icon: parameter. So my code looked a bit more like:
body: Center(
child: IconButton(
color: Colors.amber,
iconSize: 75.0,
onPressed: () {
print('Why did you click me?');
},
icon: const Icon(Icons.alternate_email),
As you can see, I increased the size of the icon as well. Hope it helps if anyone is having issues!
Thank you so much!
If you use null for onPressed, it won't do the click animation when you press it (granted it is not doing anything at the moment so it's not a big deal). To do onPressed () {}, you just have to remove the const before Center. Also, for the color part I did
Style: ElevatedButton.styleFrom(
background color: red,
),
Nonetheless, there are no wrong ways to do it and as you said, it has changed quite a bit since the tutorial so cheers to us all finding ways around.
My icons show up as a box with an x in the middle do you know what could be causing this?
Where is your code? There is not code.
child: ElevatedButton.icon(
onPressed: () {},
style: const ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.green)
),
This framework changes so rapidly. 50% of the functions introduced in this series have been depreciated already !!
WAIT!!!!!
DONT LOOK AROUND!!
THIS IS THE BEST PLAYLIST IN RUclips TO LEARN FLATTER!
YOU ARE WELCOME.
Flutter*
i 2 agree :)
it sure iiiiss ^_^
agree
Agree
RaisedButton has been deprecated
Use instead ElevatedButton
An example:
child: ElevatedButton(
onPressed: () {},
child: Text('click me'),
style: ElevatedButton.styleFrom(
primary: Colors.lightBlue,
),
Although without using color my button was already blue so you can substitute any of the other colors
I get an error at the (){}
tks you very much!
@@TenDigitGrid it needs a child property
@@TenDigitGrid because a function will be executed when the button is pressed, the content of the "Center" class will no longer be static, then the "const" keyword that precedes "Center" must be removed.
@@andresfeliperiostamayo7307 ❤
Your English is sooooooooo perfect Bless you for this channel
Maybe because he’s English 🤔
@@gorgestboi1028 I think he meant understandable.
The UI / UX part of me screamed internally with the contrast between the black text on that blue and then with the button that doesn't look like it's supposed to be clickable... (Love your tutorials as always, keep up the awesome work)
FYI, "RaisedButton" has now been replaced by "ElevatedButton"
Should h'v looked at the comments earlier took me a hour nd a lot of chat gpt to fig tht out
This is the best channel ever to study flutter. So proud to the creator of this channel.
Brilliant training. Very well paced, structured and delivered.
Plzz upload videos as soon as possible I can't wait to become a flutter ninja
Thank you so much for all of these! You explain things so well and kindly!
For anyone wondering, the mac equivilant of CRTL+Q is control+J
when you accidentally press ⌘Q
It should be elevated button in the newer versions of flutter for those that are wondering.
What’s the equivalent for flatbutton in new version?
@@revengine4830 my android studio said it's text button
@@BB-fg9ed yup it is
Thanks
Thank you very much for these step-by-step tutorials, sir ! Much appreciated !
Thank you for playing a vital role in placing such kind of tutorials that are worth. God bless you, sir when I get my first cheque al make sure I avail myself on your Patreon. Honour master! under your guidance, I'm humbled to be a student as a ninja, Keep the tuts coming!.#From Downtown Nairobi
Thank you so much :)
RaisedButton was depreciated, and replaced with ElevatedButton. I don't get why the developers behind Flutter, thought a name change was a good idea. Hopefully Net Ninja's Flutter MasterClass addresses these issues. Still best Flutter Tutorial Series ever!
RaisedButton is now deprecated, You should use ElevatedButton.
Heres an example.
child: ElevatedButton(
onPressed: () {
print('Clicked');
},
child: Text('Click me'),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.red),
))
yo. thanks
They could have retained the color property though. The new method is kind of a hassle.
Thanks for the good work bro
I am cambodian. I like your video . Thanks for your sharing .
the best teacher 💎
thank you you make me love flutter i promise i will learn it in 10 days
around 3:15
body: Center(
child: ElevatedButton(
onPressed: (){},
child: Text('click me'),
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
),
),
this is what worked for me.
Thank you so much. I honestly believe you are a great teacher.
Note:7:50
body: Center(
child: ElevatedButton.icon
(onPressed: () {},
icon: Icon(Icons.mail),
label: Text('Mail Me'),
style: ElevatedButton.styleFrom(
primary: Colors.amber
),
),
),
Brooooooooooooo, You are the best tutor i have ever seen , 👍👍👍👍👍 , keep it up👍👍, thanks for helping , 🙏🙏🙏🙏🙏, thanks for teaching
thank you so much shaun .i learned both programming and english from you. much appreciated.please make a tutorial about typescript
After so much trial and error 05:52
ElevatedButton.icon(
onPressed: () {
print("OKay");
},
icon: const Icon(
Icons.mail,
),
label: Text("Okay"),
style: const ButtonStyle(
backgroundColor: WidgetStatePropertyAll(Colors.black),
),
Some buttons are deprecated and not working as 2023 May
So below are new ones:
FlatButton -> TextButton
RaisedButton -> ElevatedButton
OutlineButton -> OutlinedButton
What about the delete function that we achieve in the constructor ? i try to access the delete function inside the onPressed property and it said : "The argument type 'Function' can't be assigned to the parameter type 'void Function()?' . Hope you can help mate
@@delfinlimriadi3840 Sorry mate, I have no idea which constructor you are mentioning. We don't have delete function in this course isn't it ? Or from another video # ?
@@japarjarkynbyek8494 oh yeah sorry 😭 , it's another vidio and i got the answer from stackoverflow btw . Thanks for ur response 👍👍
Very helpful tutorial so far, tho I haven't noticed the difference between Flat and Raised button
Button Widget at tutorial is deprecated now, but your explain and example is awesome.
Thank you ! You are doing a really good job "teaching".
RaisedButton is now ElevatedButton. Everything else is the same
style: ElevatedButton.styleFrom(primary: Colors.green), - this is for color. also keeps the text visible.
@@eliudnjai how about flatbutton
As of May 2021 the RaisedButton class in flutter is deprecated. ElevatedButton class should be used instead. The later class will eventually be removed from flutter SDK, so it is suggested to move to the newer class.
at 2:03, The FlatButton, RaisedButton and OutlineButton widgets have been replaced by TextButton, ElevatedButton, and OutlinedButton respectively.
your tutorial is really damn good and well explained. It helps me lot. Thank you!
Thanks! :)
Thank you for these perfect clear tutorials.
Is it possible to right align AppBar for Scaffold?
my app language is rtl and this is better to have the title and leading start from the right edge.
Android studio is laging like crazy after every minute it says not responding and freezes for couple of minutes
My PC has 4 gb ram
Intel i3 64 bit , nvidia GeForce GT 710
What should I upgrade????
and windows 10
Incredibly helpful!
thank you so much for this series! :D
You are the best bro, thanks for everything
Nice tutorial, but I don't like that you delete parts of code after finishing explanation, when I followed thenewboston android tutorial (long time ago), he made all parts as separate screens accessible by buttons - that way you could find what you need in your old code,.. That approach is much better.
Excelente curso , muy didactico gracias Mister Ninja
thank you to create the videos that easy to learn.👏
One of the best method....Thanks for helping sir.....
Thank you.
Million Thanks. Best videos to learn.
These are great! Thank you so much!!!
Awesome, as per usual
Thanks a lot, very easy understanding
Glad to hear that :) thanks for watching Letácio!
@@NetNinja Nice Videos, but if you've got the time I'd really appreciate it if you had updated the videos that have new changes made, e.g. things like RaisedButton is now replaced/renamed to ElevatedButton. It might not be an issue for some but for newcomers, it's puzzling 🙂
thank you so much bro you are the best of the best
Do you have a modern version of these tutorials as a lot of these functions are deprecated now
2022 October Update:
ElevatedButton.icon(
onPressed: () {},
icon: Icon(Icons.mail),
label: Text("Email me"),
style: ElevatedButton.styleFrom(backgroundColor: Colors.black),
),
#primary is now outdated.
Thank you
Awesome lesson but i was wondering how do i make the button play audio on pressed
I love your tutorial so much
Thank you so much!
This course is perfect 😊 but can you update it pleaseeeee
great Tutorials mate
Thank you for the tutorials.
sir! Icons are not showing?
what to do?
Child property is slightly confusing me
Awesome! Thanks!
I love this tutorial :D
really Great tutorial videos
hey there, i saved this tutorial and i'm watching every single video . Thanks a lot for your videos, really helpful. But i have one tiny problem, when i click Ctrl+Q either in colors or icons i don't see colors i just have limited colors to use, and even in icons for example : airport_shuffle doesnt exists unless i wrote it manually ( doesn't exists in list). ( i downloaded the same android studio u mentioned in description down below the video) what should i do to solve this problem ?
airport_shuffle might not exist but airport_shuttle does
but what is the mac equivalent of CRTL+Q?
want it too
@@kkkkk943 Ctrl J
JULY 26, 2022
For those struggling with ElevatedButton Color here's a code that works.
ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.,
),
child: Text('Click Me')
The names of buttons have change check docs to get the new name
The BEST EVER !
Update, The RaisedButton method is deprecated. Use ElevatedButton instead.
I think an updated tutorial would be great some of the commands are outdated
As per Flutter 3.0 and 3.1 these buttons are no more, available is there any other videos on Icons and Buttons
Can we use customise icon for mail?
RaisedButton is deprecated. Use ElevatedButton:
child: ElevatedButton(
onPressed: () {},
child: Text('ClickMe'),
)
If you have errors on the onPressed: "Invalid constant value.", just remove the "const" word.
Hi, bro....nice tutorial...thank you...
We all know in the flutter template this a counter with floating action button. But, can you give some helps for this problem below? (or maybe this is a challenge for you).
Make a page/screen with these requirements:
1. several counter buttons in (let's say) a grid with button A, B, C etc.;
2. each button will have each count (onPressed);
3. a widget of total count from those pressed button;
4. the buttons should be able to disable after pressed and re-enabled after specified time.
Great thanks...
Can you make a video about how to call C language from flutter?
Great!
perfect
OMG Awesome videos
does flutter allow us to show like icon on the corner of the message box like how it is displayed on iOS chat application? - thanks
Is it possible to create fully custom buttons ?
With Flutter 2.0 RaisedButton is deprecated and replaced by ElevatedButton
bless you
sir please upload videos daily
Working as fast as I can :)
hey how do you add multiple buttons in the center
I get a fail wich says 'the named parameter 'floatingActionButton' isn't defined' what should I do?
hello, does it matter that you're doing this in "StatelessWidget"? what really is the significance of one or the other.
beton yetmez betonnn....
Why there is no icon property inside icon widget.
In early lessons you told that we should have property inside widget.
How can we turn the shape of the Raisedbutton.icon into a round ?
Shaun how did you learn all this things.. Please answer me... I am always stuck at somepoint whenever I learn something new. Please reply
Research 🙄
everyone is stuck at some point , the point is , to give yourself some time for rest but don't ever give up .
take a brake , but don't give up .
if u are stuck then try to learn it from a different person or book or anything , maybe then u will understand it.
@@user-og9nl5mt1b Thanks man
Cause he is always learning, even while making this video he has to go through the documentation at some point in order to provide us with the correct info. Learning never stops
Probably half of the items you're working with no longer work with a 2022 version of the app. For example, RaisedButton is deprecated, so I comment that out. Can't compile. I don't know why, so I start removing things. I get to void main(); and still have errors. #$%@! Flutter seems like a really complicated framework. I looked for a 'hello world' app to start over: import 'package:flutter/material.dart';
void main() {
runApp(const GeeksForGeeks());
}
class GeeksForGeeks extends StatelessWidget {
const GeeksForGeeks({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Center(child: Text('Hello World')),
);
}
}
there's so many keys! why? : GeeksForGeeks({Key? key}) : super(key: key); But at least I can compile and run.
What if I want to use the icon on the right? in this method he was always on the left side
I am getting parameter format not correct error, but the app was working just fine few days back, please help me
Here's a button example in August 2022, that actually works, even though 'FlatButton' is deprecated: import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Flutter FlatButton Example'),
),
body: Center(child: Column(children: [
Container(
margin: EdgeInsets.all(25),
child: FlatButton(
child: Text('SignUp', style: TextStyle(fontSize: 20.0),),
onPressed: () {},
),
),
Container(
margin: EdgeInsets.all(25),
child: FlatButton(
child: Text('LogIn', style: TextStyle(fontSize: 20.0),),
color: Colors.blueAccent,
textColor: Colors.white,
onPressed: () {},
),
),
]
))
),
);
}
}
(love all those ))),}))s, like someone is a little () class crazy.
should I learn angular 8.0 or react ? what your views on this ?
Stick with flutter
@@akshay6019 u are really an out of the box thinker .
how to put the text just below the icon like Settings icon and down to that the text 'Settings' ?
omg thats insane why flutter keeps changing the properties??
How to change a button label dynamically?
Nice video
What does the phrase 'as well' mean?
Hey, it means 'also', or 'in addition to' - I'm not sure what context I used it in, if that explanation doesn't make sense, let me know where I say it in the video and I will check :)
I like to know how to do an iconButton but the icon is an asset or an image