Created
April 28, 2020 01:12
-
-
Save bjavier9/1ac85432cae7531376cdad90492b58cf to your computer and use it in GitHub Desktop.
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 MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Flutter App', | |
home: MyHomePage(), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
@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 | |
) | |
) | |
) | |
); | |
}); | |
} | |
) | |
) | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment