Skip to content

Commit 79c5edb

Browse files
authored
ToastPosition.copyWith (#82)
1 parent ab30ba8 commit 79c5edb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 3.1.0
44

5+
- Support `copyWith` for `ToastPosition`. (#82)
56
- Integrate `animationBuilder` properly. (#81)
67
- **BREAKING CHANGE**: `handleTouth` -> `handleTouch`.
78
- Code cleanup.

lib/src/core/position.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ class ToastPosition {
1515
static const ToastPosition top =
1616
ToastPosition(align: Alignment.topCenter, offset: 75.0);
1717

18+
ToastPosition copyWith({AlignmentGeometry? align, double? offset}) {
19+
return ToastPosition(
20+
align: align ?? this.align,
21+
offset: offset ?? this.offset,
22+
);
23+
}
24+
1825
@override
1926
String toString() => 'ToastPosition(align: $align, offset: $offset)';
2027
}

0 commit comments

Comments
 (0)