Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created December 17, 2018 12:47
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/2d83702ebfc5388da052dbb89ff42ff4 to your computer and use it in GitHub Desktop.
Save hitherejoe/2d83702ebfc5388da052dbb89ff42ff4 to your computer and use it in GitHub Desktop.
class PlatformButton extends PlatformWidget<CupertinoButton, MaterialButton> {
final onPressed;
PlatformButton({this.onPressed});
@override
MaterialButton createAndroidWidget(BuildContext context) {
return MaterialButton(
onPressed: onPressed,
color: VoiceTheme.blaze_orange,
child: Text(
Strings.label_try_again,
style: TextStyle(color: Colors.white),
),
);
}
@override
CupertinoButton createIosWidget(BuildContext context) {
return CupertinoButton(
onPressed: onPressed,
color: VoiceTheme.blaze_orange,
child: Text(
Strings.label_try_again,
style: TextStyle(color: Colors.white),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment