AttributeError: 'Snackbar' object has no attribute 'show'

Viewed 672

I'm making a desktop app using kivymd and i need to show a simple Snackbar on a button click that just lets the user know that the process went smoothly, but no matter what i try to do i get the error message: AttributeError: 'Snackbar' object has no attribute 'show'. I installed kivy and kivymd correctly, i know this because i already made an app without using Snackbars. Hope you can help me, here's the code:

from kivy.lang import Builder
from kivymd.app import MDApp
from kivymd.uix.snackbar import Snackbar

KV = '''
BoxLayout:
    MDRaisedButton:
        text: "click"
        on_press: app.test_bar()
'''

class TestApp(MDApp):
    def build(self):
        return Builder.load_string(KV)
    
    def test_bar(self):
        Snackbar(text="Hello world!").show()

TestApp().run()
1 Answers
Snackbar(text="Hello world!").open()
Related