Files
ryan d48942b55d refactor(many files): 页面部分的文件结构调整
1.views 文件夹里面分类,页面相关文件;2.公共组件全部放在components里;3.创建resources文件夹放置资源dart文件4.修改二级菜单文字大小

BREAKING CHANGE: 重构,建议删除本地db,再编译
2019-01-28 17:45:18 +08:00

98 lines
3.0 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: xiaojia.dxj
* @Date: 2019-01-08 15:56:31
* @Last Modified by: xiaojia.dxj
* @Last Modified time: 2019-01-08 15:56:31
*/
import 'package:flutter/material.dart';
import 'package:flutter_go/components/widget_demo.dart';
import './demo.dart' as overflowBox;
const String Text0 = """### **OverflowBox简介**
> 它对child施加的约束不同于从其父控件获得的约束可能允许child溢出父控件的空间.
- 当OverflowBox的最大尺寸大于child的时候child可以完整显示当其小于child的时候则以最大尺寸为基准当然这个尺寸都是可以突破父节点的
""";
const String Text1 = """
### **基本用法**
> OverflowBox设置最大/最小尺寸
- SizedOverflowBox一个特定大小的小部件但将其原始约束传递给它的子节点然后可能会溢出。
- ConstrainedBox一个对其子项施加额外约束的小部件。
- UnconstrainedBox一个试图让它的child在没有约束的情况下绘制的容器。
- SizedBox一个具有指定大小的盒子。
""";
class Demo extends StatefulWidget {
static const String routeName = '/element/Frame/Box/OverflowBox';
_DemoState createState() => _DemoState();
}
class _DemoState extends State<Demo> {
@override
Widget build(BuildContext context) {
return WidgetDemo(
title: 'OverflowBox',
codeUrl: 'elements/Frame/Box/OverflowBox/demo.dart',
docUrl: 'https://docs.flutter.io/flutter/widgets/OverflowBox-class.html',
contentList: [
Text0,
Text1,
_overflowBoxCreate(),
],
);
}
Column _overflowBoxCreate() {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text("宽高都小于最小限制"),
Container(
width: 100.0,
height: 100.0,
color: Color(0xfff8bbd0),
child: overflowBox.OverflowBoxDefault(
curmaxHeight: 150.0,
curmaxWidth: 150.0,
//宽高都小于最小限制
curHeight: 50.0,
curWidth: 50.0,
curalignment: Alignment.bottomLeft,
),
),
SizedBox(height: 20),
Text("在限制之内"),
Container(
width: 100.0,
height: 100.0,
color: Color(0xfff8bbd0),
child: overflowBox.OverflowBoxDefault(
curmaxHeight: 150.0,
curmaxWidth: 150.0,
curHeight: 80.0,
curWidth: 80.0,
curalignment: Alignment.topRight,
),
),
SizedBox(height: 20),
SizedBox(height: 50,child: Text("宽高都大于最大限制"),),
Container(
width: 100.0,
height: 100.0,
color: Color(0xfff8bbd0),
child: overflowBox.OverflowBoxDefault(
curmaxHeight: 150.0,
curmaxWidth: 150.0,
//宽高大于最大限制
curHeight: 200.0,
curWidth: 200.0,
curalignment: Alignment.center,
),
),
],
);
}
}