diff --git a/lib/src/dbus_code_generator.dart b/lib/src/dbus_code_generator.dart index b937f1e..450e15a 100644 --- a/lib/src/dbus_code_generator.dart +++ b/lib/src/dbus_code_generator.dart @@ -36,6 +36,7 @@ class DBusCodeGenerator { var source = ''; source += _generateHeader(); + source += "import 'dart:io';\n"; source += "import 'package:dbus/dbus.dart';\n"; source += '\n'; source += _generateRemoteObjectClass(); @@ -48,6 +49,7 @@ class DBusCodeGenerator { var source = ''; source += _generateHeader(); + source += "import 'dart:io';\n"; source += "import 'package:dbus/dbus.dart';\n"; source += '\n'; source += _generateObjectClass(); diff --git a/test/dbus_test.dart b/test/dbus_test.dart index 06427b3..f8c797b 100644 --- a/test/dbus_test.dart +++ b/test/dbus_test.dart @@ -5747,6 +5747,7 @@ void main() { equals('// This is great code.\n' '// It is the best code.\n' '\n' + 'import \'dart:io\';\n' 'import \'package:dbus/dbus.dart\';\n' '\n' 'class ComExampleObject extends DBusRemoteObject {\n' @@ -5757,6 +5758,7 @@ void main() { equals('// This is great code.\n' '// It is the best code.\n' '\n' + 'import \'dart:io\';\n' 'import \'package:dbus/dbus.dart\';\n' '\n' 'class ComExampleObject extends DBusObject {\n' diff --git a/test/generated-code/method-multiple-inputs.client.out b/test/generated-code/method-multiple-inputs.client.out index 0a036a1..2983f89 100644 --- a/test/generated-code/method-multiple-inputs.client.out +++ b/test/generated-code/method-multiple-inputs.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-multiple-inputs.server.out b/test/generated-code/method-multiple-inputs.server.out index 29dad40..f824911 100644 --- a/test/generated-code/method-multiple-inputs.server.out +++ b/test/generated-code/method-multiple-inputs.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/method-multiple-outputs.client.out b/test/generated-code/method-multiple-outputs.client.out index ed005c2..a95d6f0 100644 --- a/test/generated-code/method-multiple-outputs.client.out +++ b/test/generated-code/method-multiple-outputs.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-multiple-outputs.server.out b/test/generated-code/method-multiple-outputs.server.out index 8aa94c8..3b507c7 100644 --- a/test/generated-code/method-multiple-outputs.server.out +++ b/test/generated-code/method-multiple-outputs.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/method-no-args.client.out b/test/generated-code/method-no-args.client.out index 9afb737..1b9ee9d 100644 --- a/test/generated-code/method-no-args.client.out +++ b/test/generated-code/method-no-args.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-no-args.server.out b/test/generated-code/method-no-args.server.out index d58c090..ec05f3b 100644 --- a/test/generated-code/method-no-args.server.out +++ b/test/generated-code/method-no-args.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/method-no-reply.client.out b/test/generated-code/method-no-reply.client.out index 519f140..8ffe63b 100644 --- a/test/generated-code/method-no-reply.client.out +++ b/test/generated-code/method-no-reply.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-no-reply.server.out b/test/generated-code/method-no-reply.server.out index 51ffaa3..e2eb23c 100644 --- a/test/generated-code/method-no-reply.server.out +++ b/test/generated-code/method-no-reply.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/method-single-input.client.out b/test/generated-code/method-single-input.client.out index bb86f55..5f195da 100644 --- a/test/generated-code/method-single-input.client.out +++ b/test/generated-code/method-single-input.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-single-input.server.out b/test/generated-code/method-single-input.server.out index 684aef0..a972f47 100644 --- a/test/generated-code/method-single-input.server.out +++ b/test/generated-code/method-single-input.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/method-single-output.client.out b/test/generated-code/method-single-output.client.out index f07bbc6..2be9f28 100644 --- a/test/generated-code/method-single-output.client.out +++ b/test/generated-code/method-single-output.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-single-output.server.out b/test/generated-code/method-single-output.server.out index ac50875..296c34e 100644 --- a/test/generated-code/method-single-output.server.out +++ b/test/generated-code/method-single-output.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/method-unnamed-arg.client.out b/test/generated-code/method-unnamed-arg.client.out index 6555c0d..4a0224c 100644 --- a/test/generated-code/method-unnamed-arg.client.out +++ b/test/generated-code/method-unnamed-arg.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/method-unnamed-arg.server.out b/test/generated-code/method-unnamed-arg.server.out index 646e094..934e51c 100644 --- a/test/generated-code/method-unnamed-arg.server.out +++ b/test/generated-code/method-unnamed-arg.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/methods.client.out b/test/generated-code/methods.client.out index 7461ac5..b2a7e75 100644 --- a/test/generated-code/methods.client.out +++ b/test/generated-code/methods.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/methods.server.out b/test/generated-code/methods.server.out index 61e2c60..c41f35b 100644 --- a/test/generated-code/methods.server.out +++ b/test/generated-code/methods.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/multiple-interfaces.client.out b/test/generated-code/multiple-interfaces.client.out index bd41ff8..053fed4 100644 --- a/test/generated-code/multiple-interfaces.client.out +++ b/test/generated-code/multiple-interfaces.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest1 extends DBusRemoteObject { diff --git a/test/generated-code/multiple-interfaces.server.out b/test/generated-code/multiple-interfaces.server.out index bb97146..770abc1 100644 --- a/test/generated-code/multiple-interfaces.server.out +++ b/test/generated-code/multiple-interfaces.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest1 extends DBusObject { diff --git a/test/generated-code/properties.client.out b/test/generated-code/properties.client.out index 1866bd9..fd1a53f 100644 --- a/test/generated-code/properties.client.out +++ b/test/generated-code/properties.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/properties.server.out b/test/generated-code/properties.server.out index 8cad3c2..ca4a22f 100644 --- a/test/generated-code/properties.server.out +++ b/test/generated-code/properties.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/property-access.client.out b/test/generated-code/property-access.client.out index ed56b74..55bbdb4 100644 --- a/test/generated-code/property-access.client.out +++ b/test/generated-code/property-access.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/property-access.server.out b/test/generated-code/property-access.server.out index 8ef7bf4..2786ac2 100644 --- a/test/generated-code/property-access.server.out +++ b/test/generated-code/property-access.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/property.client.out b/test/generated-code/property.client.out index 19a09f4..7ce8350 100644 --- a/test/generated-code/property.client.out +++ b/test/generated-code/property.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusRemoteObject { diff --git a/test/generated-code/property.server.out b/test/generated-code/property.server.out index 7b9640f..c3791fe 100644 --- a/test/generated-code/property.server.out +++ b/test/generated-code/property.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/signal-multiple-args.client.out b/test/generated-code/signal-multiple-args.client.out index 1b2e36b..23408b1 100644 --- a/test/generated-code/signal-multiple-args.client.out +++ b/test/generated-code/signal-multiple-args.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; /// Signal data for com.example.Test.Event. diff --git a/test/generated-code/signal-multiple-args.server.out b/test/generated-code/signal-multiple-args.server.out index 95215aa..92cbfe0 100644 --- a/test/generated-code/signal-multiple-args.server.out +++ b/test/generated-code/signal-multiple-args.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/signal-no-args.client.out b/test/generated-code/signal-no-args.client.out index 42db333..24d6c05 100644 --- a/test/generated-code/signal-no-args.client.out +++ b/test/generated-code/signal-no-args.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; /// Signal data for com.example.Test.Event. diff --git a/test/generated-code/signal-no-args.server.out b/test/generated-code/signal-no-args.server.out index 862c947..e4bf948 100644 --- a/test/generated-code/signal-no-args.server.out +++ b/test/generated-code/signal-no-args.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/signal-single-arg.client.out b/test/generated-code/signal-single-arg.client.out index be5662b..a39976a 100644 --- a/test/generated-code/signal-single-arg.client.out +++ b/test/generated-code/signal-single-arg.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; /// Signal data for com.example.Test.Event. diff --git a/test/generated-code/signal-single-arg.server.out b/test/generated-code/signal-single-arg.server.out index 0bb527f..bd1a7a2 100644 --- a/test/generated-code/signal-single-arg.server.out +++ b/test/generated-code/signal-single-arg.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject { diff --git a/test/generated-code/signals.client.out b/test/generated-code/signals.client.out index 16eabfb..2a764f3 100644 --- a/test/generated-code/signals.client.out +++ b/test/generated-code/signals.client.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; /// Signal data for com.example.Test.Event1. diff --git a/test/generated-code/signals.server.out b/test/generated-code/signals.server.out index b505e7d..6740e94 100644 --- a/test/generated-code/signals.server.out +++ b/test/generated-code/signals.server.out @@ -1,3 +1,4 @@ +import 'dart:io'; import 'package:dbus/dbus.dart'; class ComExampleTest extends DBusObject {