Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Removed shadows from animated list tile
Browse files Browse the repository at this point in the history
Due to Material Design Guideliness
  • Loading branch information
tsinis committed Feb 2, 2021
1 parent 95cc2ee commit 67603aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
35 changes: 11 additions & 24 deletions lib/ui/widgets/animated/animated_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ class _AnimatedListItemState extends State<AnimatedListItem> {
Future.delayed(Duration(milliseconds: widget.index * 120), () => setState(() => isAnimationDone = true));
}

double get shadowToZero => isAnimationDone ? 3 : 0;
// double get shadowFromZero => isAnimationDone ? 5 : 0;

@override
Widget build(BuildContext context) => (widget.height != null)
? AnimatedContainer(
curve: Curves.easeOutQuart,
height: isAnimationDone ? widget.height! : widget.index + 1 * widget.height! * widget.length,
duration: const Duration(milliseconds: 600),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: isAnimationDone ? Colors.black.withOpacity(0) : Colors.black26,
blurRadius: shadowToZero,
offset: Offset(0, shadowToZero),
spreadRadius: shadowToZero)
],
),
// decoration: BoxDecoration(
// boxShadow: [
// BoxShadow(
// color: Colors.black26,
// blurRadius: shadowFromZero / 1.5,
// offset: Offset(0, shadowFromZero),
// spreadRadius: shadowFromZero)
// ],
// ),
child: AnimatedOpacity(
duration: const Duration(milliseconds: 600),
opacity: isAnimationDone ? 1 : 0,
Expand All @@ -53,19 +53,6 @@ class _AnimatedListItemState extends State<AnimatedListItem> {
: AnimatedOpacity(
duration: const Duration(milliseconds: 600),
opacity: isAnimationDone ? 1 : 0,
child: AnimatedContainer(
curve: Curves.easeOutQuart,
duration: const Duration(milliseconds: 600),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: isAnimationDone ? Colors.black12 : Colors.black26,
blurRadius: shadowToZero / 3,
offset: const Offset(0, -1.5),
spreadRadius: shadowToZero / 3)
],
),
child: widget.child,
),
child: widget.child,
);
}
3 changes: 1 addition & 2 deletions lib/ui/widgets/lists/favorites_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ class _FavoritesListState extends State<FavoritesList> {
// separatorBuilder: (_, __) => const Divider(height: 1.2),
itemCount: widget.favoriteColors.length,
itemBuilder: (context, listIndex) => Dismissible(
// resizeDuration: const Duration(milliseconds: 800),
key: UniqueKey(),
onResize: () {
if (_isDissmised) {
BlocProvider.of<FavoritesBloc>(context).add(FavoritesOneRemoved(colorToRemoveIndex: listIndex));
}
setState(() => _isDissmised = false);
_isDissmised = false;
},
onDismissed: (_) => setState(() => _isDissmised = true),
secondaryBackground: const RemoveBackground(secondary: true),
Expand Down
4 changes: 1 addition & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
sdk: flutter
flutter_bloc: ^7.0.0-nullsafety.1
flutter_colorpicker: ^0.4.0-nullsafety.0
hive: ^1.6.0-nullsafety.1
hive: ^1.6.0-nullsafety.2
hive_flutter:
http: ^0.13.0-nullsafety.0
json_annotation: ^4.0.0-nullsafety.0
Expand All @@ -29,8 +29,6 @@ dependencies:
url_launcher: ^6.0.0-nullsafety.6
vibration: ^1.7.4-nullsafety.0

# dependency_overrides:
# crypto: ^3.0.0-nullsafety.0

dev_dependencies:
build_runner:
Expand Down

0 comments on commit 67603aa

Please sign in to comment.