Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created December 17, 2018 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitherejoe/ca47aec6579cea4ed2ddba1348dbfbcb to your computer and use it in GitHub Desktop.
Save hitherejoe/ca47aec6579cea4ed2ddba1348dbfbcb to your computer and use it in GitHub Desktop.
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