Skip to content

Instantly share code, notes, and snippets.

@RafaelBarbosatec
Created September 4, 2018 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RafaelBarbosatec/36fe69e9a203c99d464b69baf0dcf395 to your computer and use it in GitHub Desktop.
Save RafaelBarbosatec/36fe69e9a203c99d464b69baf0dcf395 to your computer and use it in GitHub Desktop.
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