Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.1.0-alpha

add pinned position support.

# v1.0.7-stable

optimize key set.
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ two-way constraints, such as chains(not yet supported, please use with Flex).
16. staggered grid、grid、list(list is a special staggered grid, grid is also a special staggered
grid)
17. circle position
18. e-index(event dispatch order, default is z-index)
19. the size of child widgets can be set to:
18. pinned position
19. e-index(event dispatch order, default is z-index)
20. the size of child widgets can be set to:
1. fixed size(>=0)
2. matchParent
3. wrapContent(default, minimum and maximum supported)
4. matchConstraint
20. the size of itself can be set to:
21. the size of itself can be set to:
1. fixed size(>=0)
2. matchParent(default)
3. wrapContent(minimum and maximum are temporarily not supported)
Expand Down Expand Up @@ -171,12 +172,12 @@ dependencies:
flutter_constraintlayout:
git:
url: 'https://github.com/hackware1993/Flutter-ConstraintLayout.git'
ref: 'v1.0.7-stable'
ref: 'v1.1.0-alpha'
```

```yaml
dependencies:
flutter_constraintlayout: ^1.0.7-stable
flutter_constraintlayout: ^1.1.0-alpha
```

```dart
Expand Down
11 changes: 6 additions & 5 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ build 耗时有时甚至超过渲染耗时。
27. centerBottomRightTo
16. 瀑布流、网格、列表(列表是一个特殊的瀑布流,网格也是一个特殊的瀑布流)
17. 圆形定位
18. e-index(事件分发顺序,默认是 z-index,一般用来处理点击区域)
19. 子元素的大小可以被设置为:
18. 图钉定位
19. e-index(事件分发顺序,默认是 z-index,一般用来处理点击区域)
20. 子元素的大小可以被设置为:
1. 固定大小(>=0)
2. matchParent
3. wrapContent(默认值,支持最大、最小设置)
4. matchConstraint
20. 自身的大小可以被设置为:
21. 自身的大小可以被设置为:
1. 固定大小(>=0)
2. matchParent(default)
3. wrapContent(暂不支持最大、最小设置)
Expand Down Expand Up @@ -145,12 +146,12 @@ dependencies:
flutter_constraintlayout:
git:
url: 'https://github.com/hackware1993/Flutter-ConstraintLayout.git'
ref: 'v1.0.7-stable'
ref: 'v1.1.0-alpha'
```

```yaml
dependencies:
flutter_constraintlayout: ^1.0.7-stable
flutter_constraintlayout: ^1.1.0-alpha
```

```dart
Expand Down
2 changes: 2 additions & 0 deletions example/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'guideline.dart';
import 'horizontal_list.dart';
import 'margin.dart';
import 'percentage_layout.dart';
import 'pinned_position.dart';
import 'relative_id.dart';
import 'self_wrap_content.dart';
import 'staggered_grid.dart';
Expand All @@ -38,6 +39,7 @@ class ExampleHome extends StatelessWidget {
'Vertical List': const VerticalListExample(),
'Staggered Grid': const StaggeredGridExample(),
'Circle Position': const CirclePositionExample(),
'Pinned Position': const PinnedPositionExample(),
'Self wrapContent': const SelfWrapContentExample(),
'Margin': const MarginExample(),
'Charts': const ChartsExample(),
Expand Down
41 changes: 41 additions & 0 deletions example/pinned_position.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:flutter_constraintlayout/src/constraint_layout.dart';

import 'custom_app_bar.dart';

class PinnedPositionExample extends StatelessWidget {
const PinnedPositionExample({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
ConstraintId anchor = ConstraintId('anchor');
return Scaffold(
appBar: const CustomAppBar(
title: 'Pinned Position',
codePath: 'example/pinned_position.dart',
),
body: ConstraintLayout(
children: [
Container(
color: Colors.yellow,
).applyConstraint(
id: anchor,
size: 200,
centerTo: parent,
),
Container(
color: Colors.cyan,
).applyConstraint(
size: 40,
pinnedInfo: PinnedInfo(
anchor,
PinnedPos(0, PinnedType.absolute, 0.5, PinnedType.percent),
PinnedPos(0.5, PinnedType.percent, 0.5, PinnedType.percent),
rotateDegree: 45,
),
)
],
),
);
}
}
Loading