Skip to content

Commit 06badd0

Browse files
authored
Update showDialog template for flutter 2.x (#12)
Use TextButton instead of FlatButton
1 parent d4fc200 commit 06badd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/resources/liveTemplates/Flutter.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<!-- showDialog-->
9898

9999
<template name="showDialog"
100-
value="showDialog&lt;void&gt;(&#10;context: $context$,&#10;barrierDismissible: $dismiss$, // false = user must tap button, true = tap outside dialog&#10;builder: (BuildContext dialogContext){&#10;return AlertDialog(&#10;title: Text('$title$'),&#10;content: Text('$content$'),&#10;actions: &lt;Widget&gt;[&#10;FlatButton(&#10;child: Text('$buttonText$'),&#10;onPressed: () {&#10;Navigator.of(dialogContext).pop(); // Dismiss alert dialog&#10;},&#10;),&#10;],&#10;);&#10;},&#10;);"
100+
value="showDialog&lt;void&gt;(&#10;context: $context$,&#10;barrierDismissible: $dismiss$, // false = user must tap button, true = tap outside dialog&#10;builder: (BuildContext dialogContext){&#10;return AlertDialog(&#10;title: Text('$title$'),&#10;content: Text('$content$'),&#10;actions: &lt;Widget&gt;[&#10;TextButton(&#10;child: Text('$buttonText$'),&#10;onPressed: () {&#10;Navigator.of(dialogContext).pop(); // Dismiss alert dialog&#10;},&#10;),&#10;],&#10;);&#10;},&#10;);"
101101
description="New AlertDialog" toReformat="true" toShortenFQNames="true">
102102
<variable name="context" expression="&quot;context&quot;" defaultValue="" alwaysStopAt="true"/>
103103
<variable name="dismiss" expression="&quot;barrierDismissible&quot;" defaultValue="" alwaysStopAt="true"/>

0 commit comments

Comments
 (0)