DEV Community

loading...

Discussion on: Fwitter - Flutter Based Twitter Clone

Collapse
gurulndgit profile image
gurulnd-git

Hi Sonu,

can you explain this method? i'm quite not understanding how it works? especially how it takes inputs, i saw user of curly braces as parameters, that was new to me... 

//_icon(null,3,icon:3 == state.pageIndex ? AppIcon.messageFill :AppIcon.messageEmpty,isCustomIcon:true),

_icon(IconData iconData,int index,{bool isCustomIcon = false,int icon}){ }

Collapse
thealphamerc profile image
Sonu Sharma 💙 Author

This method is a custom widget that is used in app to display icon in bottom navigation bar.
You can pass any icon from Icons class or from AppIcon class but one icon at a time.
When user click on any icon from bottom navigation bar then onPressed method will invoke and it set page index value.