Custom Toast - Flutter

Last updated Feb 29, 2020

In This example we are going to use hot to create Custom Toast in Flutter.

For this we are going to use toast 0.1.5 plugin

Let's Start

Step 1: Create Flutter Application

Step 2: Add Dependencies

Add toast 0.1.5  in pubspec.yaml file

dependencies: toast: ^0.1.5

Step 3: Create a dart file and update below code

import 'package:flutter/material.dart';
import 'package:toast/toast.dart';

class ShowToast extends StatefulWidget {
  _ShowToastState createState() => _ShowToastState();

class _ShowToastState extends State {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Custom Toast Flutter')),
      body: Center(
          child: RaisedButton(
              child: Text('Show Toast',style: TextStyle(color: Colors.white),),
              onPressed: () => ToastView.createView('Showing Toast', context,
                 Toast.LENGTH_LONG, Toast.BOTTOM,,Colors.white,20,null))),

Step 4: Update main dart file with below code

void main() => runApp(MyApp());

class MyApp extends StatelessWidget{
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      theme: ThemeData(
      home: ShowToast(),



Step 5: Let's Run application

Custom Toast Flutter

Article Contributed By :


Subscribe For Daily Updates

Flutter Questions
Android Questions