Skip to content

Commit

Permalink
Better proxyDecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jan 9, 2025
1 parent c1ec323 commit fd827e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/smooth_app/lib/pages/product/simple_input_widget.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
Expand Down Expand Up @@ -211,6 +213,16 @@ class _SimpleInputWidgetState extends State<SimpleInputWidget> {
setState(() {});
},
onReorderStart: (_) => SmoothHapticFeedback.lightNotification(),
proxyDecorator: (Widget child, int index, Animation<double> animation) {
final double animValue = Curves.easeInOut.transform(animation.value);
final double elevation = lerpDouble(0, 1, animValue)!;

return Material(
elevation: elevation,
borderRadius: ANGULAR_BORDER_RADIUS,
child: child,
);
},
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
);
Expand Down

0 comments on commit fd827e2

Please sign in to comment.