docs: update dart docs for scale scale and backCardOffset

This commit is contained in:
Jawwad Hassan 2023-05-05 10:20:42 +05:00
parent aaf0b187a3
commit c55edd8d44
1 changed files with 11 additions and 0 deletions

View File

@ -57,6 +57,12 @@ class CardSwiper extends StatefulWidget {
/// The scale of the card that is behind the front card. /// The scale of the card that is behind the front card.
/// ///
/// The [scale] and [backCardOffset] both impact the positions of the back cards.
/// In order to keep the back card position same after changing the [scale],
/// the [backCardOffset] should also be adjusted.
/// * As a rough rule of thumb, 0.1 change in [scale] effects an
/// [backCardOffset] of ~35px.
///
/// Must be between 0 and 1. Defaults to 0.9. /// Must be between 0 and 1. Defaults to 0.9.
final double scale; final double scale;
@ -108,6 +114,11 @@ class CardSwiper extends StatefulWidget {
/// The offset of the back card from the front card. /// The offset of the back card from the front card.
/// ///
/// In order to keep the back card position same after changing the [backCardOffset],
/// the [scale] should also be adjusted.
/// * As a rough rule of thumb, 35px change in [backCardOffset] effects a
/// [scale] change of 0.1.
///
/// Must be a positive value. Defaults to Offset(0, 40). /// Must be a positive value. Defaults to Offset(0, 40).
final Offset backCardOffset; final Offset backCardOffset;