list.dart 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import 'package:flutter/material.dart';
  2. class ListPage extends StatelessWidget {
  3. const ListPage({Key? key}) : super(key: key);
  4. @override
  5. Widget build(BuildContext context) {
  6. return Scaffold(
  7. body: Column(
  8. crossAxisAlignment: CrossAxisAlignment.start,
  9. children: [
  10. Text(
  11. 'Top Menu',
  12. style: TextStyle(
  13. fontSize: 18,
  14. ),
  15. ),
  16. Expanded(
  17. child: ListView.builder(
  18. shrinkWrap: true,
  19. // itemCount: 15,
  20. // ignore: avoid_types_as_parameter_names
  21. itemBuilder: (context, int) {
  22. return Card(
  23. child: ListTile(
  24. title: Text('aaa'),
  25. subtitle: Text('Description of $int'),
  26. trailing: Icon(
  27. Icons.do_not_disturb_on,
  28. color: Colors.red,
  29. ),
  30. ),
  31. );
  32. })),
  33. ],
  34. ));
  35. }
  36. }