modify some description

This commit is contained in:
xiaojia22326@163.com
2019-01-12 15:23:17 +08:00
parent ea12dcbea5
commit 69c4d5efe6
36 changed files with 276 additions and 197 deletions

View File

@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import '../../../../../common/widget_demo.dart';
import './demo.dart' ;
import './demo.dart';
const String _flatText0 = """
### **简介**
@ -10,18 +9,16 @@ const String _flatText0 = """
- 根据自己需求,进行控件对齐
### **基本用法**
> alignment → AlignmentGeometry
- 要对齐右下方的框,您将通过此框一个比子的自然大小更大的严格约束,并且对齐Alignment.bottomRight
- 要对齐右下方的框,那么对这个框对要求会比对子控件更加严肃的约束,使用:Alignment.bottomRight
- 同理Alignment.centerAlignment.bottomLeftAlignment.topLeft等
""";
const String _flatText1 = """
> widthFactor / heightFactor → double
- 如果widthFactor / heightFactor 为空并且外部无任何约束child控件大小默认那么这个控件将根据自身尺寸最大化
- 如果widthFactor / heightFactor 不为空并且外部无约束align将匹配对应的child尺寸
- exwidthFactor/ heightFactor 为2.0那么widget的宽高为child宽高的两倍
- 如果widthFactor / heightFactor 为空并且外部无约束child控件设置自身大小
- Alignment部分标签失效
- 如果widthFactor / heightFactor 为空并且外部无约束child控件将会设置自身大小
""";
class Demo extends StatefulWidget {
@ -36,13 +33,9 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'Align',
codeUrl:"elements/Frame/Align/Align/demo.dart",
codeUrl: "elements/Frame/Align/Align/demo.dart",
docUrl: 'https://docs.flutter.io/flutter/widgets/Align-class.html',
contentList: [
_flatText0,
_flatText1,
_alignCreate()
],
contentList: [_flatText0, _alignCreate()],
);
}
@ -55,7 +48,6 @@ class _DemoState extends State<Demo> {
children: <Widget>[
AlignAlignment(Alignment.center, 'center'),
AlignAlignment(Alignment.centerLeft, 'centerLeft'),
],
),
SizedBox(height: 10.0),
@ -65,7 +57,6 @@ class _DemoState extends State<Demo> {
AlignAlignment(Alignment.centerRight, 'centerRight'),
AlignAlignment(Alignment.bottomCenter, 'btCenter'),
AlignAlignment(Alignment.topCenter, 'topCenter'),
],
),
SizedBox(height: 10.0),
@ -84,13 +75,13 @@ class _DemoState extends State<Demo> {
color: Color(0xffe91e63),
child: new Align(
alignment: Alignment.topLeft,
child: new Text("Align",style:
TextStyle(color: Color(0xffffffff)),),
child: new Text(
"Align",
style: TextStyle(color: Color(0xffffffff)),
),
),
),
AlignFactor(Alignment.topLeft, 2.0, 2.0, 'topleft'),
AlignFactor(Alignment.topRight, null, null, 'topleft'),
AlignFactor(Alignment.center, null, null, 'center'),
AlignFactor(Alignment.bottomLeft, null, null, 'bottomLeft'),