Line data Source code
1 : import 'package:combine/src/isolate_factory/isolate_factory.dart'; 2 : import 'package:combine/src/isolate_factory/native_isolate_factory.dart' 3 : if (dart.library.html) 'package:combine/src/isolate_factory/web_isolate_factory.dart'; 4 : import 'package:flutter/foundation.dart'; 5 : 6 1 : @visibleForTesting 7 : void setTestIsolateFactory(IsolateFactory isolateFactory) { 8 : _testIsolateFactory = isolateFactory; 9 : } 10 : 11 1 : @visibleForTesting 12 : void cleanTestIsolateFactory() { 13 : _testIsolateFactory = null; 14 : } 15 : 16 : IsolateFactory? _testIsolateFactory; 17 : 18 : /// Returns test isolate factory or it's implementation depending on the platform. 19 2 : IsolateFactory get effectiveIsolateFactory { 20 2 : return _testIsolateFactory ?? IsolateFactoryImpl(); 21 : }