mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-01 14:58:50 +08:00
modify some description
This commit is contained in:
@ -4,14 +4,69 @@ import 'package:flutter/material.dart';
|
||||
class LimitedBoxDemo extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LimitedBox(
|
||||
maxWidth: 50.0,
|
||||
maxHeight: 150.0,
|
||||
child: Container(
|
||||
width: 250.0,
|
||||
height: 150.0,
|
||||
color: Colors.red,
|
||||
),
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
color: Color(0xfff8bbd0),
|
||||
child: Text(
|
||||
"100 * 100",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
LimitedBox(
|
||||
maxWidth: 100,
|
||||
maxHeight: 100,
|
||||
child: Container(
|
||||
width: 250,
|
||||
height: 300,
|
||||
child: Text(
|
||||
"250 * 300",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
color: Color(0xfff48fb1),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LimitedBoxColumnDemo extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
child: Text("Column 列表下效果"),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
color: Color(0xfff8bbd0),
|
||||
child: Text(
|
||||
"100 * 100",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.0),
|
||||
LimitedBox(
|
||||
maxWidth: 100,
|
||||
maxHeight: 100,
|
||||
child: Container(
|
||||
width: 250,
|
||||
height: 300,
|
||||
child: Text(
|
||||
"250 * 300",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
color: Color(0xfff48fb1),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user