Skip to content

Commit

Permalink
hotfix for 4.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Nov 11, 2024
1 parent 56e2c2b commit 2ee55c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class _TokenFolderExpandableState extends ConsumerState<TokenFolderExpandable> w
log('Moving token to folder ${widget.folder.label}', name: 'TokenFolderExpandable');
ref.read(tokenProvider.notifier).updateToken(
details.data,
(p0) => p0.copyWith(folderId: () => widget.folder.folderId, sortIndex: (widget.folder.sortIndex!) + 1),
(p0) => p0.copyWith(folderId: () => widget.folder.folderId, sortIndex: (widget.folder.sortIndex ?? 0) + 1),
);
},
builder: (context, willAccept, willReject) => Center(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class TokenFolderWidget extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final draggingSortable = ref.watch(draggingSortableProvider);
final draggingSortableNotifier = ref.read(draggingSortableProvider.notifier);
final TokenFolder? draggingFolder = draggingSortable is TokenFolder ? draggingSortable : null;
return draggingSortable == null
? LongPressDraggable(
Expand All @@ -31,14 +30,16 @@ class TokenFolderWidget extends ConsumerWidget {
);
return Offset(max(textSize.width / 2, 30), textSize.height / 2 + 30);
},
onDragStarted: () => draggingSortableNotifier.state = folder,
onDragCompleted: () {
onDragStarted: () => ref.read(draggingSortableProvider.notifier).state = folder,
onDragCompleted: () async {
Logger.info('Draggable completed', name: 'TokenFolderWidget#build');
// Will be handled by the sortableNotifier
await Future.delayed(const Duration(milliseconds: 100));
globalRef?.read(draggingSortableProvider.notifier).state = null;
},
onDraggableCanceled: (velocity, offset) {
onDraggableCanceled: (velocity, offset) async {
Logger.info('Draggable canceled', name: 'TokenFolderWidget#build');
draggingSortableNotifier.state = null;
await Future.delayed(const Duration(milliseconds: 100));
globalRef?.read(draggingSortableProvider.notifier).state = null;
},
data: folder,
childWhenDragging: const SizedBox(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ class TokenWidgetBase extends ConsumerWidget {
? LongPressDraggable(
maxSimultaneousDrags: 1,
onDragStarted: () => ref.read(draggingSortableProvider.notifier).state = token,
onDragCompleted: () {
onDragCompleted: () async {
Logger.info('Draggable completed', name: 'TokenWidgetBase#build');
// Will be handled by the sortableNotifier
await Future.delayed(const Duration(milliseconds: 100));
globalRef?.read(draggingSortableProvider.notifier).state = null;
},
onDraggableCanceled: (velocity, offset) {
onDraggableCanceled: (velocity, offset) async {
Logger.info('Draggable canceled', name: 'TokenWidgetBase#build');
await Future.delayed(const Duration(milliseconds: 100));
globalRef?.read(draggingSortableProvider.notifier).state = null;
},
dragAnchorStrategy: (Draggable<Object> d, BuildContext context, Offset point) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish_to: none
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.4.2+404205 # TODO Set the right version number
version: 4.4.2+404206 # TODO Set the right version number

# version: major.minor.build + 2x major|2x minor|3x build
# version: version number + build number (optional)
Expand Down

0 comments on commit 2ee55c8

Please sign in to comment.