import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class WrapWidget extends StatefulWidget {
final String title;
const WrapWidget({Key key, this.title}) : super(key: key);
@override
State<StatefulWidget> createState() {
return _WrapWidgetState();
}
}
class _WrapWidgetState extends State<WrapWidget> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('wrap'),
),
body: Column(
children: <Widget>[
Wrap(
spacing: 4.0,
runSpacing: 4.0,
children: <Widget>[
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
Container(
width: 100,
height: 100,
color: Colors.blue,
),
],
),
],
),
);
}
}
Flutter之Wrap
最新推荐文章于 2024-05-06 09:30:53 发布