Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created December 17, 2018 07:11
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/a88fa4fd02109ff83167e2c707ec6a08 to your computer and use it in GitHub Desktop.
Save hitherejoe/a88fa4fd02109ff83167e2c707ec6a08 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