Flutter UX: Material State Properties
summary
Flutter now uses material state properties to drive interaction: use MaterialStateProperty.resolveWith to return different colors/elevations based on a stored set of states, replace deprecated RaisedButton with ElevatedButton + ButtonStyle, or subclass MaterialStateColor to encapsulate resolve logic. Custom widgets keep an internal Set of states updated by MouseRegion + GestureDetector handlers and call resolve(stateSet) in build, letting UI like an InteractiveCard change border radius and color without per-widget stateful boilerplate.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:57Why Flutter
- 1:59Desktop Web Mouse
- 3:01Platform Norms
- 5:18Private Functions
- 5:57Mouse Region
- 6:25Speaker Card
- 7:44Testing
- 8:17Standoffs
- 9:19Material State
- 10:34Material State Properties Code
- 13:02Material State Properties enum
- 14:56Implementing Material State Properties with Custom Widgets
- 19:17Recap
