From b928e34a1186275c9986e8bcd1cdc2cbd7b89b4b Mon Sep 17 00:00:00 2001 From: Naveen Gattu Date: Tue, 24 Dec 2019 15:30:15 -0800 Subject: [PATCH] implement overrideForAll and overrideFor --- moor_ffi/lib/src/load_library.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/moor_ffi/lib/src/load_library.dart b/moor_ffi/lib/src/load_library.dart index 1da02aaa..e669fadd 100644 --- a/moor_ffi/lib/src/load_library.dart +++ b/moor_ffi/lib/src/load_library.dart @@ -86,7 +86,9 @@ class OpenDynamicLibrary { /// /// When using the asynchronous API over isolates, [open] __must be__ a top- /// level function or a static method. - void overrideFor(OperatingSystem os, OpenLibrary open) {} + void overrideFor(OperatingSystem os, OpenLibrary open) { + _overriddenPlatforms[os] = open; + } /// Makes `moor_ffi` use the [OpenLibrary] function for all Dart platforms. /// If this method has been called, it takes precedence over [overrideFor]. @@ -94,5 +96,7 @@ class OpenDynamicLibrary { /// /// When using the asynchronous API over isolates, [open] __must be__ a top- /// level function or a static method. - void overrideForAll(OpenLibrary open) {} + void overrideForAll(OpenLibrary open) { + _overriddenForAll = open; + } }