Adaptive Design for Mobile
Learn which Flutter widget has an adaptive constructor by default.
A Flutter application is adaptive if it can change functionality and UI based on the platform it’s running on. Some packages and plugins are already adaptivene by default. For instance, the location
package can give us the coordinates of the device. We don’t need to know how it does that on an iPhone, an Android device, a web browser, or a macOS application. In this lesson, we’ll focus on the mobile platforms.
Our application’s UI can also change depending on the platform used to run it. For instance, an Android button is different from an iOS text button. We can decide to show different widgets based on the platform. We use Material
widgets for Android and Cupertino
widgets for iOS. We can use Theme.of(context).platform
to determine whether the device is an Android or an iOS device.
Get hands-on with 1400+ tech skills courses.