-
-
Save hitherejoe/ca47aec6579cea4ed2ddba1348dbfbcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class PlatformWidget<I extends Widget, A extends Widget> | |
extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
if (Platform.isAndroid) { | |
return createAndroidWidget(context); | |
} else if (Platform.isIOS) { | |
return createIosWidget(context); | |
} | |
return Container(); | |
} | |
I createIosWidget(BuildContext context); | |
A createAndroidWidget(BuildContext context); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment