Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class WrapExample extends StatelessWidget{
- @override
- Widget build(BuildContext context){
- return Scaffold(
- appBar: AppBar(
- title: Text("Wrap Example"),
- ),
- body: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[ // array
- Wrap(
- // mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Container(
- width: 100,
- height: 100,
- color: Colors.blue[700],
- ),
- Container(
- width: 100,
- height: 100,
- color: Colors.red,
- ),
- Container(
- width: 100,
- height: 100,
- color: Colors.green[700],
- ),
- Container(
- width: 100,
- height: 100,
- color: Colors.yellow,
- ),
- Container(
- width: 100,
- height: 100,
- color: Colors.purple,
- ),
- ],
- ),
- ],
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement