Skip to content

Instantly share code, notes, and snippets.

@csells
Last active September 30, 2020 20:43
Show Gist options
  • Select an option

  • Save csells/f1c5bcee4ff846d019b07ea69032c0ed to your computer and use it in GitHub Desktop.

Select an option

Save csells/f1c5bcee4ff846d019b07ea69032c0ed to your computer and use it in GitHub Desktop.
flutter-nav2-part2
class _ColorAppState extends State<ColorApp> {
List<Color> _colors = [Colors.red, Colors.green, Colors.blue];
@override
Widget build(BuildContext context) => MaterialApp(
title: 'Color App',
home: Builder(
builder: (context) => ColorListScreen(
colors: _colors,
// the Navigator manages the list of pages itself; you can only push and pop
onTapped: (color) => Navigator.push(
context,
MaterialPageRoute(builder: (context) => ColorScreen(color: color)),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment