How to create Toast in Flutter

0 votes

Hi Guys,

I want to create a Toasts in Flutter. Whenever I will submit something it will pop up automatically. How can I do that?

Jul 27, 2020 in Others by akhtar
• 38,230 points
1,222 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the toast plugin to create this. You need to install the toast package from the below link.

https://pub.dev/packages/fluttertoast

After that import the package in your flutter code.

import 'package:fluttertoast/fluttertoast.dart';

Now finally add these below lines in your code.

  Fluttertoast.showToast(
      msg: "This is Center Short Toast",
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM_LEFT,
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.red,
      textColor: Colors.white,
      fontSize: 16.0);

When you run your code will can see the below output.

To know more about Flutter, join our Flutter Certification today.

answered Jul 27, 2020 by MD
• 95,440 points

Related Questions In Others

0 votes
1 answer

How to create a Volume Icon in Flutter App?

Hi@akhtar, You can use Icon Widget to create ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,440 points
1,744 views
0 votes
1 answer

How to create a container widget in Flutter?

Hi@akhtar, Container means a parent widget that contains ...READ MORE

answered Jul 28, 2020 in Others by MD
• 95,440 points
1,705 views
0 votes
1 answer

How to create an input field in Flutter?

Hi@akhtar, There are different ways to create an ...READ MORE

answered Aug 9, 2020 in Others by MD
• 95,440 points
1,133 views
0 votes
1 answer

How to create a FlatButton in Flutter?

Hi@akhtar, A flat button is a text label ...READ MORE

answered Aug 12, 2020 in Others by MD
• 95,440 points
494 views
0 votes
1 answer

What is pubspec.yaml file in Flutter?

Hi@akhtar, It is the project's configuration file that ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,440 points
3,037 views
0 votes
1 answer

Error: No pubspec.yaml file found.

Hi@akhtar, You need to run this command from ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,440 points
8,488 views
0 votes
1 answer

How to launch an emulators from Flutter?

Hi@akhtar, Before launching emulators you should check if ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,440 points
5,751 views
0 votes
1 answer

How to create a Project in Flutter?

Hi@akhtar, Flutter has an inbuilt command to create ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,440 points
703 views
0 votes
1 answer

How to create an Icon Button in Flutter?

Hi@akhtar, To create an Icon Button in Flutter, ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,440 points
743 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP