Created with <3 with dartpad.dev.
Created
November 14, 2022 10:07
-
-
Save hazzo/02a9e70431494925e492dbbc411a4dbe to your computer and use it in GitHub Desktop.
Alert dialog
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/material.dart'; | |
void main() => runApp(App()); | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
body: Home(), | |
), | |
); | |
} | |
} | |
class Home extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
showDialog( | |
context: context, | |
builder: (BuildContext context) { | |
return const AlertDialog( | |
title: Text('Alert Dialog'), | |
); | |
}, | |
); | |
return Center( | |
child: Column( | |
children: const <Widget>[ | |
Text('Show Material Dialog'), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment