Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
+13
-33
@@ -8,22 +8,12 @@ const ValueKey<String> _cardTransformKey =
|
||||
ValueKey<String>('holo_shiny.card.transform');
|
||||
|
||||
void main() {
|
||||
test('default holograph style is crackedIce', () {
|
||||
test('default profile is crackedIce', () {
|
||||
const Shiny shiny = Shiny(child: SizedBox.shrink());
|
||||
const ShinyCard shinyCard = ShinyCard();
|
||||
|
||||
expect(shiny.style, HolographStyle.crackedIce);
|
||||
expect(shinyCard.style, HolographStyle.crackedIce);
|
||||
});
|
||||
|
||||
test('default sparkle shape is none', () {
|
||||
const Shiny shiny = Shiny(child: SizedBox.shrink());
|
||||
const ShinyCard shinyCard = ShinyCard();
|
||||
|
||||
expect(shiny.sparkleShape.kind, SparkleShapeKind.none);
|
||||
expect(shiny.sparkleShape.primary, 0.0);
|
||||
expect(shinyCard.sparkleShape.kind, SparkleShapeKind.none);
|
||||
expect(shinyCard.sparkleShape.primary, 0.0);
|
||||
expect(shiny.profile, ShinyProfile.crackedIce);
|
||||
expect(shinyCard.profile, ShinyProfile.crackedIce);
|
||||
});
|
||||
|
||||
test('default opacity is 1.0', () {
|
||||
@@ -34,27 +24,17 @@ void main() {
|
||||
expect(shinyCard.opacity, 1.0);
|
||||
});
|
||||
|
||||
test('custom sparkle factories produce expected specs', () {
|
||||
final SparkleShapeSpec star =
|
||||
SparkleShapeSpec.customStar(points: 7, innerRatio: 0.33);
|
||||
final SparkleShapeSpec polygon = SparkleShapeSpec.customPolygon(
|
||||
sides: 8, aspectRatio: 1.2, rotation: 0.4);
|
||||
final SparkleShapeSpec rectangle = SparkleShapeSpec.customRectangle(
|
||||
halfWidth: 0.20, halfHeight: 0.05, rotationJitter: 0.7);
|
||||
test('custom profile can be set on both widgets', () {
|
||||
const Shiny shiny = Shiny(
|
||||
profile: ShinyProfile.superGoldVinyl,
|
||||
child: SizedBox.shrink(),
|
||||
);
|
||||
const ShinyCard shinyCard = ShinyCard(
|
||||
profile: ShinyProfile.silverMosaic,
|
||||
);
|
||||
|
||||
expect(star.kind, SparkleShapeKind.star);
|
||||
expect(star.primary, 7.0);
|
||||
expect(star.secondary, 0.33);
|
||||
|
||||
expect(polygon.kind, SparkleShapeKind.polygon);
|
||||
expect(polygon.primary, 8.0);
|
||||
expect(polygon.secondary, 1.2);
|
||||
expect(polygon.tertiary, 0.4);
|
||||
|
||||
expect(rectangle.kind, SparkleShapeKind.rectangle);
|
||||
expect(rectangle.primary, 0.20);
|
||||
expect(rectangle.secondary, 0.05);
|
||||
expect(rectangle.tertiary, 0.7);
|
||||
expect(shiny.profile, ShinyProfile.superGoldVinyl);
|
||||
expect(shinyCard.profile, ShinyProfile.silverMosaic);
|
||||
});
|
||||
|
||||
testWidgets('Shiny wraps any child without card transform',
|
||||
|
||||
Reference in New Issue
Block a user