Skip to content

Commit

Permalink
Fixed color cards not going back to original elevation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tantalising committed Aug 24, 2021
1 parent b7ea638 commit b6e220c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/color_grid_ui.dart
Expand Up @@ -31,6 +31,7 @@ class ColorCard extends StatelessWidget {
final int index;
ColorCard({Key? key, required this.index}) : super(key: key);

final initialElevation = Get.size.width / 144;
var padding = Get.size.width / 12;
var elevation = (Get.size.width / 144).obs;
var borderRadius = (Get.size.width / 72).obs;
Expand Down Expand Up @@ -76,7 +77,7 @@ class ColorCard extends StatelessWidget {
elevation.value = elevation.value + 20;
scale.value = 1.1;
} else if (!clicked) {
elevation.value = elevation.value - 20;
elevation.value = initialElevation;
scale.value = 1.0;
}
}
Expand All @@ -89,7 +90,7 @@ class ColorCard extends StatelessWidget {
await applyColorScheme(context, index: index);

rotationAngle.value = 0;
elevation.value = elevation.value - 20;
elevation.value = initialElevation; // No matter what elevation should be restored to initial value.
scale.value = 1.0;
clicked = false;
}
Expand Down

0 comments on commit b6e220c

Please sign in to comment.