diff --git a/.travis.yml b/.travis.yml index 47f62b8ff9332..5ba507630ce57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: dart dart: - - 2.1.0 + - 2.1.1 - dev dart_task: diff --git a/README.md b/README.md index e12c8d1cce9b8..ac6927e5091bc 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,12 @@ import 'package:http_multi_server/http_multi_server.dart'; import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf_io.dart' as shelf_io; -void main() { +void main() async { // Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same // server. - HttpMultiServer.loopback(8080).then((server) { - shelf_io.serveRequests(server, (request) { - return new shelf.Response.ok("Hello, world!"); - }); + var server = await HttpMultiServer.loopback(8080); + shelf_io.serveRequests(server, (request) { + return shelf.Response.ok("Hello, world!"); }); } ``` diff --git a/analysis_options.yaml b/analysis_options.yaml index 8dfb3d059109f..027be6fee2fcd 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -4,8 +4,6 @@ analyzer: implicit-casts: false linter: rules: - - avoid_empty_else - - avoid_init_to_null - avoid_null_checks_in_equality_operators - avoid_unused_constructor_parameters - annotate_overrides @@ -15,30 +13,18 @@ linter: - constant_identifier_names - control_flow_in_finally - directives_ordering - - empty_catches - - empty_constructor_bodies - empty_statements - hash_and_equals - implementation_imports - iterable_contains_unrelated_type - - library_names - - library_prefixes - list_remove_unrelated_type - non_constant_identifier_names - overridden_fields - package_api_docs - package_names - package_prefixed_library_names - - prefer_equal_for_default_values - prefer_final_fields - prefer_generic_function_type_aliases - - prefer_is_not_empty - - slash_for_doc_comments - test_types_in_equals - throw_in_finally - - type_init_formals - unnecessary_brace_in_string_interps - - unnecessary_const - - unnecessary_new - - unrelated_type_equality_checks - - valid_regexps diff --git a/example/main.dart b/example/main.dart new file mode 100644 index 0000000000000..bf78a51c57404 --- /dev/null +++ b/example/main.dart @@ -0,0 +1,12 @@ +import 'package:http_multi_server/http_multi_server.dart'; +import 'package:shelf/shelf.dart' as shelf; +import 'package:shelf/shelf_io.dart' as shelf_io; + +void main() async { + // Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same + // server. + var server = await HttpMultiServer.loopback(8080); + shelf_io.serveRequests(server, (request) { + return shelf.Response.ok("Hello, world!"); + }); +} diff --git a/pubspec.yaml b/pubspec.yaml index 7249a60f4698c..dc78335ce9927 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,12 +7,12 @@ author: Dart Team homepage: https://github.com/dart-lang/http_multi_server environment: - sdk: '>=2.1.0 <3.0.0' + sdk: '>=2.1.1 <3.0.0' dependencies: async: '>=1.2.0 <3.0.0' dev_dependencies: http: ^0.12.0 - pedantic: ^1.4.0 + pedantic: ^1.8.0 test: ^1.5.2