Advertisement
wildanfuady

Wrap Example

Oct 12th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class WrapExample extends StatelessWidget {
  4. @override
  5. Widget build(BuildContext context) {
  6. return Container(
  7. color: Colors.green,
  8. child: Column(
  9. mainAxisAlignment: MainAxisAlignment.center,
  10. crossAxisAlignment: CrossAxisAlignment.center,
  11. children: <Widget>[
  12. Wrap(
  13. spacing: 8.0, // gap between adjacent chips
  14. runSpacing: 4.0,
  15. children: <Widget>[
  16. Container(
  17. width: 100.0,
  18. height: 100.0,
  19. color: Colors.blueGrey,
  20. ),
  21. Container(
  22. width: 100.0,
  23. height: 100.0,
  24. color: Colors.blue,
  25. ),
  26. Container(
  27. width: 100.0,
  28. height: 100.0,
  29. color: Colors.yellow,
  30. ),
  31. Container(
  32. width: 100.0,
  33. height: 100.0,
  34. color: Colors.red,
  35. ),
  36. Container(
  37. width: 100.0,
  38. height: 100.0,
  39. color: Colors.white,
  40. ),
  41. ],
  42. )
  43. ],
  44. ),
  45. );
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement