Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f3fad81b
Unverified
Commit
f3fad81b
authored
Feb 03, 2021
by
Alabhya
Committed by
GitHub
Feb 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Api docs] Dartpad demo for alert dialog. (#75291)
* Alert dialog dartpad demo * Updated description
parent
66659229
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+33
-0
No files found.
packages/flutter/lib/src/material/dialog.dart
View file @
f3fad81b
...
...
@@ -218,6 +218,39 @@ class Dialog extends StatelessWidget {
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateless_widget_scaffold_center}
///
/// This demo shows a [TextButton] which when pressed, calls [showDialog]. When called, this method
/// displays a Material dialog above the current contents of the app and returns
/// a [Future] that completes when the dialog is dismissed.
///
/// ```dart
/// Widget build(BuildContext context) {
/// return TextButton(
/// onPressed: () => showDialog<String>(
/// context: context,
/// builder: (BuildContext context) => AlertDialog(
/// title: const Text('AlertDialog Tilte'),
/// content: const Text('AlertDialog description'),
/// actions: [
/// TextButton(
/// onPressed: () => Navigator.pop(context, 'Cancel'),
/// child: const Text('Cancel'),
/// ),
/// TextButton(
/// onPressed: () => Navigator.pop(context, 'OK'),
/// child: const Text('OK'),
/// ),
/// ],
/// ),
/// ),
/// child: Text('Show Dialog'),
/// );
/// }
///
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [SimpleDialog], which handles the scrolling of the contents but has no [actions].
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment