Flutter Tutorial for Beginners #9 - Buttons & Icons

Flutter Tutorial for Beginners #9 - Buttons & Icons

Net Ninja

4 года назад

457,562 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Muhammad Aiman
Muhammad Aiman - 01.10.2023 19:53

easy code for latest dart
body: Center(
child: ElevatedButton(
child: Text('takde pe'),
onPressed: () {},
),
),

Ответить
Yashwant Choure
Yashwant Choure - 15.09.2023 03:23

I am getting error in Icons.. It is saying no directionlity widget found. Scaffold wodgets require a Directiomality widget ancestor.

Ответить
khyati chavda
khyati chavda - 24.07.2023 13:54

your tutorial is really damn good and well explained. It helps me lot. Thank you!

Ответить
ali sheykhlar
ali sheykhlar - 14.07.2023 10:27

perfect

Ответить
Spolio
Spolio - 24.06.2023 17:40

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.

Ответить
AzimA
AzimA - 15.06.2023 15:31

Note:7:50
body: Center(
child: ElevatedButton.icon
(onPressed: () {},
icon: Icon(Icons.mail),
label: Text('Mail Me'),
style: ElevatedButton.styleFrom(
primary: Colors.amber
),
),
),

Ответить
Ravi Jagannadhan
Ravi Jagannadhan - 24.05.2023 02:22

FYI, "RaisedButton" has now been replaced by "ElevatedButton"

Ответить
Faisal Saddique
Faisal Saddique - 17.05.2023 12:16

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.

Ответить
Muddy Mkamba
Muddy Mkamba - 16.05.2023 17:09

Thanks, Content Creator your level of explanation is perfect, I am new but the way you explain it, feels like Soon I will be a flatter programmer

Ответить
Lil BoNgSkY
Lil BoNgSkY - 15.05.2023 15:26

is there an update soon?

Ответить
headache
headache - 15.05.2023 15:25

waiting for new update

Ответить
Ansar Paguio
Ansar Paguio - 15.05.2023 11:48

new update please🥺

Ответить
Mc Ronut
Mc Ronut - 11.05.2023 20:21

Update, The RaisedButton method is deprecated. Use ElevatedButton instead.

Ответить
nuran ferzeli
nuran ferzeli - 11.05.2023 09:23

RaisedButton deprecated

Ответить
Null
Null - 07.05.2023 15:42

The names of buttons have change check docs to get the new name

Ответить
Japar Jarkynbyek
Japar Jarkynbyek - 03.05.2023 12:35

Some buttons are deprecated and not working as 2023 May
So below are new ones:
FlatButton -> TextButton
RaisedButton -> ElevatedButton
OutlineButton -> OutlinedButton

Ответить
MAKWANA HARSH MAHESHKUMAR
MAKWANA HARSH MAHESHKUMAR - 04.04.2023 11:55

If you are using Flutter 2.0 or above, you should use ElevatedButton instead of RaisedButton. Here's an example of using ElevatedButton:

Ответить
clovis stanford
clovis stanford - 19.02.2023 16:25

Old Widget | Old Theme | New Widget | New Theme
FlatButton | ButtonTheme | TextButton | TextButtonTheme
RaisedButton |ButtonTheme | ElevatedButton | ElevatedButtonTheme
OutlineButton | ButtonTheme | OutlinedButton | OutlinedButtonTheme

Ответить
Wu Gabriel
Wu Gabriel - 07.02.2023 15:34

Just to share the RaisedButton is deprecated and replaced by ElevatedButton.

Ответить
El Nino
El Nino - 03.02.2023 16:28

The RaisedButton, FlatButton and OutlineButton has been upgraded to ElevatedButton, FilledButton and OutlinedButton
And
The RaisedButton.Icon()
Is
ElevatedButton.icon()

Ответить
Shafagh Spider
Shafagh Spider - 24.11.2022 18:33

With Flutter 2.0 RaisedButton is deprecated and replaced by ElevatedButton

Ответить
Letácio Galvão
Letácio Galvão - 26.10.2022 05:14

Thanks a lot, very easy understanding

Ответить
Bukky Odunsi
Bukky Odunsi - 28.09.2022 22:29

This course is perfect 😊 but can you update it pleaseeeee

Ответить
Kaesham
Kaesham - 05.09.2022 16:20

what about label ?

Ответить
Adidam Library Appstore
Adidam Library Appstore - 24.08.2022 00:06

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<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Flutter FlatButton Example'),
),
body: Center(child: Column(children: <Widget>[
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.

Ответить
Adidam Library Appstore
Adidam Library Appstore - 23.08.2022 20:33

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')),
);
}
}

Ответить
Globalographerr
Globalographerr - 29.07.2022 20:40

Can we use customise icon for mail?

Ответить
Shashank Rai
Shashank Rai - 26.07.2022 11:07

JULY 26, 2022
For those struggling with ElevatedButton Color here's a code that works.
ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.<color>,
),
child: Text('Click Me')

Ответить
Narayan Dhungana
Narayan Dhungana - 01.04.2022 05:53

There seems error while printing 'you clicked me'. Help me.

Ответить
SINBAD
SINBAD - 29.03.2022 20:51

I think an updated tutorial would be great some of the commands are outdated

Ответить
Paul Morphy
Paul Morphy - 06.02.2022 00:15

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

Ответить
nail info
nail info - 29.01.2022 01:33

thank you so much bro you are the best of the best

Ответить
Pankaj Motiyar
Pankaj Motiyar - 18.01.2022 03:27

how to put the text just below the icon like Settings icon and down to that the text 'Settings' ?

Ответить
Ojas Dudhabaware
Ojas Dudhabaware - 04.01.2022 22:51

Here while using color, I am getting an error as "The named parameter 'color' isn't defined." I have tried using flutter clean and Invalidate Caches/Restart method. Can anyone help me with this?

Ответить
Usman Shoaib
Usman Shoaib - 28.12.2021 09:24

Thank you for the tutorials.
sir! Icons are not showing?
what to do?

Ответить
Cyber Dash
Cyber Dash - 19.12.2021 13:37

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 ?

Ответить
Coostick
Coostick - 19.10.2021 21:27

Thank you so much. I honestly believe you are a great teacher.

Ответить
lo ol
lo ol - 11.10.2021 10:54

is anybody's button not printing to their cosole

Ответить
Vijay Babaria
Vijay Babaria - 06.10.2021 20:33

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

Ответить
Md Akter
Md Akter - 26.09.2021 18:13

Nice video

Ответить
Stefon Glover
Stefon Glover - 10.09.2021 16:26

These are great! Thank you so much!!!

Ответить
Andrea Vozza
Andrea Vozza - 13.08.2021 10:34

In this video you use deprecated widgets

Ответить
Khem Sreynat
Khem Sreynat - 06.07.2021 04:48

I am cambodian. I like your video . Thanks for your sharing .

Ответить
Zeno
Zeno - 17.06.2021 14:50

thank you so much for this series! :D

Ответить
ARIHANT JAIN
ARIHANT JAIN - 07.06.2021 09:57

What if I need to place an icon on end?

Ответить