Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Widget build(BuildContext context) {
- List<Widget> _filterFields() {
- return [
- Text('Filtros', style: TextStyle(fontSize: 24.0),),
- SwitchListTile(
- title: Text('Mostrar perdidos'),
- value: _mapFilterObjectives[Objective.lost],
- onChanged: (v) {
- print(v);
- print(_mapFilterObjectives[Objective.lost]);
- setState(() {
- _mapFilterObjectives[Objective.lost] = !_mapFilterObjectives[Objective.lost];
- });
- },
- ),
- // ...
- ];
- }
- void _markersFilterSheet(BuildContext context) {
- showModalBottomSheet<void>(
- context: context,
- builder: (BuildContext context) {
- return Material(
- color: Colors.white,
- child: Padding(
- padding: EdgeInsets.all(10.0),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: _filterFields()
- )
- )
- );
- }
- );
- }
- return Scaffold(
- key: _scaffoldKey,
- drawer: builDrawer(context, route),
- body: Builder(
- builder: (context) {
- return Stack(
- children: <Widget>[
- // ...
- Positioned(
- right: 20.0,
- top: 40.0,
- child: SizedBox(
- width: 40.0,
- height: 40.0,
- child: FloatingActionButton(
- child: Icon(Icons.filter_list, color: Colors.blue, size: 25.0,),
- onPressed: () {
- _markersFilterSheet(context);
- },
- backgroundColor: Colors.white,
- )
- ),
- ),
- ],
- );
- },
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement