Flutter onPressed function. Wrap your Column with GestureDetector. To go to other Page you can use Navigator.pushNamed or Navigator.push, E.g with PushNamed is in Code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | Widget buildButtonColumn(IconData icon, String label) { Color color = Theme.of(context).primaryColor; return GestureDetector( onTap: (){ Navigator.pushNamed(context, label); }, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(icon, color: color), Container( margin: const EdgeInsets.only(top: 8.0), child: Text( label, style: TextStyle( fontSize: 12.0, fontWeight: FontWeight.w400, color: color, ), ), ), ], ), ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.