Skip to content

Commit

Permalink
Split convert.dart to avoid dart:ffi dep
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed May 31, 2024
1 parent facfc5c commit 44c02ce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
8 changes: 8 additions & 0 deletions packages/realm_dart/lib/src/convert.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

extension NullableObjectEx<T> on T? {
U? convert<U>(U Function(T) convertor) {
final self = this;
if (self == null) return null;
return convertor(self);
}
}
2 changes: 1 addition & 1 deletion packages/realm_dart/lib/src/credentials.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import 'dart:convert';

import 'app.dart';
import 'handles/convert.dart';
import 'convert.dart';
import 'handles/credentials_handle.dart';
import 'user.dart';

Expand Down
4 changes: 0 additions & 4 deletions packages/realm_dart/lib/src/handles/convert.dart

This file was deleted.

2 changes: 1 addition & 1 deletion packages/realm_dart/lib/src/subscription.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import 'dart:core';

import 'handles/convert.dart';
import 'convert.dart';
import 'handles/mutable_subscription_set_handle.dart';
import 'handles/subscription_handle.dart';
import 'handles/subscription_set_handle.dart';
Expand Down

0 comments on commit 44c02ce

Please sign in to comment.