Created
January 2, 2020 18:12
-
-
Save omenejoseph/91c9c749d8e992f0d08bcbcb6dff2e29 to your computer and use it in GitHub Desktop.
main dart file
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(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
home: new Scaffold( | |
appBar: new AppBar(title: const Text('Modal bottom sheet')), | |
body: new Center( | |
child: new RaisedButton( | |
child: const Text('SHOW BOTTOM SHEET'), | |
onPressed: () { | |
showModalBottomSheet<void>(context: context, builder: (BuildContext context) { | |
return new Container( | |
child: new Padding( | |
padding: const EdgeInsets.all(32.0), | |
child: new Text('This is the modal bottom sheet. Click anywhere to dismiss.', | |
textAlign: TextAlign.center, | |
style: new TextStyle( | |
color: Theme.of(context).accentColor, | |
fontSize: 24.0 | |
) | |
) | |
) | |
); | |
}); | |
} | |
) | |
) | |
) | |
); | |
} | |
} |
not yet.. I think its a problem with the new version released
@omenejoseph I think you are right
hi, The showModalBottomSheet should not have the same context as the materialapp, so it must be separated in a statelesswidget as you can see in this example. https://gist.github.com/bjavier9/1ac85432cae7531376cdad90492b58cf
I find the problem with new version.
hi, The showModalBottomSheet should not have the same context as the materialapp, so it must be separated in a statelesswidget as you can see in this example. https://gist.github.com/bjavier9/1ac85432cae7531376cdad90492b58cf
Page not Found!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you find any fix?