Created
February 8, 2021 19:04
-
-
Save azamsharp/8b0b84496e8c2efe3eb1ab0989858107 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomerListScreen extends StatelessWidget { | |
final customers = ["Alex", "John", "Bryan", "Jerry", "Mary"]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Customers") | |
), | |
body: ListView.builder( | |
itemCount: customers.length, | |
itemBuilder: (context, index) { | |
final customer = customers[index]; | |
return ListTile( | |
title: Text(customer), | |
onTap: () { | |
Navigator.push(context, MaterialPageRoute( | |
builder: (context) => CustomerDetailScreen(customer: customer) | |
)); | |
}, | |
); | |
} | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment