Actions and Shortcuts Widget in Flutter - Keyboard actions For Web & Desktop

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
how to use actions and shortcuts in your flutter application let's get started first let's create a class named increment intent that extends with intent class having an empty Constructor next we create a class named decrement same as we created increment class before next we create a stateful widget named home page and in our home page State class we Define account variable with 0 we created a shortcut widget with the property shortcuts set to a map where the key is of type shortcut activator and value of type intent here we provided the single activator with the argument logical keyboard key dot Arrow up and logical keyboard key dot arrow down as keys and increment intent and decrement intent object as values respectively do you want to have your flutter app websites or backend server completely developed in a high professional manner instead of developing it on your own then simply go to heyflatter.com app and we will develop this app for you next we provided actions widget as a child with the property actions set to a map with two key value pairs here we set the key as increment intent and value as callback action function of type increment intent where we increment the value of count by using set state after that we provided another key as decrement intent and value as callback action function of type decrement intent where we decrement the value of count by using set state next we created a focus widget as a child of action widget here we set the autofocus property to true to use the shortcuts key on the child of focus widget next we created a column where we displayed some text and the value of count variable here we have used the string interpolation which is the short end way of inserting the value of count variable into the string now here you can see if I press up Arrow key the count value will increment by 1 and if I press down the count value will decrement by 1. foreign [Music]
Info
Channel: HeyFlutter․com
Views: 4,398
Rating: undefined out of 5
Keywords: actions, actions tutorial, actions widget, actions widget tutorial, build apps with flutter, flutter, flutter actions, flutter actions widget, flutter apps, flutter example, flutter shortcuts, flutter shortcuts class, flutter widget, flutter widget of the week, flutter widgets, google developers, how to use actions widget, how to use shortcuts widget, introduction to actions widget, keyboard shortcuts, what is actions widget, what is the actions widget, widget of the week
Id: G2L2BmNc8ow
Channel Id: undefined
Length: 2min 11sec (131 seconds)
Published: Fri Jun 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.