Skip to content

Instantly share code, notes, and snippets.

@Lesliecalvillo
Created May 8, 2021 01:29
Show Gist options
  • Save Lesliecalvillo/17bcef6555b79a0b5b9fff9900146023 to your computer and use it in GitHub Desktop.
Save Lesliecalvillo/17bcef6555b79a0b5b9fff9900146023 to your computer and use it in GitHub Desktop.
lesliecalvillo
import 'package:flutter/material.dart';
void main() => runApp(LeslieApp());
class LeslieApp extends StatelessWidget{
@override
Widget build(BuildContext context){
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.red,
),
home: Mipagina(title: 'Pagina de Leslie y que'),
); // fin de materialapp
}// fin de widgets
}// fin de EliseoApp
class Mipagina extends StatefulWidget {
Mipagina({Key key, this.title}) : super(key: key);
final String title;
@override
_MipaginaState createState() => _MipaginaState();
} // fin Mipagina
class _MipaginaState extends State<Mipagina> {
void OpenBottomSheet(context) {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return Container(
child: Wrap(
children: <Widget>[
ListTile(
leading: Icon(Icons.alarm),
title: Text("Alarma"),
onTap: () {
print("Abrir Alarma");
Navigator.of(context).pop();
},
),
ListTile(
leading: Icon(Icons.map),
title: Text("Mapa"),
onTap: () {
print("Abrir Mapa");
},
)
], //fin de widget []
)); //fin de contenedor
});
} //fin de abrir pie de pagina
@override
Widget build(BuildContext context){
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
), // fin de appBar
body: Center(
child:IconButton(
icon: Icon(Icons.open_in_new),
onPressed: (){
OpenBottomSheet(context);
},
)
), //fin de center
); // fin de Sacffold
} // fin de widgets
}//fin de mihomepageState
@Lesliecalvillo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment