Created
September 4, 2018 16:24
-
-
Save RafaelBarbosatec/36fe69e9a203c99d464b69baf0dcf395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _buildCategoryItem(index){ | |
return new GestureDetector( | |
onTap: (){ | |
onTabCategory(index); | |
}, | |
child: new Center( | |
child: new Container( | |
margin: new EdgeInsets.only(left: 10.0), | |
child: new Material( | |
elevation: 2.0, | |
borderRadius: const BorderRadius.all(const Radius.circular(25.0)), | |
child: new Container( | |
padding: new EdgeInsets.only(left: 12.0,top: 7.0,bottom: 7.0,right: 12.0), | |
color: _category_selected == index ? Colors.blue[800]:Colors.blue[500], | |
child: new Text(_categorys[index], | |
style: new TextStyle( | |
color: Colors.white), | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
onTabCategory(index){ | |
setState(() { | |
_category_selected = index; | |
}); | |
//Realiza chamada de serviço para atualizar as noticias de acordo com a categoria selecionada | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment