Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

how to display a dialog after build in flutter

class XxxxxWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
// [NG]We want to show dialog on Container widget.

 Future.delayed(Duration.zero, () => showMyDialog(context)); // import 'dart:async';
 return Container(
  child: FlatButton(.... //same as question
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #display #dialog #build #flutter
ADD COMMENT
Topic
Name
4+9 =