Skip to content

Commit ab60cd5

Browse files
committed
Improve documentation and fix changelog
1 parent 516954e commit ab60cd5

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
## 2.0.0+1
2+
3+
* Improved documentation
4+
15
## 2.0.0
26

3-
* **BREAKING:** `RenderPrototypeConstrainedBox` is now private
47
* **BREAKING:** `PrototypeConstrainedBoxElement` is now private
58
* **BREAKING:** `ConstraintType` has been removed from the API
69
* **BREAKING:** `PrototypeConstrainedBox` is now a `final class`, and thus can't be extended/implemented anymore
@@ -9,6 +12,7 @@
912
* `PrototypeConstrainedBox.tightHorizontal` and `PrototypeConstrainedBox.tightVertical` have been replaced by `PrototypeConstrainedBox.tightFor`
1013
* `PrototypeConstrainedBox` default unnamed constructor allows for complete customization of constraints, allowing constraints that were not possible before
1114
* **Fix:** `RenderPrototypeConstrainedBox` was not calling `super` on `redepthChildren`
15+
* Now, instead of laying out `prototype`, we compute it's constraints by using `getDryLayout`
1216

1317
## 1.0.0
1418

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99
* However, instead of passing directly a [`BoxConstraints`](https://api.flutter.dev/flutter/rendering/BoxConstraints-class.html), you pass another `prototype` widget that will be used as constraint;
1010
* You may constrain the `child` loosely or tightly, in one or both of the axes.
1111

12-
## Getting started
13-
14-
Add `prototype_constrained_box` as a dependency in your `pubspec.yaml`:
15-
16-
```yaml
17-
dependencies:
18-
prototype_constrained_box: ^1.0.0
19-
```
20-
2112
## Usage
2213

2314
Use the `PrototypeConstrainedBox` widget by providing a `prototype` and a `child`.
@@ -26,8 +17,15 @@ The following example will render a `ColoredBox` that will fill the space that t
2617
```dart
2718
const PrototypeConstrainedBox.tight(
2819
prototype: Text('Lorem ipsum dolor'),
29-
child: ColoredBox(color: Color(0xFFFF0000)),
20+
child: ColoredBox(
21+
color: Color(0xFFFF0000),
22+
),
3023
);
3124
```
3225

26+
Aside from [`.tight`](https://pub.dev/documentation/prototype_constrained_box/latest/prototype_constrained_box/PrototypeConstrainedBox/PrototypeConstrainedBox.tight.html),
27+
`PrototypeConstrainedBox` also provides [`.loose`](https://pub.dev/documentation/prototype_constrained_box/latest/prototype_constrained_box/PrototypeConstrainedBox/PrototypeConstrainedBox.loose.html),
28+
[`.tightFor`](https://pub.dev/documentation/prototype_constrained_box/latest/prototype_constrained_box/PrototypeConstrainedBox/PrototypeConstrainedBox.tightFor.html) or you can completely customize the
29+
constraints by using the [default unnamed constructor](https://pub.dev/documentation/prototype_constrained_box/latest/prototype_constrained_box/PrototypeConstrainedBox/PrototypeConstrainedBox.html).
30+
3331
For more information regarding the `PrototypeConstrainedBox` API, refer to [the documentation](https://pub.dev/documentation/prototype_constrained_box/latest/prototype_constrained_box/PrototypeConstrainedBox-class.html).

lib/src/widget.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import 'package:flutter/widgets.dart';
77
/// you could do:
88
///
99
/// ```dart
10-
/// PrototypeConstrainedBox.tight(
10+
/// const PrototypeConstrainedBox.tight(
1111
/// prototype: Text('Lorem ipsum dolor'),
12-
/// child: ColoredBox(color: Color(0xFFFF0000)),
12+
/// child: ColoredBox(
13+
/// color: Color(0xFFFF0000),
14+
/// ),
1315
/// );
1416
/// ```
1517
///

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: prototype_constrained_box
22
description: A ConstrainedBox-like widget, but the constraints are given by another widget.
3-
version: 2.0.0
3+
version: 2.0.0+1
44
repository: https://github.com/mateusfccp/prototype_constrained_box
55
issue_tracker: https://github.com/mateusfccp/prototype_constrained_box/issues
66

0 commit comments

Comments
 (0)