Fluttertoast is used to create a toast message by writing only one line of code. Below are some steps to create a Fluttertoast in Flutter. Basically here, we are creating a new Flutter application using a command prompt.
- Delete the default code from the main.dart file and write your own code.
- Now, add fluttertoast in dependencies of the pubspec.yaml file:
Some Properties of showToast:
- msg: toast message.
- toastLength: Duration of toast
- backgroundColor: Background color to be shown.
- textColor: Text color to be shown.
- fontSize: Font size of toast message.
If the font size is set to 25 the design changes as follows:
If the font size is set to 25 and gravity is set to ToastGravity.TOP the design changes as follows:
If the font size is set to 25 and gravity is set to ToastGravity.TOP and text color is set to pink the design changes as follows:
- Difference between React Native and Flutter
- Difference Between Rows and Columns vs Container in Flutter
- Multi Page Applications in Flutter
- Routes and Navigator in Flutter
- Container class in Flutter
- Difference Between Stateless and Stateful Widget in Flutter
- Rive animations in Flutter
- ProgressIndicator in Flutter
- Flutter - Stateful vs Stateless Widgets
- Listview.builder in Flutter
- Splash Screen in Flutter
- How to Add images in Flutter App?
- Raised Button widget in Flutter
- Flutter - Architecture Application
- Designing a Form Submission Page in Flutter
- Creating a Simple Application in Flutter
- Customizing Fonts in Flutter
- Android Studio Setup for Flutter Development
- How to Add Space Between Widgets in Flutter?
- Retrieve Data From TextFields in Flutter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.