Created
January 5, 2020 01:28
-
-
Save frank06/6e782fcdb2fd20de37ba0cf237681ea9 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
import 'package:flutter/cupertino.dart'; | |
main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(context) { | |
return CupertinoApp( | |
home: CupertinoPageScaffold( | |
child: Center( | |
child: Builder( | |
builder: (context) { | |
return CupertinoButton( | |
color: CupertinoColors.activeBlue, | |
child: Text('Open popup'), | |
onPressed: () { | |
showCupertinoDialog( | |
context: context, | |
builder: (context) => CupertinoAlertDialog( | |
title: Text('My message!'), | |
actions: [ | |
CupertinoDialogAction( | |
child: Text('Close'), | |
onPressed: () => Navigator.pop(context) | |
), | |
], | |
) | |
); | |
}, | |
); | |
} | |
) | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment