Advertisement
joaopaulofcc

Untitled

Sep 15th, 2020
1,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.91 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(new MyApp());
  4.  
  5. class MyApp extends StatelessWidget {
  6.   @override
  7.   Widget build(BuildContext context) {
  8.     return new MaterialApp(
  9.       title: 'Flutter Demo',
  10.       theme: new ThemeData(
  11.         primarySwatch: Colors.blue,
  12.       ),
  13.       home: new MyHomePage(title: 'Flutter Bottom sheet'),
  14.     );
  15.   }
  16. }
  17.  
  18. class MyHomePage extends StatefulWidget {
  19.   MyHomePage({Key key, this.title}) : super(key: key);
  20.   final String title;
  21.  
  22.   @override
  23.   _MyHomePageState createState() => new _MyHomePageState();
  24. }
  25.  
  26. class _MyHomePageState extends State<MyHomePage> {
  27.   @override
  28.   Widget build(BuildContext context) {
  29.     return new Scaffold(
  30.       appBar: new AppBar(
  31.         title: new Text(widget.title),
  32.       ),
  33.       floatingActionButton: new FloatingActionButton(
  34.           onPressed: () {
  35.             _settingModalBottomSheet(context);
  36.           },
  37.           child: new Icon(Icons.add)),
  38.     );
  39.   }
  40. }
  41.  
  42. void _settingModalBottomSheet(context) {
  43.   showModalBottomSheet(
  44.       context: context,
  45.       builder: (BuildContext bc) {
  46.         return Container(
  47.           child: new Wrap(
  48.             children: <Widget>[
  49.               new ListTile(
  50.                   leading: new Icon(Icons.share),
  51.                   title: new Text('Compartilhar'),
  52.                   onTap: () => {}),
  53.               new ListTile(
  54.                 leading: new Icon(Icons.link),
  55.                 title: new Text('Link'),
  56.                 onTap: () => {},
  57.               ),
  58.               new ListTile(
  59.                 leading: new Icon(Icons.edit),
  60.                 title: new Text('Editar'),
  61.                 onTap: () => {},
  62.               ),
  63.               new ListTile(
  64.                 leading: new Icon(Icons.delete),
  65.                 title: new Text('Apagar'),
  66.                 onTap: () => {},
  67.               ),
  68.             ],
  69.           ),
  70.         );
  71.       });
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement