Advertisement
wildanfuady

Untitled

Jan 8th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class WrapExample extends StatelessWidget{
  4.  
  5. @override
  6. Widget build(BuildContext context){
  7.  
  8. return Scaffold(
  9. appBar: AppBar(
  10. title: Text("Wrap Example"),
  11. ),
  12. body: Column(
  13. crossAxisAlignment: CrossAxisAlignment.center,
  14. mainAxisAlignment: MainAxisAlignment.center,
  15. children: <Widget>[ // array
  16. Wrap(
  17. // mainAxisAlignment: MainAxisAlignment.center,
  18. children: <Widget>[
  19. Container(
  20. width: 100,
  21. height: 100,
  22. color: Colors.blue[700],
  23. ),
  24. Container(
  25. width: 100,
  26. height: 100,
  27. color: Colors.red,
  28. ),
  29. Container(
  30. width: 100,
  31. height: 100,
  32. color: Colors.green[700],
  33. ),
  34. Container(
  35. width: 100,
  36. height: 100,
  37. color: Colors.yellow,
  38. ),
  39. Container(
  40. width: 100,
  41. height: 100,
  42. color: Colors.purple,
  43. ),
  44. ],
  45. ),
  46. ],
  47. ),
  48. );
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement