Skip to content

Instantly share code, notes, and snippets.

@luizmarcus
Created June 7, 2021 19:03
Show Gist options
  • Save luizmarcus/7a1f6579716f33688551d7334f9d32ec to your computer and use it in GitHub Desktop.
Save luizmarcus/7a1f6579716f33688551d7334f9d32ec to your computer and use it in GitHub Desktop.
Widget _getItem(IconData iconData, String name, String tag) =>
GestureDetector(
child: Card(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
children: [
Hero(child: Icon(iconData), tag: tag),
Expanded(
child: Text(
name,
textAlign: TextAlign.center,
),
),
],
),
),
),
onTap: () => Navigator.push(
context,
PageRouteBuilder(
transitionDuration: Duration(seconds: 2),
pageBuilder: (_, __, ___) => SecondPage(
iconData: iconData,
tag: tag,
text: name,
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment