Questions for Practice 5

Create Free Backend With Appwrite

Button Widgets in Flutter: Practice Questions

  1. Create a Flutter application that displays a MaterialButton on the screen. When pressed, the button should change its color from blue to green.
  2. Implement an ElevatedButton with a shadow of 10. The button should display a Snackbar with a message “ElevatedButton Pressed” when clicked.
  3. Design a TextButton that toggles its text between “Enabled” and “Disabled” upon each click. Use a variable to manage the button’s state.
  4. Create a DropdownButton with items “Item 1”, “Item 2”, and “Item 3”. Display the selected item in a Snackbar when an item is selected.
  5. Develop a PopupMenuButton that shows three menu items: “Option 1”, “Option 2”, and “Option 3”. Handle the selection and display the chosen option in a Toast or a Snackbar.