mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-19 11:53:37 +08:00
modify some description
This commit is contained in:
@ -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.center,Alignment.bottomLeft,Alignment.topLeft等
|
||||
""";
|
||||
|
||||
const String _flatText1 = """
|
||||
> widthFactor / heightFactor → double
|
||||
- 如果widthFactor / heightFactor 为空,并且外部无任何约束,child控件大小默认,那么这个控件将根据自身尺寸最大化
|
||||
|
||||
- 如果widthFactor / heightFactor 不为空,并且外部无约束,align将匹配对应的child尺寸
|
||||
- ex:widthFactor/ 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'),
|
||||
|
Reference in New Issue
Block a user