In this video, see how to use use the dart:io library to find out which platform your user has and then dynamically update your app with the proper styling for either iOS or Android.
- [Narrator] In previous lesson, … we saw how we could incorporate a drop down button … with a bunch of drop down items. … And this is of course the Android appearance. … So the material design widget and in the last lesson, … we looked at how we can use a Cupertino picker, … which is the iOS appearance for the iOS picker. … Now, let's create two methods where we can … either create a Cupertino picker … or we can create a drop down button. … So I'm going to cut this code for my drop down button … and I'm going to incorporate it into a separate method. … So we're going to call this get drop down button … and inside this method is where I'm going to paste … what I copied over. … So everything that's the code for the drop down button … and then I'm going to uncomment it and return … this as the output. … So I'm going to add that semicolon at the end … and also change the return type into a drop down button … that contains string items. … So now let's hit save for Dart to reformat our code …
Released
8/30/2019This course was created by London App Brewery. We are pleased to host this content in our library.
Share this video
Embed this video
Video: Build platform-specific UI (iOS and Android)