DEV Community

Cover image for Flutter Toast Widget
GetWidget
GetWidget

Posted on • Edited on

1 1

Flutter Toast Widget

Does your Flutter app have a Toast widget then why not try our GFToast widget component to build a nice Flutter Toast Widget?

Alt Text

What is the use of Toast Widget in the Flutter App?

It Could be useful to briefly inform to your app users when certain actions take place. For example, when a user swipes away a message in a list, you might want to inform them that the message has been deleted. You might even want to give them an option to undo the action. In short, this widget component has been using to display quick warning or error messages.

Usage

GFToast should be wrapped inside the GFFloating Widget. The child of the GFFloatingWidget takes GFToast as its argument and the body takes any kind of widgets. The simple code is as shown below.

import 'package:getwidget/getwidget.dart';

 return Scaffold(
   body:GFFloatingWidget(
     child:GFToast(
     text: 'This item already has the label “travel”',
   ),
   body:Text('body or any kind of widget here..')
 )
)
Enter fullscreen mode Exit fullscreen mode

Toast with Call to Action Button

Alt Text

import 'package:getwidget/getwidget.dart';

GFToast(
  text:'This item already has the label “travel”',
  button: GFButton(
     onPressed: () {},
     text: 'Close',
     type: GFButtonType.transparent,
     color: GFColor.success,
   ),
   autoDismiss: false,
),
Enter fullscreen mode Exit fullscreen mode

Read More GFToast Widget: https://docs.getwidget.dev/gf-toast

If you are new then you can start from Getting Start.

If you will face any issue or have any suggestions then get connected on GitHub: GetWidget GitHub

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong · web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video 🌶️🔥

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious