Skip to content

Instantly share code, notes, and snippets.

@frank06
Created January 5, 2020 01:28
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 frank06/6e782fcdb2fd20de37ba0cf237681ea9 to your computer and use it in GitHub Desktop.
Save frank06/6e782fcdb2fd20de37ba0cf237681ea9 to your computer and use it in GitHub Desktop.
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