Questions tagged [snackbar]

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

Introduction

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

They automatically disappear after a timeout or after user interaction elsewhere on the screen, particularly after interactions that summon a new surface or activity. Snackbars can be swiped off screen.

Snackbars can contain an action which is set via setAction(CharSequence, android.view.View.OnClickListener).

Documentation

Usage of SnackBar

493 questions
0
votes
2 answers

How do I fix dart flutter scaffoldKey problem?

I will describe my coding problem. Well I have created Login/signUp .dart files(pages) but while debugging I got this error... The method 'showSnackBar' isn`t defined for the type 'ScaffoldState'. This error message appears everywhere in .dart code…
0
votes
1 answer

How to implement undo swipe and reinsert recently deleted item KOTLIN

I have a to do list app and I have created a snackbar that shows up when a user swipes to delete an item. What I want to do is have the undo snackbar reinsert the item that was just deleted. Here's my code that handles the swipe to delete and show…
Khumo Mashapa
  • 390
  • 1
  • 4
  • 13
0
votes
1 answer

Show Snackbar only in single Navigator

I am working on the iPad and I have set up the screen to be SplitScreens. Thus I have two Navigators side by side. However, when I call to show a Snackbar in one navigator with it's specific context, the Snackbar is still showing on both…
SwiftiSwift
  • 7,528
  • 9
  • 56
  • 96
0
votes
2 answers

How to call snackbar on function's response in flutter

I am building an e-commerce app in a flutter. I want to implement a conditional snack bar. When I get added to cart successfully response then want to show the snack bar with a success message and if not then with the failed message. but I am…
swapnil mane
  • 215
  • 5
  • 17
0
votes
1 answer

Firestore populated DropdownButton Item is not showing as selected, but snackbar shows otherwise

I am looking to keep the selected item from a DropdownButton list as the text in that button. Right now, I can click on the item in the dropdown list and I am showing a snackbar notification with the item selected, but it is not updating the actual…
SUD
  • 3
  • 2
0
votes
1 answer

React JS: Passing function as props is not working as expected

I'm fairly new to React JS and I have a question. I've been trying to search the internet about my problem but I cannot find a solution. Here it goes: I have 2 files, Header.tsx and Alerts.tsx. In Header.tsx there is a function named alertData that…
astra.xvi
  • 43
  • 7
0
votes
1 answer

Why flutter snackBar not working inside if statement?

I have coded a SnackBar inside the if condition, if the condition is true it has to show SnackBar but it's not happening even when the condition is true. this is my code TextButton( onPressed: () async { await fetch(); await…
0
votes
1 answer

Snackbar does not show the item name , when delete items from list in Flutter

When I delete items from a list, the snackbar does not show the item name, instead it say: "Instance of 'IngredientList' deleted". Is it because .showSnackBar is desprecated? How to fix that? showSnackbar(context, ingredient,…
Giovanni
  • 512
  • 2
  • 6
  • 23
0
votes
1 answer

Kotlin: Styling Text in Snackbar with SDK later than 28

I am working on a Kotlin project and I wish to style the text in a Snackbar, specifically the text font. I have been to many websites that address this problem, but they all use this line in the Snackbar body: val snackbarTextView =…
0
votes
1 answer

how to go up a snackbar in flutter

I'm trying to upload a snackBar in case of error but nothing appears on the screen, neither error nor the snackBar onFail doesn't work ! class UserManager { final FirebaseAuth auth = FirebaseAuth.instance; Future signIn({required…
user14160660
0
votes
1 answer

Flutter showsnackbar at top of the screen?

how to show flutter snackbar at top of the screen ? ScaffoldMessenger.of(context).showSnackBar(snackBar(context,Strings.order_not_selected));
Kokila
  • 242
  • 1
  • 13
0
votes
1 answer

Showsnackbar in flutter

I don't want to call show SnackBar on every single Page. Is there any way to call snack bar globally only once? I used this But it shows context error. ScaffoldMessenger.of(context).showSnackBar(snackBar);
0
votes
0 answers

Angular subscribe function not firing error block

I am working on Angular application. My backend returns 403 error. catch (AccessViolationException ex) { return StatusCode(403, ex.Message); } On my frontend, my component.ts has subscribed to the method. But its not…
user14463446
  • 99
  • 10
0
votes
2 answers

SnackBars in flutter only shows once

I want to give an error warning if the input given in the text field is not correct (like the field only accepts integer and not characters or strings). I have used Get.snackbar for giving the error warning . but it show only once after opening…
J P F 07
  • 58
  • 6
0
votes
1 answer

Show Snackbar on top route after closing a page

In my app, I have some areas where I can open a new page on top of the current, that allow to edit data. Once editing is done, I want to close the page (i.e. via Navigator.pop(context);), and also show a Snackbar after closing (i.e. via…
Christian
  • 558
  • 2
  • 13