2 | import'dart:io'show Platform; |
2 4 | } |
2 4 6 8 10 12 14 16 | // Return here any Widget you want to display in Android Device. style:TextStyle(fontSize:22)); } // Return here any Widget you want to display in iOS Device. style:TextStyle(fontSize:22)); } |
2 4 6 8 10 12 | returnMaterialApp( appBar:AppBar( ), child:_detectWidget() ) } |
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 | import'dart:io'show Platform; voidmain()=>runApp(MyApp()); classMyAppextendsStatelessWidget{ Widget _detectWidget(){ if(Platform.isAndroid){ // Return here any Widget you want to display in Android Device. style:TextStyle(fontSize:22)); } // Return here any Widget you want to display in iOS Device. style:TextStyle(fontSize:22)); } @override returnMaterialApp( appBar:AppBar( ), child:_detectWidget() ) } |