Advertisement
Guest User

Untitled

a guest
Sep 1st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.87 KB | None | 0 0
  1. Widget build(BuildContext context) {
  2.  
  3.     List<Widget> _filterFields() {
  4.       return [
  5.         Text('Filtros', style: TextStyle(fontSize: 24.0),),
  6.         SwitchListTile(
  7.           title: Text('Mostrar perdidos'),
  8.           value: _mapFilterObjectives[Objective.lost],
  9.           onChanged: (v) {
  10.             print(v);
  11.             print(_mapFilterObjectives[Objective.lost]);
  12.             setState(() {
  13.               _mapFilterObjectives[Objective.lost] = !_mapFilterObjectives[Objective.lost];
  14.             });
  15.           },
  16.         ),
  17.         // ...
  18.       ];
  19.     }
  20.  
  21.     void _markersFilterSheet(BuildContext context) {
  22.       showModalBottomSheet<void>(
  23.         context: context,
  24.         builder: (BuildContext context) {
  25.           return Material(
  26.             color: Colors.white,
  27.             child: Padding(
  28.               padding: EdgeInsets.all(10.0),
  29.               child: Column(
  30.                 mainAxisSize: MainAxisSize.min,
  31.                 children: _filterFields()
  32.               )
  33.             )
  34.           );
  35.         }
  36.       );
  37.     }
  38.    
  39.     return Scaffold(
  40.       key: _scaffoldKey,
  41.       drawer: builDrawer(context, route),
  42.       body: Builder(
  43.         builder: (context) {
  44.           return Stack(
  45.             children: <Widget>[
  46.               // ...
  47.               Positioned(
  48.                 right: 20.0,
  49.                 top: 40.0,
  50.                 child: SizedBox(
  51.                   width: 40.0,
  52.                   height: 40.0,
  53.                   child: FloatingActionButton(
  54.                     child: Icon(Icons.filter_list, color: Colors.blue, size: 25.0,),
  55.                     onPressed: () {
  56.                       _markersFilterSheet(context);
  57.                     },
  58.                     backgroundColor: Colors.white,
  59.                   )
  60.                 ),
  61.               ),
  62.             ],
  63.           );
  64.         },
  65.       ),
  66.     );
  67.   }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement