From 146ec762b208d471c35a5894794336c1f864e831 Mon Sep 17 00:00:00 2001 From: ricardodalarme Date: Tue, 9 Jan 2024 14:47:23 -0300 Subject: [PATCH] feat: impove type inference --- lib/src/typedefs.dart | 4 ++-- lib/src/undoable.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/typedefs.dart b/lib/src/typedefs.dart index fd49f18..c6582d1 100644 --- a/lib/src/typedefs.dart +++ b/lib/src/typedefs.dart @@ -9,7 +9,7 @@ typedef CardSwiperOnSwipe = FutureOr Function( CardSwiperDirection direction, ); -typedef CardSwiperOnSwipeUpdate = Function( +typedef CardSwiperOnSwipeUpdate = void Function( int? currentIndex, CardSwiperDirection direction, ); @@ -21,7 +21,7 @@ typedef NullableCardBuilder = Widget? Function( int verticalOffsetPercentage, ); -typedef CardSwiperDirectionChange = Function( +typedef CardSwiperDirectionChange = void Function( CardSwiperDirection horizontalDirection, CardSwiperDirection verticalDirection, ); diff --git a/lib/src/undoable.dart b/lib/src/undoable.dart index f79f428..888c3d9 100644 --- a/lib/src/undoable.dart +++ b/lib/src/undoable.dart @@ -1,8 +1,8 @@ class Undoable { - Undoable(this._value, {Undoable? previousValue}) : _previous = previousValue; + Undoable(this._value, {Undoable? previousValue}) : _previous = previousValue; T _value; - Undoable? _previous; + Undoable? _previous; T get state => _value; T? get previousState => _previous?.state;