delucaspinto

[FLUTTER] bottomsheetmodal example

Nov 18th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. void _settingModalBottomSheet(context) {
  2. showModalBottomSheet(
  3. context: context,
  4. builder: (BuildContext bc) {
  5. return Container(
  6. child: new Wrap(
  7. children: <Widget>[
  8. ListTile(
  9. leading: Icon(
  10. FontAwesomeIcons.userEdit,
  11. color: COLOR_UNETVALE,
  12. ),
  13. title: Text('Editar meus dados'),
  14. subtitle: Text(
  15. "Permite você atualizar seus dados",
  16. style: TextStyle(fontSize: 10),
  17. ),
  18. onTap: () {
  19. Navigator.push(
  20. context,
  21. MaterialPageRoute(
  22. builder: (context) => EditarMeusDados()),
  23. );
  24. }),
  25. ListTile(
  26. leading: Icon(FontAwesomeIcons.download, color: COLOR_UNETVALE),
  27. title: Text('Baixar meu contrato'),
  28. subtitle: Text(
  29. "Possibilita baixar o contrato referente a sua conta",
  30. style: TextStyle(fontSize: 10),
  31. ),
  32. onTap: () {
  33. _launchURL();
  34. },
  35. ),
  36. ListTile(
  37. leading:
  38. Icon(FontAwesomeIcons.signOutAlt, color: COLOR_UNETVALE),
  39. title: Text('Desconectar minha conta'),
  40. subtitle: Text(
  41. "Já vai sair?",
  42. style: TextStyle(fontSize: 10),
  43. ),
  44. onTap: () {
  45. clearSharedPreferences().then((e) {
  46. apiLogout().then((e) {
  47. Navigator.pop(context);
  48. Navigator.of(context).pushReplacementNamed("/");
  49. });
  50. });
  51.  
  52. Navigator.pop(context),
  53. Navigator.pushReplacementNamed(context, '/'),
  54. }),
  55. ],
  56. ),
  57. );
  58. });
  59. }
Advertisement
Add Comment
Please, Sign In to add comment