Guest User

Untitled

a guest
Dec 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() => runApp(MyApp());
  4.  
  5. class MyApp extends StatelessWidget {
  6. @override
  7. Widget build(BuildContext context) {
  8. return MaterialApp(
  9. title: 'Flutter Demo',
  10. theme: ThemeData.light(),
  11. home: Home(),
  12. );
  13. }
  14. }
  15.  
  16. class Home extends StatelessWidget {
  17. @override
  18. Widget build(BuildContext context) {
  19. return Scaffold(
  20. appBar: AppBar(
  21. title: Text("Whatever"),
  22. centerTitle: true,
  23. ),
  24. body: ListView.builder(
  25. itemBuilder: (context, index) => Padding(
  26. padding: EdgeInsets.only(bottom: 10),
  27. child: AspectRatio(
  28. aspectRatio: 2,
  29. child: Container(
  30. color: Colors.red,
  31. child: Center(child: Text("item : $index")),
  32. ),
  33. ),
  34. ),
  35. ),
  36. );
  37. }
  38. }
Add Comment
Please, Sign In to add comment