├── .firebaserc ├── .gitignore ├── .gitmodules ├── .travis.yml ├── AUTHORS ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── _config.yml ├── _config_dev.yml ├── _config_now.yml ├── analysis_options.yaml ├── build.excerpt.yaml ├── deploy ├── check_sitemap.rb ├── check_url.sh ├── cibuild ├── effective-dart-rules │ ├── .gitignore │ ├── analysis_options.yaml │ ├── bin │ │ └── main.dart │ └── pubspec.yaml ├── html_proof.rb ├── runtests.sh └── urls │ ├── get_all.rb │ ├── old_site_urls.txt │ └── older_site_urls.txt ├── examples ├── .gitignore ├── README.md ├── analysis_options.yaml ├── dart_test.yaml ├── httpserver │ ├── .gitignore │ ├── analysis_options.yaml │ ├── bin │ │ ├── basic_file_server.dart │ │ ├── basic_writer_client.dart │ │ ├── basic_writer_server.dart │ │ ├── hello_world_server.dart │ │ ├── hello_world_server_secure.dart │ │ ├── index.html │ │ ├── mini_file_server.dart │ │ ├── note_server.dart │ │ ├── notes.txt │ │ ├── number_guesser.dart │ │ ├── number_thinker.dart │ │ ├── server_authority.pem │ │ ├── server_chain.pem │ │ ├── server_key.pem │ │ └── static_file_server.dart │ ├── pubspec.yaml │ ├── test │ │ └── httpserver_test.dart │ └── web │ │ ├── make_a_guess.html │ │ ├── note_client.dart │ │ └── note_taker.html ├── misc │ ├── analysis_options.yaml │ ├── analyzer-1-results.txt │ ├── analyzer-2-results.txt │ ├── dart_test.yaml │ ├── lib │ │ ├── articles │ │ │ ├── creating-streams │ │ │ │ ├── line_stream.dart │ │ │ │ ├── line_stream_generator.dart │ │ │ │ ├── someFile.txt │ │ │ │ ├── stream_controller.dart │ │ │ │ └── stream_controller_bad.dart │ │ │ ├── emulating-functions │ │ │ │ └── emulating-functions.dart │ │ │ └── io │ │ │ │ ├── io_file_system_test.dart │ │ │ │ ├── io_http_server_file_test.dart │ │ │ │ ├── io_http_server_test.dart │ │ │ │ ├── io_process_stdio_test.dart │ │ │ │ ├── io_process_test.dart │ │ │ │ ├── io_process_transform_test.dart │ │ │ │ ├── io_random_access_test.dart │ │ │ │ ├── io_stream_test.dart │ │ │ │ └── io_timer_test.dart │ │ ├── effective_dart │ │ │ ├── bar │ │ │ │ └── bar.dart │ │ │ ├── design_bad.dart │ │ │ ├── design_good.dart │ │ │ ├── docs_bad.dart │ │ │ ├── docs_good.dart │ │ │ ├── foo.dart │ │ │ ├── foo │ │ │ │ ├── SliderMenu.dart │ │ │ │ ├── file_system.dart │ │ │ │ ├── foo.dart │ │ │ │ └── slider_menu.dart │ │ │ ├── my_library.dart │ │ │ ├── some │ │ │ │ └── other │ │ │ │ │ ├── file.dart │ │ │ │ │ └── file_2.dart │ │ │ ├── src │ │ │ │ ├── error.dart │ │ │ │ └── foo_bar.dart │ │ │ ├── style_bad.dart │ │ │ ├── style_good.dart │ │ │ ├── style_lib_bad.dart │ │ │ ├── style_lib_good.dart │ │ │ ├── usage_bad.dart │ │ │ └── usage_good.dart │ │ ├── language_tour │ │ │ ├── async.dart │ │ │ ├── built_in_types.dart │ │ │ ├── callable_classes.dart │ │ │ ├── classes │ │ │ │ ├── doer.dart │ │ │ │ ├── employee.dart │ │ │ │ ├── enum.dart │ │ │ │ ├── extends.dart │ │ │ │ ├── immutable_point.dart │ │ │ │ ├── impostor.dart │ │ │ │ ├── logger.dart │ │ │ │ ├── misc.dart │ │ │ │ ├── no_such_method.dart │ │ │ │ ├── orchestra.dart │ │ │ │ ├── point.dart │ │ │ │ ├── point_alt.dart │ │ │ │ ├── point_redirecting.dart │ │ │ │ ├── point_with_distance_field.dart │ │ │ │ ├── point_with_distance_method.dart │ │ │ │ ├── point_with_main.dart │ │ │ │ ├── rectangle.dart │ │ │ │ └── vector.dart │ │ │ ├── comments.dart │ │ │ ├── control_flow.dart │ │ │ ├── exceptions.dart │ │ │ ├── function_equality.dart │ │ │ ├── functions.dart │ │ │ ├── generics │ │ │ │ ├── base_class.dart │ │ │ │ ├── cache.dart │ │ │ │ └── misc.dart │ │ │ ├── libraries │ │ │ │ ├── greeter.dart │ │ │ │ ├── hello.dart │ │ │ │ ├── import_as.dart │ │ │ │ ├── lib1.dart │ │ │ │ ├── lib2.dart │ │ │ │ └── show_hide.dart │ │ │ ├── metadata │ │ │ │ ├── misc.dart │ │ │ │ ├── television.dart │ │ │ │ └── todo.dart │ │ │ ├── operators.dart │ │ │ ├── typedefs │ │ │ │ ├── misc.dart │ │ │ │ ├── sorted_collection_1.dart │ │ │ │ └── sorted_collection_2.dart │ │ │ └── variables.dart │ │ ├── library_tour │ │ │ ├── async │ │ │ │ ├── basic.dart │ │ │ │ ├── future.dart │ │ │ │ ├── stream.dart │ │ │ │ └── stream_web.dart │ │ │ ├── core │ │ │ │ ├── collections.dart │ │ │ │ ├── comparable.dart │ │ │ │ ├── exception.dart │ │ │ │ ├── hash_code.dart │ │ │ │ └── iterator.dart │ │ │ └── io │ │ │ │ └── http_server.dart │ │ ├── pi_monte_carlo.dart │ │ ├── pi_monte_carlo_tooltips.html │ │ ├── samples │ │ │ └── spacecraft.dart │ │ ├── tutorial │ │ │ ├── cat_no_hash.dart │ │ │ ├── daily_news.dart │ │ │ ├── misc.dart │ │ │ ├── stream_interface.dart │ │ │ ├── sum_stream.dart │ │ │ └── sum_stream_with_catch.dart │ │ └── vm_get_started.dart │ ├── pubspec.yaml │ ├── test │ │ ├── effective_dart_test.dart │ │ ├── language_tour │ │ │ ├── async_test.dart │ │ │ ├── basic_test.dart │ │ │ ├── browser_test.dart │ │ │ ├── built_in_types_test.dart │ │ │ ├── callable_classes_test.dart │ │ │ ├── classes_test.dart │ │ │ ├── control_flow_test.dart │ │ │ ├── exceptions_test.dart │ │ │ ├── functions_test.dart │ │ │ ├── generics_test.dart │ │ │ ├── operators_test.dart │ │ │ ├── typedefs_test.dart │ │ │ └── variables_test.dart │ │ ├── library_tour │ │ │ ├── convert_test.dart │ │ │ ├── core_test.dart │ │ │ ├── io_test.dart │ │ │ └── math_test.dart │ │ ├── path │ │ │ └── to │ │ │ │ └── my_other_file.dart │ │ ├── pi_test.dart │ │ ├── samples_test.dart │ │ ├── sanity_test.dart │ │ └── tutorial │ │ │ ├── futures_test.dart │ │ │ └── streams_test.dart │ └── test_data │ │ └── config.txt ├── strong │ ├── analysis_options.yaml │ ├── analyzer-1-results.txt │ ├── analyzer-2-results.txt │ ├── dart_test.yaml │ ├── lib │ │ ├── animal.dart │ │ ├── animal_bad.dart │ │ ├── bounded │ │ │ ├── instantiate_to_bound.dart │ │ │ └── my_collection.dart │ │ ├── common_fixes_analysis.dart │ │ ├── common_problems_analysis.dart │ │ ├── covariant.dart │ │ ├── dart_1_my_list_hello_world.dart │ │ └── strong_analysis.dart │ ├── pubspec.yaml │ └── test │ │ └── strong_test.dart └── util │ ├── analysis_options.yaml │ ├── lib │ ├── dart_version.dart │ ├── ellipsis.dart │ ├── logger.dart │ └── print_matcher.dart │ └── pubspec.yaml ├── examples_archive ├── language_tour │ ├── adjacent-string-literals │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── args │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── arithmetic-operators │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── async-await │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── ballgame │ │ ├── ball.dart │ │ ├── ballgame.dart │ │ └── util.dart │ ├── basic-dart-program │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── bit-shifting │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── callable-function │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── cascade-operator │ │ ├── bin │ │ │ └── main.dart │ │ ├── pubspec.yaml │ │ └── web │ │ │ ├── index.html │ │ │ └── main.dart │ ├── color │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── const-vs-const │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── const │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── continue_example │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── creating-a-variable │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── deferred │ │ ├── bin │ │ │ └── main.dart │ │ ├── lib │ │ │ └── hello.dart │ │ └── pubspec.yaml │ ├── double-literals │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── empty-string │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── enum-switch │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── factory-constructor │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── final-initialization │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── flow-if-else │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── flow-switch-case │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── flow-while │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── flow │ │ ├── README.md │ │ ├── assert_example │ │ │ ├── pubspec.yaml │ │ │ └── web │ │ │ │ └── main.dart │ │ ├── break-continue │ │ │ ├── pubspec.yaml │ │ │ └── web │ │ │ │ └── main.dart │ │ ├── exceptions │ │ │ ├── pubspec.yaml │ │ │ └── web │ │ │ │ └── main.dart │ │ └── for-loops │ │ │ ├── pubspec.yaml │ │ │ └── web │ │ │ └── main.dart │ ├── french-togo │ │ ├── bin │ │ │ └── main.dart │ │ ├── lib │ │ │ ├── src │ │ │ │ └── french.dart │ │ │ └── togo.dart │ │ └── pubspec.yaml │ ├── function-as-parameter │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── function-as-variable │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── function-closure │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── function-equality-2 │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── function-example │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── function-omitting-types │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── function-shorthand │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── generics-base-class │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── generics │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── if-one │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── imposter │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── instance-variables │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── integer-literals │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── libraries │ │ ├── lib1 │ │ │ ├── lib │ │ │ │ └── lib1.dart │ │ │ └── pubspec.yaml │ │ ├── lib2 │ │ │ ├── lib │ │ │ │ └── lib2.dart │ │ │ └── pubspec.yaml │ │ ├── library_partial.dart │ │ ├── library_prefix.dart │ │ ├── mylib │ │ │ ├── lib │ │ │ │ └── mylib.dart │ │ │ └── pubspec.yaml │ │ ├── pubspec.yaml │ │ ├── using_libraries.dart │ │ ├── using_schemes.dart │ │ └── utils │ │ │ ├── lib │ │ │ └── utils.dart │ │ │ └── pubspec.yaml │ ├── list-indexing │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── list-literal │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── list-map-default-function-parameters │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-add-item │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-constructor │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-length │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-missing-key │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-retrieve-item │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── metadata │ │ ├── bin │ │ │ ├── deprecated.dart │ │ │ ├── main.dart │ │ │ ├── override.dart │ │ │ └── todo.dart │ │ └── pubspec.yaml │ ├── method-then-constructor │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── mixins │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── multi-line-comments │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── nested-functions │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── no-such-method │ │ ├── bin │ │ │ ├── alt-to-proxy.dart │ │ │ ├── main.dart │ │ │ └── proxy.dart │ │ └── pubspec.yaml │ ├── number-conversion │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── number-literals │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── numbers-are-objects │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── object-classes │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── op-as │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── op-assign │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── op-bitwise │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── op-equality │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── op-increment-decrement │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── op-logical │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── optional-positional-parameter-default │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── optional-positional-parameters │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── point │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── precedence │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── quoting │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── raw-strings │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── rectangle │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── reference │ │ ├── README │ │ ├── abstract.dart │ │ ├── along_x_axis.dart │ │ ├── constructor_long_way.dart │ │ ├── distance_to.dart │ │ ├── doc_comments.dart │ │ ├── doer.dart │ │ ├── immutable_point.dart │ │ ├── initializer_list.dart │ │ ├── initializer_list_final.dart │ │ ├── map_literal.dart │ │ ├── named_constructor.dart │ │ ├── point_interfaces.dart │ │ ├── rethrow.dart │ │ ├── smart_tv.dart │ │ └── strictly_booleans.dart │ ├── runes │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── single-line-comments │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── sorted-collection │ │ ├── bin │ │ │ ├── main.dart │ │ │ ├── sorted_collection_broken.dart │ │ │ └── sorted_collection_broken_2.dart │ │ └── pubspec.yaml │ ├── specify-default-values │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── specify-named-parameters │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── static-types │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── string-interpolation │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── string-literals │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── symbols │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── triple-quotes │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── use-named-parameters │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── vector │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ └── while-collection │ │ ├── bin │ │ └── main.dart │ │ └── pubspec.yaml ├── library_tour │ ├── async-await │ │ ├── async-await-web │ │ │ ├── pubspec.yaml │ │ │ └── web │ │ │ │ ├── humans.txt │ │ │ │ ├── index.html │ │ │ │ ├── main.dart │ │ │ │ └── styles.css │ │ └── bin │ │ │ └── main.dart │ ├── client-server │ │ ├── bin │ │ │ ├── http_server.dart │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── collection-any-every │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── collection-apply-function │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── collection-is-empty │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── comparable │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── date │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── decode-utf-8 │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── duration │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── encode-uri-components │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── encode-uri │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── encode-utf-8 │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── future-then │ │ ├── pubspec.yaml │ │ └── web │ │ │ ├── index.html │ │ │ ├── main.dart │ │ │ └── styles.css │ ├── futures │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── get-data-from-server │ │ ├── pubspec.yaml │ │ └── web │ │ │ ├── baddata.json │ │ │ ├── data.json │ │ │ ├── data.xml │ │ │ ├── index.html │ │ │ ├── main.dart │ │ │ ├── nodata.json │ │ │ ├── nodata.xml │ │ │ └── styles.css │ ├── iterator │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── json-parse │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── json-stringify │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── list-files │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── list-tests │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-1 │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── map-keys │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── math-tests │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── mirrors │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── number-tests │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── parse-uri │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── port-send-receive │ │ ├── port_receive.dart │ │ └── port_send.dart │ ├── post-data-to-server │ │ ├── pubspec.yaml │ │ └── web │ │ │ ├── index.html │ │ │ ├── main.dart │ │ │ └── styles.css │ ├── read-file │ │ ├── bin │ │ │ ├── binary_read.dart │ │ │ ├── config.txt │ │ │ ├── file_errors.dart │ │ │ ├── read_file.dart │ │ │ └── text_read.dart │ │ └── pubspec.yaml │ ├── reference │ │ ├── exceptions.dart │ │ ├── rootIsolate.dart │ │ └── spawnIsolate.dart │ ├── set-tests │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── string-tests │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ ├── uri-from-components │ │ ├── bin │ │ │ └── main.dart │ │ └── pubspec.yaml │ └── write-file │ │ ├── betterLog.txt │ │ ├── bin │ │ ├── icon.ico │ │ └── main.dart │ │ ├── copyOfIcon.ico │ │ ├── log.txt │ │ └── pubspec.yaml └── site_tests │ ├── README.md │ ├── articles │ ├── broadcast-streams │ │ ├── README.txt │ │ ├── example1.dart │ │ ├── example1b.dart │ │ ├── example2.dart │ │ ├── example3.dart │ │ ├── example4.dart │ │ └── example4.data │ ├── converters-and-codecs │ │ ├── convert.dart │ │ ├── example2.dart │ │ └── example3.dart │ ├── event-loop │ │ ├── eventloop_test1 │ │ │ ├── bin │ │ │ │ └── eventloop_test1.dart │ │ │ └── pubspec.yaml │ │ └── eventloop_test2 │ │ │ ├── bin │ │ │ └── eventloop_test2.dart │ │ │ └── pubspec.yaml │ ├── futures-and-error-handling │ │ └── futures_and_error_handling_test.dart │ ├── json-web-service │ │ ├── json_factory_constructors_test.dart │ │ ├── json_foreach_test.dart │ │ ├── json_getting_data_test.dart │ │ ├── json_http_request_json_object_test.dart │ │ ├── json_http_request_parse.dart │ │ ├── json_jsonp_test.dart │ │ ├── json_parse_test.dart │ │ ├── json_saving_objects_test.dart │ │ ├── json_stringify_test.dart │ │ └── pubspec.yaml │ ├── optional-types │ │ └── optional_types_code_test.dart │ ├── reflection-with-mirrors │ │ └── MyClass.dart │ ├── style-guide │ │ ├── prefer-constructors-bad.dart │ │ └── prefer-constructors-good.dart │ └── zones │ │ ├── bar.txt │ │ ├── debug.dart │ │ ├── ex1.dart │ │ ├── foo.txt │ │ ├── profile_run.dart │ │ ├── run_zoned1.dart │ │ ├── run_zoned2.dart │ │ ├── run_zoned3.dart │ │ ├── specification1.dart │ │ ├── specification2.dart │ │ ├── stream.dart │ │ ├── task_interceptor.dart │ │ ├── value1.dart │ │ ├── value1_1.dart │ │ ├── value2.dart │ │ └── value3.dart │ ├── code │ ├── Switcher.dart │ ├── async.dart │ ├── collections.dart │ ├── die.dart │ ├── htmllib.dart │ ├── pubspec.yaml │ ├── syntax.dart │ ├── testing.dart │ ├── types_no.dart │ └── types_yes.dart │ ├── deferred-loading │ ├── deferred_loading_example │ │ ├── bin │ │ │ └── main.dart │ │ ├── lib │ │ │ └── hello.dart │ │ ├── pubspec.yaml │ │ └── readme.md │ └── lazyloader │ │ ├── lib │ │ ├── breakfast.dart │ │ ├── dinner.dart │ │ └── lunch.dart │ │ ├── pubspec.yaml │ │ ├── readme.md │ │ └── web │ │ ├── index.html │ │ ├── main.dart │ │ └── styles.css │ ├── gists │ ├── README.md │ ├── homepage_jw │ │ ├── pubspec.yaml │ │ └── web │ │ │ └── main.dart │ └── optional_types_article │ │ ├── pubspec.yaml │ │ └── web │ │ └── main.dart │ ├── sanity.rb │ └── tools │ └── observatory │ └── profile │ ├── bin │ └── profile.dart │ └── pubspec.yaml ├── firebase.json ├── package.json ├── pubspec.yaml ├── src ├── 404.html ├── _articles │ ├── archive │ │ ├── converters-and-codecs.md │ │ ├── event-loop.md │ │ ├── images │ │ │ ├── 1.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ ├── 9.png │ │ │ ├── both-queues.png │ │ │ ├── chunked-conversion.png │ │ │ ├── event-loop-and-main.png │ │ │ ├── event-loop-example.png │ │ │ ├── event-loop.png │ │ │ ├── scheduling-tasks.png │ │ │ ├── test-annotated.png │ │ │ ├── test-queue-output.png │ │ │ └── trace.png │ │ ├── index.md │ │ ├── numeric-computation.md │ │ └── zones.md │ ├── index.md │ ├── libraries │ │ ├── code │ │ │ ├── stream_controller.dart │ │ │ └── stream_controller_bad.dart │ │ ├── creating-streams.md │ │ └── dart-io.md │ └── styles.css ├── _assets │ ├── css │ │ ├── README.md │ │ ├── _animations.scss │ │ ├── _books.scss │ │ ├── _bootstrap_adjust.scss │ │ ├── _colors.scss │ │ ├── _dartvm.scss │ │ ├── _dash.scss │ │ ├── _icons.scss │ │ ├── _mixins.scss │ │ ├── _os-tabs.scss │ │ ├── _overwrites.scss │ │ ├── _site_overrides.scss │ │ ├── _variables.scss │ │ └── main.scss │ ├── fonts │ │ ├── dart.eot │ │ ├── dart.svg │ │ ├── dart.ttf │ │ ├── dart.woff │ │ └── dart.woff2 │ ├── image │ │ ├── 404-bg-pattern.jpg │ │ ├── adwords-screenshot.png │ │ ├── bare-bones-todo.png │ │ ├── bare-bones-web-app.png │ │ ├── chrome-devtools-screenshot.png │ │ ├── cover │ │ │ ├── aprende-dart.jpg │ │ │ ├── dart-by-example.png │ │ │ ├── dart-cookbook.jpg │ │ │ ├── dart-essentials-sikora.png │ │ │ ├── dart-for-absolute-beginners.jpg │ │ │ ├── dart-for-hipsters.png │ │ │ ├── dart-in-action.jpg │ │ │ ├── dart-programming-language.jpg │ │ │ ├── dart-up-and-running.gif │ │ │ ├── learning-dart-video.png │ │ │ ├── learning-dart.png │ │ │ ├── mastering-dart.jpg │ │ │ ├── scalable-app-development.png │ │ │ └── web-programming-with-dart.jpg │ │ ├── dartpad-hello.png │ │ ├── ff-debug.png │ │ ├── green-run.png │ │ ├── guides │ │ │ ├── analysis-options-directory-structure.png │ │ │ ├── avoid-empty-statements.png │ │ │ └── close-sinks.png │ │ ├── ic_link_black_24px.svg │ │ ├── libraries │ │ │ ├── import-lib-rules.png │ │ │ ├── shelf.png │ │ │ └── simple-lib2.png │ │ ├── platforms.svg │ │ ├── red-run.png │ │ ├── shared │ │ ├── tools │ │ │ ├── android_studio.png │ │ │ ├── atom-logo.png │ │ │ ├── emacs.png │ │ │ ├── intellij-idea.svg │ │ │ ├── pub │ │ │ │ ├── PubConstraintsDiagram.png │ │ │ │ └── PubExportedConstraints.png │ │ │ ├── vim.png │ │ │ └── vscode.png │ │ ├── touch-icon-ipad-retina.png │ │ ├── touch-icon-ipad.png │ │ ├── touch-icon-iphone-retina.png │ │ └── touch-icon-iphone.png │ └── js │ │ ├── _os-tabs.js │ │ ├── _utilities.js │ │ ├── main.js │ │ └── vendor │ │ ├── code-prettify │ │ ├── lang-css.js │ │ ├── lang-dart.js │ │ ├── lang-yaml.js │ │ ├── prettify.css │ │ └── prettify.js │ │ └── jquery-3.3.1.js ├── _data │ ├── books.yml │ ├── docs_cards.yml │ ├── episodes.yml │ ├── pkg-vers.json │ └── side-nav.yml ├── _guides │ ├── diagnostics.md │ ├── index.md │ ├── json.md │ ├── language │ │ ├── analysis-options.md │ │ ├── cheatsheet.md │ │ ├── effective-dart │ │ │ ├── design.md │ │ │ ├── documentation.md │ │ │ ├── index.md │ │ │ ├── style.md │ │ │ ├── toc.md │ │ │ └── usage.md │ │ ├── formatting.md │ │ ├── images │ │ │ ├── consumer-producer-methods.png │ │ │ ├── type-hierarchy-generics.png │ │ │ └── type-hierarchy.png │ │ ├── index.md │ │ ├── language-tour.md │ │ ├── sound-dart.md │ │ ├── sound-problems.md │ │ ├── spec.md │ │ └── specifications │ │ │ └── DartLangSpec-v2.2.pdf │ ├── libraries │ │ ├── create-library-packages.md │ │ ├── futures-error-handling.md │ │ ├── images │ │ │ └── then_and_catcherror.png │ │ ├── index.md │ │ ├── library-tour.md │ │ ├── private-files.md │ │ └── useful-libraries.md │ ├── packages.md │ └── testing.md ├── _includes │ ├── _version-menu-items.html │ ├── analytics.html │ ├── article_index_warning.md │ ├── article_summary.html │ ├── async-await-2.0.md │ ├── author.html │ ├── banner.html │ ├── capture_output.html │ ├── dart-html-tour.md │ ├── dart-io-tour.md │ ├── dartpad.html │ ├── flutter-packages.md │ ├── get-sdk.md │ ├── head.html │ ├── linter-rule.html │ ├── navigation-main.html │ ├── navigation-side.html │ ├── navigation-sub.html │ ├── navigation-toc.html │ ├── packages-dir.html │ ├── page-footer.html │ ├── page-header.html │ ├── pub-in-prereleases.html │ ├── server-tutorials.md │ ├── shared │ ├── tools │ │ ├── jetbrains-reporting-issues.html │ │ └── pub-was-a-builder.md │ ├── tutorial-banner.html │ └── web-tutorials.md ├── _layouts │ ├── default.html │ ├── error.html │ ├── homepage.html │ └── tutorial.html ├── _main-example.html ├── _plugins │ ├── asset_bundler.rb │ ├── breadcrumb.rb │ ├── code_sample.rb │ ├── date_to_rfc2822.rb │ ├── format_num_filter.rb │ ├── inject_data_tag.rb │ ├── insert_tag.rb │ ├── jekyll-pages-directory.rb │ ├── load-bootstrap-sass.rb │ ├── nav_link_tag.rb │ ├── prettify.rb │ ├── regex_replace_filter.rb │ ├── render.rb │ ├── sidenav-active-entry-filter.rb │ ├── strip_html_filter.rb │ ├── svg_mime_type.rb │ └── symlinked_sources_listener.rb ├── _shared ├── _tutorials │ ├── README.md │ ├── images │ │ ├── async-await.png │ │ ├── futures-code.png │ │ ├── housekeeping-files.png │ │ ├── libraries-folder.png │ │ ├── other-folders.png │ │ ├── run.png │ │ ├── streams-code.png │ │ ├── target.png │ │ └── tute-home.png │ ├── index.md │ ├── language │ │ ├── futures.md │ │ ├── index.md │ │ └── streams.md │ ├── libraries │ │ ├── index.md │ │ └── shared-pkgs.md │ ├── server │ │ ├── cmdline.md │ │ ├── get-started.md │ │ ├── httpserver.md │ │ ├── images │ │ │ ├── commandlineargs.png │ │ │ ├── dartvm-cmd-line.png │ │ │ ├── flowchart.png │ │ │ ├── function-parts.png │ │ │ ├── guessing.png │ │ │ ├── hello_world_response.png │ │ │ ├── index_file.png │ │ │ ├── index_file_4046.png │ │ │ ├── pub-directory-structure.png │ │ │ └── signature-parts.png │ │ └── index.md │ └── web │ │ ├── fetch-data.md │ │ ├── get-started.md │ │ ├── images │ │ ├── 0-mini-code-walk-through.png │ │ ├── add-element-code.png │ │ ├── add-element.png │ │ ├── anagram-move.png │ │ ├── anagram-newletters.png │ │ ├── child-references.png │ │ ├── client-server.png │ │ ├── css-code.png │ │ ├── css-property-value.png │ │ ├── css-rule-explained.png │ │ ├── dart-html-connect-full.png │ │ ├── dart-html-connect.png │ │ ├── dynamic-dart.png │ │ ├── event-handler-idiom.png │ │ ├── event-handler-todo.png │ │ ├── event-listener-exp.png │ │ ├── jsonstring.png │ │ ├── paragraph-dom.png │ │ ├── parent-reference.png │ │ ├── portmanteaux-code.png │ │ ├── relationships.png │ │ ├── remove-all-code.png │ │ ├── remove-all-elements.png │ │ ├── remove-element-code.png │ │ ├── remove-element.png │ │ ├── run.png │ │ ├── set-callback.png │ │ ├── simple-dom-tree.png │ │ ├── simple-html.png │ │ ├── todo-dart.png │ │ ├── todo-dom.png │ │ ├── todo-html.png │ │ └── uri-details.png │ │ ├── index.md │ │ └── low-level-html │ │ ├── add-elements.md │ │ ├── connect-dart-html.md │ │ ├── index.md │ │ └── remove-elements.md ├── assets │ ├── dash │ │ ├── 1x │ │ │ ├── 1-1 async await-80.jpg │ │ │ ├── 1-2 language optimized-80.jpg │ │ │ ├── 1-3 familiar syntax-80.jpg │ │ │ ├── 2-1 hot reload iterative changes-80.jpg │ │ │ ├── 2-2 flexible type-80.jpg │ │ │ ├── 2-3 runtime insights-80.jpg │ │ │ ├── 3-1 - aot compile-80.jpg │ │ │ ├── 3-2 target web-80.jpg │ │ │ ├── 3-3 backend code-80.jpg │ │ │ ├── bg-pattern.jpg │ │ │ ├── client optimised light op1.png │ │ │ ├── icon_pub dev.png │ │ │ ├── icon_pub dev.svg │ │ │ ├── logo_dart packages.png │ │ │ ├── logo_dart packages.svg │ │ │ ├── logo_lockup_dart_horizontal_wht.png │ │ │ ├── made by google.png │ │ │ ├── multiplatform performance light op1.png │ │ │ ├── productive dev light op1.png │ │ │ └── slideover menu_45px example.png │ │ ├── 2x │ │ │ ├── 1-1 async await@2x-80.jpg │ │ │ ├── 1-2 language optimized@2x-80.jpg │ │ │ ├── 1-3 familiar syntax@2x-80.jpg │ │ │ ├── 2-1 hot reload iterative changes@2x-80.jpg │ │ │ ├── 2-2 flexible type@2x-80.jpg │ │ │ ├── 2-3 runtime insights@2x-80.jpg │ │ │ ├── 3-1 - aot compile@2x-80.jpg │ │ │ ├── 3-2 target web@2x-80.jpg │ │ │ ├── 3-3 backend code@2x-80.jpg │ │ │ ├── bullet-black.png │ │ │ ├── bullet.png │ │ │ ├── client optimised light op1@2x.png │ │ │ ├── icon_pub dev@2x.png │ │ │ ├── logo_dart packages@2x.png │ │ │ ├── logo_lockup_dart_horizontal_wht@2x.png │ │ │ ├── made by google@2x.png │ │ │ ├── multiplatform performance light op1@2x.png │ │ │ ├── paint-your-ui.png │ │ │ └── productive dev light op1@2x.png │ │ └── video │ │ │ ├── hotreload.mp4 │ │ │ └── hotreload.webm │ └── shared ├── brand.md ├── code-of-conduct.md ├── codelabs │ ├── dart-cheatsheet │ │ └── index.md │ ├── images │ │ └── from-java-to-dart.png │ └── index.md ├── community │ └── index.md ├── dart-2.md ├── diagrams │ ├── articles │ │ ├── converters-and-codecs │ │ │ └── chunked-conversion.graffle │ │ │ │ ├── data.plist │ │ │ │ └── image1.png │ │ ├── event-loop │ │ │ └── event-loop.graffle │ │ │ │ ├── data.plist │ │ │ │ └── image4.tiff │ │ ├── numeric-computation │ │ │ ├── boxunbox.graffle │ │ │ ├── doubleobjectarray.graffle │ │ │ ├── doubletypedarray.graffle │ │ │ ├── entity object 2.graffle │ │ │ ├── entity object 3.graffle │ │ │ ├── entity object.graffle │ │ │ ├── mintloadaddstore.graffle │ │ │ ├── objectarrayload.graffle │ │ │ ├── objectarraystore.graffle │ │ │ ├── smiloadmulstore.graffle │ │ │ ├── typedarrayload.graffle │ │ │ └── typedarraystore.graffle │ │ ├── simd │ │ │ ├── float32x4.graffle │ │ │ ├── float32x4_addition.graffle │ │ │ ├── non_uniform.graffle │ │ │ ├── performance_gain.graffle │ │ │ ├── select_logic.graffle │ │ │ ├── slow_zone.graffle │ │ │ └── uniform.graffle │ │ └── zones │ │ │ └── zones.graffle │ ├── guides │ │ ├── analysis-options-directory-structure.graffle │ │ └── type-hierarchy.graffle │ ├── tools │ │ ├── MobileDeployment.graffle │ │ │ ├── data.plist │ │ │ ├── image1.tiff │ │ │ ├── image10.pdf │ │ │ ├── image12.pdf │ │ │ ├── image6.tiff │ │ │ └── image9.pdf │ │ ├── PubConstraintsDiagram.graffle │ │ ├── PubExportedConstraints.graffle │ │ ├── directory-structure.graffle │ │ └── import-lib-rules.graffle │ └── tutorials │ │ ├── OmniGraffle.cheatsheet │ │ ├── README.md │ │ ├── cmdline │ │ └── commandlineargs.graffle │ │ ├── futures │ │ ├── async-await.graffle │ │ └── eventloop.graffle │ │ ├── get-started │ │ ├── dart-editor-ui.graffle │ │ │ ├── data.plist │ │ │ └── image4.tiff │ │ ├── dartvm-js.graffle │ │ │ ├── data.plist │ │ │ └── image1.png │ │ ├── dartvm.graffle │ │ ├── directory-structure.graffle │ │ └── function-parts.graffle │ │ ├── home-page │ │ ├── cmdline-code.graffle │ │ ├── futures-code.graffle │ │ ├── httpserver-code.graffle │ │ └── streams-code.graffle │ │ ├── httpserver │ │ ├── flowchart.graffle │ │ └── helloworldserver.graffle │ │ ├── newbanner.graffle │ │ ├── data.plist │ │ └── image10.png │ │ ├── shared-pkgs │ │ └── package-files.graffle │ │ │ ├── data.plist │ │ │ └── image1.png │ │ ├── streams │ │ └── code-for-index-page.graffle │ │ └── top-level-banner.graffle │ │ ├── data.plist │ │ └── image3.png ├── f │ ├── README │ ├── dailyNewsDigest.txt │ ├── jabberwocky.txt │ ├── piratenames.json │ └── portmanteaux.json ├── faq.md ├── get-dart.md ├── index.html ├── map.html ├── mobile.md ├── platforms.md ├── resources │ ├── books.md │ └── index.md ├── robots.txt ├── samples │ └── index.md ├── search-all.html ├── search.html ├── security.md ├── server │ ├── c-interop-native-extensions.md │ ├── c-interop.md │ ├── index.md │ └── libraries.md ├── sitemap.xml ├── terms.md ├── tools │ ├── build_runner.md │ ├── dart-devtools.md │ ├── dart-vm.md │ ├── dart2aot.md │ ├── dart2js.md │ ├── dartanalyzer.md │ ├── dartdevc │ │ ├── faq.md │ │ └── index.md │ ├── dartdoc.md │ ├── dartfmt.md │ ├── dartpad │ │ ├── index.md │ │ └── privacy.md │ ├── index.md │ ├── jetbrains-plugin.md │ ├── pub │ │ ├── cmd │ │ │ ├── index.md │ │ │ ├── pub-cache.md │ │ │ ├── pub-deps.md │ │ │ ├── pub-downgrade.md │ │ │ ├── pub-get.md │ │ │ ├── pub-global.md │ │ │ ├── pub-lish.md │ │ │ ├── pub-run.md │ │ │ ├── pub-upgrade.md │ │ │ └── pub-uploader.md │ │ ├── dependencies.md │ │ ├── environment-variables.md │ │ ├── glossary.md │ │ ├── index.md │ │ ├── obsolete.md │ │ ├── package-layout.md │ │ ├── publishing.md │ │ ├── pubspec.md │ │ ├── troubleshoot.md │ │ └── versioning.md │ ├── sdk │ ├── vs-code.md │ └── webdev.md └── web │ ├── dart-2.md │ ├── debugging.md │ ├── deployment.md │ ├── index.md │ ├── js-interop.md │ └── libraries.md └── tool ├── analyze-and-test-examples.sh ├── before-install.sh ├── check-code.sh ├── config └── linkcheck-skip-list.txt ├── convert_book.dart ├── create_site_main_example.dart ├── dartfmt.sh ├── env-info-and-check.sh ├── env-set.sh ├── frontpage_only_config.yml ├── install.sh ├── pre-push.sh ├── pubspec.yaml ├── refresh-code-excerpts.sh ├── serve.sh ├── shared └── youtube.dart /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "dart-dev", 4 | "dev": "dartlang-org-dev", 5 | "staging-0": "dartlang-org-staging-0", 6 | "staging-1": "dartlang-org-staging-1", 7 | "jt": "jt-dartdev-1", 8 | "kw": "kw-www-dartlang-1", 9 | "kw2": "kw-staging-dartlang-2", 10 | "sz" : "sz-www-1", 11 | "sz2" : "sz-www-2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "site-shared"] 2 | path = site-shared 3 | url = https://github.com/dart-lang/site-shared.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Below is a list of people and organizations that have contributed 2 | # to the Dart www site. Names should be added to the list like so: 3 | # 4 | # Name/Organization 5 | 6 | Google Inc. 7 | 8 | Matthew Butler 9 | Chris Buckett 10 | Michael Haubenwallner 11 | Victor Berchet 12 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | gem 'bootstrap' 3 | gem 'font-awesome-sass' 4 | gem 'html-proofer' 5 | gem 'jekyll' 6 | gem 'jekyll-assets', group: :jekyll_plugins 7 | gem 'jekyll-toc' 8 | gem 'liquid-tag-parser' 9 | gem 'nokogiri' 10 | gem 'sass' 11 | gem 'sprockets', '~> 4.0.beta' , { require: false } 12 | gem 'uglifier' 13 | -------------------------------------------------------------------------------- /_config_dev.yml: -------------------------------------------------------------------------------- 1 | # Site settings for development mode 2 | url: https://dartlang-org-dev.firebaseapp.com 3 | # url: https://dartlang-org-staging-0.firebaseapp.com 4 | # url: http://localhost:4000 5 | 6 | # webdev: "http://localhost:4001" 7 | # webdev: "https://webdev-dartlang-org.firebaseapp.com" 8 | -------------------------------------------------------------------------------- /_config_now.yml: -------------------------------------------------------------------------------- 1 | # Fixed time stamp (useful when comparing generated site versions) 2 | now: 2018-07-01 12:34:56 3 | 4 | assets: 5 | digest: false 6 | source_maps: true 7 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | exclude: [_site, examples_archive, site-shared, src, tmp] 3 | -------------------------------------------------------------------------------- /build.excerpt.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | sources: 4 | include: [examples/**] 5 | exclude: 6 | - '**/.*/**' 7 | - '**/build/**' 8 | builders: 9 | code_excerpter|code_excerpter: 10 | enabled: true 11 | -------------------------------------------------------------------------------- /deploy/check_url.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | response=$(curl -s -L -D - $1 -o /dev/null); 4 | if [[ $response =~ "HTTP/1.1 404 Not Found" ]]; then 5 | echo "" 6 | echo "NOT FOUND: $1" 7 | echo "" 8 | exit 1 9 | else 10 | echo -n "." 11 | exit 0 12 | fi -------------------------------------------------------------------------------- /deploy/cibuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e # halt script on error 3 | 4 | bundle exec jekyll build --incremental 5 | # bundle exec htmlproofer ./_site --assume-extension --directory-index-file 6 | -------------------------------------------------------------------------------- /deploy/effective-dart-rules/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .packages 3 | .pub/ 4 | packages 5 | pubspec.lock # (Remove this pattern if you wish to check in your lock file) 6 | -------------------------------------------------------------------------------- /deploy/effective-dart-rules/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: effective_dart_rules 2 | version: 0.0.2 3 | description: Builds a file with all the rules in the different sections of Effective Dart. 4 | dependencies: 5 | html_unescape: ^1.0.0 6 | markdown: ^2.0.0 7 | path: ^1.6.0 8 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .packages 3 | .pub/ 4 | build/ 5 | # Remove the following pattern if you wish to check in your lock file 6 | pubspec.lock 7 | 8 | # Directory created by dartdoc 9 | doc/api/ 10 | -------------------------------------------------------------------------------- /examples/dart_test.yaml: -------------------------------------------------------------------------------- 1 | # Chrome option required because Travis is't running under sudo 2 | # https://docs.travis-ci.com/user/chrome#Sandboxing 3 | define_platforms: 4 | travischrome: 5 | name: Chrome for Travis w/o sudo 6 | extends: chrome 7 | settings: 8 | arguments: --no-sandbox 9 | -------------------------------------------------------------------------------- /examples/httpserver/.gitignore: -------------------------------------------------------------------------------- 1 | file.txt 2 | -------------------------------------------------------------------------------- /examples/httpserver/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /examples/httpserver/bin/notes.txt: -------------------------------------------------------------------------------- 1 | Be yourself. Everyone else is taken. 2 | Don't cry because it's over, smile because it happened. 3 | A person's a person, no matter how small. 4 | Enjoy all your meals. 5 | Sing. Dance. Play. 6 | -------------------------------------------------------------------------------- /examples/httpserver/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: httpserver 2 | description: Sample HTTP clients and servers 3 | homepage: https://www.dartlang.org/docs/tutorials/httpserver/ 4 | 5 | environment: 6 | sdk: '>=2.3.1 <3.0.0' 7 | 8 | dependencies: 9 | http_server: ^0.9.6 10 | 11 | dev_dependencies: 12 | test: ^1.0.0 13 | pedantic: ^1.0.0 14 | -------------------------------------------------------------------------------- /examples/misc/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /examples/misc/analyzer-1-results.txt: -------------------------------------------------------------------------------- 1 | Analyzing lib, test... 2 | error • A value of type 'dynamic' can't be assigned to a variable of type 'Person' at lib/library_tour/core/hash_code.dart:25:21 • invalid_assignment 3 | 1 error found. 4 | -------------------------------------------------------------------------------- /examples/misc/dart_test.yaml: -------------------------------------------------------------------------------- 1 | ../dart_test.yaml -------------------------------------------------------------------------------- /examples/misc/lib/articles/creating-streams/someFile.txt: -------------------------------------------------------------------------------- 1 | lines 2 | go 3 | here with some text -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_file_system_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:convert'; 3 | import 'dart:io'; 4 | 5 | Future main() async { 6 | var file = File(Platform.script.toFilePath()); 7 | print("${await (file.readAsString(encoding: ascii))}"); 8 | } 9 | -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_http_server_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | final server = await HttpServer.bind('127.0.0.1', 8082); 6 | await for (HttpRequest request in server) { 7 | request.response.write('Hello, world'); 8 | await request.response.close(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_process_stdio_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | final output = File('output.txt').openWrite(); 6 | Process process = await Process.start('ls', ['-l']); 7 | 8 | // Wait for the process to finish; get the exit code. 9 | final exitCode = (await Future.wait([ 10 | process.stdout.pipe(output), // Send stdout to file. 11 | process.stderr.drain(), // Discard stderr. 12 | process.exitCode 13 | ]))[2]; 14 | 15 | print('exit code: $exitCode'); 16 | } 17 | -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_process_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | // List all files in the current directory, 6 | // in UNIX-like operating systems. 7 | ProcessResult results = await Process.run('ls', ['-l']); 8 | print(results.stdout); 9 | } 10 | -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_process_transform_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:convert'; 3 | import 'dart:io'; 4 | 5 | Future main() async { 6 | final process = await Process.start('ls', ['-l']); 7 | var lineStream = 8 | process.stdout.transform(Utf8Decoder()).transform(LineSplitter()); 9 | await for (var line in lineStream) { 10 | print(line); 11 | } 12 | 13 | await process.stderr.drain(); 14 | print('exit code: ${await process.exitCode}'); 15 | } 16 | -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_stream_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | var result = []; 6 | 7 | Stream> stream = File(Platform.script.toFilePath()).openRead(); 8 | final semicolon = ';'.codeUnitAt(0); 9 | 10 | await for (var data in stream) { 11 | for (int i = 0; i < data.length; i++) { 12 | result.add(data[i]); 13 | if (data[i] == semicolon) { 14 | print(String.fromCharCodes(result)); 15 | return; 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/misc/lib/articles/io/io_timer_test.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | import 'dart:async'; 3 | 4 | void main() { 5 | Timer(Duration(seconds: 1), () => print('timer')); 6 | print('end of main'); 7 | } 8 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/bar/bar.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/foo.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/foo/SliderMenu.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/foo/file_system.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/foo/foo.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/foo/slider_menu.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/my_library.dart: -------------------------------------------------------------------------------- 1 | library my_library; 2 | 3 | part "some/other/file.dart"; 4 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/some/other/file.dart: -------------------------------------------------------------------------------- 1 | part of "../../my_library.dart"; 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/some/other/file_2.dart: -------------------------------------------------------------------------------- 1 | part of my_library; 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/src/error.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/src/foo_bar.dart: -------------------------------------------------------------------------------- 1 | // Purposefully empty. Used only to illustrate imports. 2 | -------------------------------------------------------------------------------- /examples/misc/lib/effective_dart/style_lib_bad.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_import 2 | // #docregion export 3 | import 'src/error.dart'; 4 | export 'src/error.dart'; 5 | import 'src/foo_bar.dart'; 6 | // #enddocregion export 7 | 8 | //---------------------------------------------------------------------------- 9 | 10 | // #docregion sorted 11 | import 'package:examples/effective_dart/foo/foo.dart'; 12 | import 'package:examples/effective_dart/bar/bar.dart'; 13 | 14 | import 'foo/foo.dart'; 15 | import 'foo.dart'; 16 | // #enddocregion sorted 17 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/callable_classes.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: type_annotate_public_apis 2 | // #docregion 3 | class WannabeFunction { 4 | String call(String a, String b, String c) => '$a $b $c!'; 5 | } 6 | 7 | var wf = WannabeFunction(); 8 | var out = wf('Hi', 'there,', 'gang'); 9 | 10 | main() => print(out); 11 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/doer.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: one_member_abstracts, annotate_overrides 2 | // #docregion 3 | abstract class Doer { 4 | // Define instance variables and methods... 5 | 6 | void doSomething(); // Define an abstract method. 7 | } 8 | 9 | class EffectiveDoer extends Doer { 10 | void doSomething() { 11 | // Provide an implementation, so the method is not abstract here... 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/immutable_point.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | class ImmutablePoint { 3 | static final ImmutablePoint origin = 4 | const ImmutablePoint(0, 0); 5 | 6 | final num x, y; 7 | 8 | const ImmutablePoint(this.x, this.y); 9 | } 10 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/no_such_method.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | dynamic a = A(); 3 | a.foo(); 4 | } 5 | 6 | // #docregion 7 | class A { 8 | // Unless you override noSuchMethod, using a 9 | // non-existent member results in a NoSuchMethodError. 10 | @override 11 | void noSuchMethod(Invocation invocation) { 12 | print('You tried to use a non-existent member: ' + 13 | '${invocation.memberName}'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/point_redirecting.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | class Point { 3 | num x, y; 4 | 5 | // The main constructor for this class. 6 | Point(this.x, this.y); 7 | 8 | // Delegates to the main constructor. 9 | Point.alongXAxis(num x) : this(x, 0); 10 | } 11 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/point_with_distance_field.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | import 'dart:math'; 3 | 4 | class Point { 5 | final num x; 6 | final num y; 7 | final num distanceFromOrigin; 8 | 9 | Point(num x, num y) 10 | : x = x, 11 | y = y, 12 | distanceFromOrigin = sqrt(x * x + y * y); 13 | } 14 | 15 | void main() { 16 | var p = Point(2, 3); 17 | print(p.distanceFromOrigin); 18 | } 19 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/point_with_distance_method.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | import 'dart:math'; 3 | 4 | class Point { 5 | num x, y; 6 | Point(this.x, this.y); 7 | 8 | static num distanceBetween(Point a, Point b) { 9 | var dx = a.x - b.x; 10 | var dy = a.y - b.y; 11 | return sqrt(dx * dx + dy * dy); 12 | } 13 | } 14 | 15 | void main() { 16 | var a = Point(2, 2); 17 | var b = Point(4, 4); 18 | var distance = Point.distanceBetween(a, b); 19 | assert(2.8 < distance && distance < 2.9); 20 | print(distance); 21 | } 22 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/classes/point_with_main.dart: -------------------------------------------------------------------------------- 1 | // #docregion class, class-main 2 | class Point { 3 | num x; // Declare instance variable x, initially null. 4 | num y; // Declare y, initially null. 5 | // #enddocregion class-main 6 | num z = 0; // Declare z, initially 0. 7 | // #docregion class-main 8 | } 9 | // #enddocregion class 10 | 11 | void main() { 12 | var point = Point(); 13 | point.x = 4; // Use the setter method for x. 14 | assert(point.x == 4); // Use the getter method for x. 15 | assert(point.y == null); // Values default to null. 16 | } 17 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/generics/base_class.dart: -------------------------------------------------------------------------------- 1 | class SomeBaseClass {} 2 | 3 | // #docregion 4 | class Foo { 5 | // Implementation goes here... 6 | String toString() => "Instance of 'Foo<$T>'"; // ignore: annotate_overrides 7 | } 8 | 9 | class Extender extends SomeBaseClass {/*...*/} 10 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/generics/cache.dart: -------------------------------------------------------------------------------- 1 | // #docregion ObjectCache 2 | abstract class ObjectCache { 3 | Object getByKey(String key); 4 | void setByKey(String key, Object value); 5 | } 6 | // #enddocregion ObjectCache 7 | 8 | // #docregion StringCache 9 | abstract class StringCache { 10 | String getByKey(String key); 11 | void setByKey(String key, String value); 12 | } 13 | // #enddocregion StringCache 14 | 15 | // #docregion Cache 16 | abstract class Cache { 17 | T getByKey(String key); 18 | void setByKey(String key, T value); 19 | } 20 | // #enddocregion Cache 21 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/libraries/greeter.dart: -------------------------------------------------------------------------------- 1 | // #docregion import 2 | import 'hello.dart' deferred as hello; 3 | // #enddocregion import 4 | 5 | // #docregion loadLibrary 6 | Future greet() async { 7 | await hello.loadLibrary(); 8 | hello.printGreeting(); 9 | } 10 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/libraries/hello.dart: -------------------------------------------------------------------------------- 1 | void printGreeting() {} 2 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/libraries/import_as.dart: -------------------------------------------------------------------------------- 1 | import 'lib1.dart'; 2 | import 'lib2.dart' as lib2; 3 | 4 | // Uses Element from lib1. 5 | Element element1 = Element(); 6 | 7 | // Uses Element from lib2. 8 | lib2.Element element2 = lib2.Element(); 9 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/libraries/lib1.dart: -------------------------------------------------------------------------------- 1 | void foo() {} 2 | 3 | class Element {} 4 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/libraries/lib2.dart: -------------------------------------------------------------------------------- 1 | void foo() {} 2 | 3 | class Element {} 4 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/libraries/show_hide.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | // Import only foo. 3 | import 'lib1.dart' show foo; 4 | 5 | // Import all names EXCEPT foo. 6 | import 'lib2.dart' hide foo; 7 | // #enddocregion 8 | 9 | Element e = Element(); 10 | dynamic bar = foo; 11 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/metadata/misc.dart: -------------------------------------------------------------------------------- 1 | import 'todo.dart'; 2 | 3 | @Todo('seth', 'make this do something') 4 | void doSomething() { 5 | print('do something'); 6 | } 7 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/metadata/television.dart: -------------------------------------------------------------------------------- 1 | // #docregion deprecated 2 | class Television { 3 | /// _Deprecated: Use [turnOn] instead._ 4 | @deprecated 5 | void activate() { 6 | turnOn(); 7 | } 8 | 9 | /// Turns the TV's power on. 10 | void turnOn() {/*...*/} 11 | } 12 | // #enddocregion deprecated 13 | 14 | // #docregion override 15 | class SmartTelevision extends Television { 16 | @override 17 | void turnOn() {/*...*/} 18 | // #enddocregion override 19 | // #docregion override 20 | } 21 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/metadata/todo.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | library todo; 3 | 4 | class Todo { 5 | final String who; 6 | final String what; 7 | 8 | const Todo(this.who, this.what); 9 | } 10 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/typedefs/misc.dart: -------------------------------------------------------------------------------- 1 | // #docregion Function 2 | typedef F = List Function(T); 3 | // #enddocregion Function 4 | 5 | // #docregion compare 6 | typedef Compare = int Function(T a, T b); 7 | 8 | int sort(int a, int b) => a - b; 9 | 10 | void main() { 11 | assert(sort is Compare); // True! 12 | } 13 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/typedefs/sorted_collection_1.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | class SortedCollection { 3 | Function compare; 4 | 5 | SortedCollection(int f(Object a, Object b)) { 6 | compare = f; 7 | } 8 | } 9 | 10 | // Initial, broken implementation. 11 | int sort(Object a, Object b) => 0; 12 | 13 | void main() { 14 | SortedCollection coll = SortedCollection(sort); 15 | 16 | // All we know is that compare is a function, 17 | // but what type of function? 18 | assert(coll.compare is Function); 19 | } 20 | -------------------------------------------------------------------------------- /examples/misc/lib/language_tour/typedefs/sorted_collection_2.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | typedef Compare = int Function(Object a, Object b); 3 | 4 | class SortedCollection { 5 | Compare compare; 6 | 7 | SortedCollection(this.compare); 8 | } 9 | 10 | // Initial, broken implementation. 11 | int sort(Object a, Object b) => 0; 12 | 13 | void main() { 14 | SortedCollection coll = SortedCollection(sort); 15 | assert(coll.compare is Function); 16 | assert(coll.compare is Compare); 17 | } 18 | -------------------------------------------------------------------------------- /examples/misc/lib/library_tour/async/basic.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | 3 | void miscDeclAnalyzedButNotTested() { 4 | final url = 'humans.txt'; 5 | 6 | { 7 | // #docregion then 8 | HttpRequest.getString(url).then((String result) { 9 | print(result); 10 | }); 11 | // #enddocregion then 12 | } 13 | 14 | { 15 | // #docregion catchError 16 | HttpRequest.getString(url).then((String result) { 17 | print(result); 18 | }).catchError((e) { 19 | // Handle or ignore the error. 20 | }); 21 | // #enddocregion catchError 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/misc/lib/library_tour/async/stream_web.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | 3 | void miscDeclAnalyzedButNotTested() { 4 | { 5 | void submitData() {} 6 | // #docregion listen 7 | // Find a button by ID and add an event handler. 8 | querySelector('#submitInfo').onClick.listen((e) { 9 | // When the button is clicked, it runs this code. 10 | submitData(); 11 | }); 12 | // #enddocregion listen 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/misc/lib/library_tour/core/collections.dart: -------------------------------------------------------------------------------- 1 | void miscDeclAnalyzedButNotTested() { 2 | var fruits = List(); 3 | // ignore_for_file: 2, argument_type_not_assignable 4 | // #docregion List-of-String 5 | fruits.add(5); // Error: 'int' can't be assigned to 'String' 6 | // #enddocregion List-of-String 7 | } 8 | -------------------------------------------------------------------------------- /examples/misc/lib/library_tour/core/comparable.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | class Line implements Comparable { 3 | final int length; 4 | const Line(this.length); 5 | 6 | @override 7 | int compareTo(Line other) => length - other.length; 8 | } 9 | 10 | void main() { 11 | var short = const Line(1); 12 | var long = const Line(100); 13 | assert(short.compareTo(long) < 0); 14 | } 15 | -------------------------------------------------------------------------------- /examples/misc/lib/library_tour/core/exception.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | class FooException implements Exception { 3 | final String msg; 4 | 5 | const FooException([this.msg]); 6 | 7 | @override 8 | String toString() => msg ?? 'FooException'; 9 | } 10 | -------------------------------------------------------------------------------- /examples/misc/lib/tutorial/cat_no_hash.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | Future main(List args) async { 5 | var file = File(args[0]); 6 | var lines = file 7 | .openRead() 8 | .transform(utf8.decoder) //!
9 | .transform(LineSplitter()); 10 | await for (var line in lines) { 11 | if (!line.startsWith('#')) print(line); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/misc/lib/vm_get_started.dart: -------------------------------------------------------------------------------- 1 | double milesToKM(double miles) => miles / 0.62; 2 | -------------------------------------------------------------------------------- /examples/misc/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: examples 2 | description: dartlang.org example code. 3 | 4 | environment: 5 | sdk: '>=2.3.1 <3.0.0' 6 | 7 | dev_dependencies: 8 | test: ^1.0.0 9 | pedantic: ^1.0.0 10 | dartlang_examples_util: 11 | path: ../util 12 | -------------------------------------------------------------------------------- /examples/misc/test/language_tour/callable_classes_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | import 'package:examples/language_tour/callable_classes.dart' 3 | as callable_classes; 4 | 5 | void main() { 6 | test('sorted_collection_1', () { 7 | expect(callable_classes.out, 'Hi there, gang!'); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /examples/misc/test/language_tour/variables_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | 3 | void main() { 4 | test('var-null-init', () { 5 | // #docregion var-null-init 6 | int lineCount; 7 | assert(lineCount == null); 8 | // #enddocregion var-null-init 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /examples/misc/test/path/to/my_other_file.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/misc/test/sanity_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | 3 | void main() { 4 | test('assert() checks are enabled', () { 5 | try { 6 | assert(false); 7 | } on AssertionError { 8 | return; 9 | } 10 | fail('assert() checks are disabled'); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /examples/misc/test/tutorial/streams_test.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: type_annotate_public_apis 2 | import 'package:test/test.dart'; 3 | import 'package:examples/tutorial/sum_stream.dart' as sum_stream; 4 | import 'package:examples/tutorial/sum_stream_with_catch.dart' 5 | as sum_stream_with_catch; 6 | 7 | void main() { 8 | test('sumStream', () => expect(sum_stream.main, prints('55\n'))); 9 | test('sumStream with catch', 10 | () => expect(sum_stream_with_catch.main, prints('-1\n'))); 11 | } 12 | -------------------------------------------------------------------------------- /examples/misc/test_data/config.txt: -------------------------------------------------------------------------------- 1 | Llamas 2 | Dromedaries 3 | Oases in the Desert 4 | And other oddities 5 | -------------------------------------------------------------------------------- /examples/strong/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /examples/strong/dart_test.yaml: -------------------------------------------------------------------------------- 1 | ../dart_test.yaml -------------------------------------------------------------------------------- /examples/strong/lib/bounded/instantiate_to_bound.dart: -------------------------------------------------------------------------------- 1 | import 'my_collection.dart'; 2 | 3 | void cannotRunThis() { 4 | // #docregion undefined_method 5 | var c = C(Iterable.empty()).collection; 6 | // ignore_for_file: 2, undefined_method 7 | c.add(2); //!analysis-issue 8 | // #enddocregion undefined_method 9 | } 10 | -------------------------------------------------------------------------------- /examples/strong/lib/bounded/my_collection.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: sort_constructors_first 2 | class C { 3 | final T collection; 4 | C(this.collection); 5 | } 6 | -------------------------------------------------------------------------------- /examples/strong/lib/covariant.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | class Animal { 3 | void chase(Animal x) {/* ... */} 4 | } 5 | 6 | class Mouse extends Animal {/* ... */} 7 | 8 | class Cat extends Animal { 9 | void chase(covariant Mouse x) {/* ... */} 10 | } 11 | -------------------------------------------------------------------------------- /examples/strong/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dartlang_strong 2 | description: dartlang.org strong mode examples 3 | 4 | environment: 5 | sdk: '>=2.3.1 <3.0.0' 6 | 7 | dependencies: 8 | test: ^1.0.0 9 | pedantic: ^1.0.0 10 | dartlang_examples_util: 11 | path: ../util 12 | -------------------------------------------------------------------------------- /examples/util/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /examples/util/lib/dart_version.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | final _majorVersNum = RegExp(r'(\d+)\.'); 4 | 5 | final int dartMajorVers = 6 | int.parse(_majorVersNum.firstMatch(Platform.version)[1]); 7 | -------------------------------------------------------------------------------- /examples/util/lib/ellipsis.dart: -------------------------------------------------------------------------------- 1 | dynamic blockEllipsis; // Use as replace="/=. blockEllipsis;/{ ... }/g" 2 | T ellipsis() => null; // Use as replace="/ellipsis;?/.../g" 3 | -------------------------------------------------------------------------------- /examples/util/lib/logger.dart: -------------------------------------------------------------------------------- 1 | /// A simple logger 2 | class Logger { 3 | final List _log = []; 4 | 5 | List get log => List.from(_log); 6 | void clear() => _log.clear(); 7 | void print(Object o) => _log.add(o.toString()); 8 | 9 | @override 10 | String toString() => _log.join('\n'); 11 | } 12 | -------------------------------------------------------------------------------- /examples/util/lib/print_matcher.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart' as test; 2 | 3 | /// Like the [test.prints] matcher, but accepts non-String arguments. If [any] 4 | /// is an [Iterable], this matches the equivalent of `any.forEach(print)`; 5 | /// otherwise this matches `'$any'`. 6 | test.Matcher prints(dynamic any) { 7 | Iterable args = any is Iterable ? any : [any]; 8 | return test.prints(args.map((arg) => '$arg').join('\n') + '\n'); 9 | } 10 | -------------------------------------------------------------------------------- /examples/util/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dartlang_examples_util 2 | description: dartlang.org example utilities. 3 | version: 0.0.2 4 | 5 | environment: 6 | sdk: '>=2.3.1 <3.0.0' 7 | 8 | dependencies: 9 | test: ^1.0.0 10 | pedantic: ^1.0.0 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/adjacent-string-literals/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var s1 = 'String ' 4 | 'concatenation' 5 | " works even over line breaks."; 6 | assert(s1 == 7 | 'String concatenation works even over ' 8 | 'line breaks.'); 9 | 10 | var s2 = 'The + operator ' + 'works, as well.'; 11 | assert(s2 == 'The + operator works, as well.'); 12 | // #enddocregion 13 | 14 | print(s1); // String concatenation works even over line breaks. 15 | print(s2); // The + operator works, as well. 16 | } 17 | -------------------------------------------------------------------------------- /examples_archive/language_tour/adjacent-string-literals/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: adjacent_string_literals 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/args/bin/main.dart: -------------------------------------------------------------------------------- 1 | // Run the app like this: dart args.dart 1 test 2 | void main(List arguments) { 3 | print(arguments); 4 | 5 | assert(arguments.length == 2); 6 | assert(int.parse(arguments[0]) == 1); 7 | assert(arguments[1] == 'test'); 8 | } 9 | -------------------------------------------------------------------------------- /examples_archive/language_tour/args/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: args 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/arithmetic-operators/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | assert(2 + 3 == 5); 4 | assert(2 - 3 == -1); 5 | assert(2 * 3 == 6); 6 | assert(5 / 2 == 2.5); // Result is a double 7 | assert(5 ~/ 2 == 2); // Result is an integer 8 | assert(5 % 2 == 1); // Remainder 9 | 10 | print('5/2 = ${5~/2} r ${5%2}'); // 5/2 = 2 r 1 11 | // #enddocregion 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/arithmetic-operators/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: arithmetic_operators 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/async-await/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: async_await 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/ballgame/ball.dart: -------------------------------------------------------------------------------- 1 | part of ballgame; 2 | 3 | // ...Code goes here... 4 | -------------------------------------------------------------------------------- /examples_archive/language_tour/ballgame/ballgame.dart: -------------------------------------------------------------------------------- 1 | library ballgame; 2 | 3 | import 'dart:html'; 4 | // ...Other imports go here... 5 | 6 | part 'ball.dart'; 7 | part 'util.dart'; 8 | 9 | // ...Code might go here... 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/ballgame/util.dart: -------------------------------------------------------------------------------- 1 | part of ballgame; 2 | 3 | // ...Code goes here... 4 | -------------------------------------------------------------------------------- /examples_archive/language_tour/basic-dart-program/bin/main.dart: -------------------------------------------------------------------------------- 1 | // Define a function. 2 | printNumber(num aNumber) { 3 | print('The number is $aNumber.'); // Print to console. 4 | } 5 | 6 | // This is where the app starts executing. 7 | main() { 8 | var number = 42; // Declare and initialize a variable. 9 | printNumber(number); // Call a function. 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/basic-dart-program/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: basic_dart_program 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/bit-shifting/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | assert((3 << 1) == 6); // 0011 << 1 == 0110 4 | assert((3 >> 1) == 1); // 0011 >> 1 == 0001 5 | assert((3 | 4) == 7); // 0011 | 0100 == 0111 6 | // #enddocregion 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/bit-shifting/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: bit_shifting 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/callable-function/bin/main.dart: -------------------------------------------------------------------------------- 1 | class WannabeFunction { 2 | void call(String a, String b, String c) => a + ' ' + b + ' ' + c + '!'; 3 | } 4 | 5 | void main() { 6 | var wf = new WannabeFunction(); 7 | var out = wf("Hi", "there,", "gang"); 8 | print('$out'); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/callable-function/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: callable_function 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/cascade-operator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cascade_operator 2 | description: A sample application 3 | dependencies: 4 | browser: any 5 | -------------------------------------------------------------------------------- /examples_archive/language_tour/cascade-operator/web/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | 3 | void main() { 4 | // #docregion 5 | querySelector('#button') // Get an object. 6 | ..text = 'Confirm' // Use its members. 7 | ..classes.add('important') 8 | ..onClick.listen((e) => window.alert('Confirmed!')); 9 | // #enddocregion 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/color/bin/main.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: type_annotate_public_apis 2 | // #docregion 3 | class Color { 4 | static const red = 5 | const Color('red'); // A constant static variable. 6 | final String name; // An instance variable. 7 | const Color(this.name); // A constant constructor. 8 | } 9 | 10 | void main() { 11 | assert(Color.red.name == 'red'); 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/color/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: color 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/const-vs-const/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: const_vs_const 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/const/bin/main.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | void main() { 4 | // #docregion 5 | const bar = 1000000; // Unit of pressure (dynes/cm2) 6 | const double atm = 1.01325 * bar; // Standard atmosphere 7 | // #enddocregion 8 | assert(atm > bar); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/const/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: const_example 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/continue_example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: continue_example 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/creating-a-variable/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var name = 'Bob'; 4 | // #enddocregion 5 | print(name); 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/creating-a-variable/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: creating_a_variable 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/deferred/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | // #docregion import 3 | import 'package:deferred/hello.dart' deferred as hello; 4 | // #enddocregion import 5 | 6 | // #docregion await 7 | Future greet() async { 8 | await hello.loadLibrary(); 9 | hello.printGreeting(); 10 | } 11 | // #enddocregion await 12 | 13 | Future main() async { 14 | await hello.loadLibrary(); 15 | hello.printGreeting(); 16 | // OR... 17 | greet(); 18 | greet(); 19 | greet(); 20 | greet(); 21 | greet(); 22 | } 23 | -------------------------------------------------------------------------------- /examples_archive/language_tour/deferred/lib/hello.dart: -------------------------------------------------------------------------------- 1 | library deferred.hello; 2 | 3 | void printGreeting() { 4 | print('Hello World, from the deferred library!'); 5 | } 6 | -------------------------------------------------------------------------------- /examples_archive/language_tour/deferred/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: deferred 2 | description: A sample app that loads a library lazily. 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/double-literals/bin/main.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | double y = 1.1; 3 | double exponents = 1.42e5; 4 | // #enddocregion 5 | 6 | void main() {} 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/double-literals/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: double_literals 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/empty-string/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | // Check for an empty string. 4 | var fullName = ''; 5 | assert(fullName.isEmpty); 6 | 7 | // Check for zero. 8 | var hitPoints = 0; 9 | assert(hitPoints <= 0); 10 | 11 | // Check for null. 12 | var unicorn; 13 | assert(unicorn == null); 14 | 15 | // Check for NaN. 16 | var iMeantToDoThis = 0 / 0; 17 | assert(iMeantToDoThis.isNaN); 18 | // #enddocregion 19 | } 20 | -------------------------------------------------------------------------------- /examples_archive/language_tour/empty-string/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: empty_string 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/enum-switch/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: enum_switch 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/factory-constructor/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: factory_constructor 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/final-initialization/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | final name = 'Bob'; // Without a type annotation 4 | // name = 'Alice'; // Uncommenting this causes an error 5 | final String nickname = 'Bobby'; 6 | // #enddocregion 7 | assert(nickname.startsWith(name)); 8 | print('$name ($nickname)'); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/final-initialization/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: final_initialization 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow-if-else/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flow_if_else 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow-switch-case/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flow_switch_case 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow-while/bin/main.dart: -------------------------------------------------------------------------------- 1 | void doSomething() {} 2 | void printLine() => print('Hi'); 3 | bool isDone() => true; 4 | bool atEndOfPage() => true; 5 | 6 | void main() { 7 | // #docregion 8 | while (!isDone()) { 9 | doSomething(); 10 | } 11 | // #enddocregion 12 | 13 | // #docregion do-while 14 | do { 15 | printLine(); 16 | } while (!atEndOfPage()); 17 | // #enddocregion do-while 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow-while/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flow_while 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow/README.md: -------------------------------------------------------------------------------- 1 | These files don't depend on dart:html. We're using web app conventions 2 | only so that we can generate gists. 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow/assert_example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: assert_example 2 | dependencies: 3 | browser: any 4 | 5 | gist: https://gist.github.com/kwalrath/dab00eb68704900f70ba 6 | dartpad: https://dartpad.dartlang.org/dab00eb68704900f70ba 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/flow/break-continue/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: break_continue 2 | dependencies: 3 | browser: any 4 | 5 | homepage: http://gist.github.com/kwalrath/7417291c1fd6c74b56be -------------------------------------------------------------------------------- /examples_archive/language_tour/flow/exceptions/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: exceptions 2 | dependencies: 3 | browser: any 4 | 5 | homepage: http://gist.github.com/kwalrath/bb5c060b6d9d050419c8 -------------------------------------------------------------------------------- /examples_archive/language_tour/flow/for-loops/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: for_loops 2 | dependencies: 3 | browser: any 4 | 5 | homepage: http://gist.github.com/kwalrath/836a6f67f4ef7af349bc 6 | -------------------------------------------------------------------------------- /examples_archive/language_tour/french-togo/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:french_togo/togo.dart'; 2 | 3 | void main() { 4 | hello(); //print bonjour 5 | /*goodbye();*/ //FAIL 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/french-togo/lib/src/french.dart: -------------------------------------------------------------------------------- 1 | void hello() => print('Bonjour!'); 2 | void goodbye() => print('Au Revoir!'); 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/french-togo/lib/togo.dart: -------------------------------------------------------------------------------- 1 | import 'src/french.dart'; 2 | export 'src/french.dart' show hello; 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/french-togo/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: french_togo 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-as-parameter/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | void printElement(int element) { 4 | print(element); 5 | } 6 | 7 | var list = [1, 2, 3]; 8 | 9 | // Pass printElement as a parameter. 10 | list.forEach(printElement); 11 | // #enddocregion 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-as-parameter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_as_parameter 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-as-variable/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var loudify = (msg) => '!!! ${msg.toUpperCase()} !!!'; 4 | assert(loudify('hello') == '!!! HELLO !!!'); 5 | // #enddocregion 6 | print(loudify('hello')); 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-as-variable/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_as_variable 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-closure/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_closure 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-equality-2/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_equality_2 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-example/bin/main.dart: -------------------------------------------------------------------------------- 1 | var _nobleGases = { 2 | // Keys Values 3 | 2: 'helium', 4 | 10: 'neon', 5 | 18: 'argon', 6 | 36: 'krypton', 7 | 54: 'xenon', 8 | 86: 'radon', 9 | }; 10 | 11 | // #docregion 12 | bool isNoble(int atomicNumber) { 13 | return _nobleGases[atomicNumber] != null; 14 | } 15 | // #enddocregion 16 | 17 | void main() { 18 | print('Noble gases'); 19 | print('-----------'); 20 | for (int i = 0; i < 100; i++) { 21 | if (isNoble(i)) print('$i: ${_nobleGases[i]}'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_example 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-omitting-types/bin/main.dart: -------------------------------------------------------------------------------- 1 | var _nobleGases = { 2 | // Keys Values 3 | 2: 'helium', 4 | 10: 'neon', 5 | 18: 'argon', 6 | 36: 'krypton', 7 | 54: 'xenon', 8 | 86: 'radon', 9 | }; 10 | 11 | // #docregion 12 | bool isNoble(int atomicNumber) { 13 | return _nobleGases[atomicNumber] != null; 14 | } 15 | // #enddocregion 16 | 17 | void main() { 18 | print('Noble gases'); 19 | print('-----------'); 20 | for (int i = 0; i < 100; i++) { 21 | if (isNoble(i)) print('$i: ${_nobleGases[i]}'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-omitting-types/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_omitting_types 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-shorthand/bin/main.dart: -------------------------------------------------------------------------------- 1 | var _nobleGases = { 2 | // Keys Values 3 | 2: 'helium', 4 | 10: 'neon', 5 | 18: 'argon', 6 | 36: 'krypton', 7 | 54: 'xenon', 8 | 86: 'radon', 9 | }; 10 | 11 | // #docregion 12 | bool isNoble(int atomicNumber) => _nobleGases[atomicNumber] != null; 13 | // #enddocregion 14 | 15 | void main() { 16 | print('Noble gases'); 17 | print('-----------'); 18 | for (int i = 0; i < 100; i++) { 19 | if (isNoble(i)) print('$i: ${_nobleGases[i]}'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples_archive/language_tour/function-shorthand/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: function_shorthand 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/generics-base-class/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: generics_base_class 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/generics/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: generics 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/if-one/bin/main.dart: -------------------------------------------------------------------------------- 1 | // #docplaster 2 | void main() { 3 | // Change if (true) to if (1) to really test this code. 4 | /* 5 | // #docregion 6 | if (1) { 7 | // #enddocregion 8 | */ 9 | if (true) { 10 | // #docregion 11 | print('JS prints this line.'); 12 | } else { 13 | print('Dart in production mode prints this line.'); 14 | // However, in checked mode, if (1) throws an 15 | // exception because 1 is not boolean. 16 | } 17 | // #enddocregion 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/language_tour/if-one/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: if_one 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/imposter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: while_collection 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/instance-variables/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: instance_variables 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/integer-literals/bin/main.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | int x = 1; 3 | int hex = 0xDEADBEEF; 4 | int bigInt = 34653465834652437659238476592374958739845729; 5 | // #enddocregion 6 | 7 | void main() { 8 | print('x: $x; hex: $hex; bigInt: $bigInt'); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/integer-literals/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: integer_literals 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/lib1/lib/lib1.dart: -------------------------------------------------------------------------------- 1 | library lib1.dart; 2 | 3 | void foo() { 4 | print('foo'); 5 | } 6 | 7 | void bar() { 8 | print('bar'); 9 | } 10 | 11 | class Element {} 12 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/lib1/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: lib1 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/lib2/lib/lib2.dart: -------------------------------------------------------------------------------- 1 | library lib2.dart; 2 | 3 | void foo() { 4 | print('FOO'); 5 | } 6 | 7 | void bar() { 8 | print('BAR'); 9 | } 10 | 11 | class Element {} 12 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/lib2/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: lib2 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/library_partial.dart: -------------------------------------------------------------------------------- 1 | // Import only foo. 2 | import 'package:lib1/lib1.dart' show foo; 3 | 4 | // Import all names EXCEPT foo. 5 | import 'package:lib2/lib2.dart' hide foo; 6 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/library_prefix.dart: -------------------------------------------------------------------------------- 1 | import 'package:lib1/lib1.dart'; 2 | import 'package:lib2/lib2.dart' as lib2; 3 | 4 | Element element1 = new Element(); // Uses Element from lib1. 5 | lib2.Element element2 = new lib2.Element(); // Uses Element from lib2. 6 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/mylib/lib/mylib.dart: -------------------------------------------------------------------------------- 1 | library mylib.dart; 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/mylib/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mylib 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dart_up_and_running_samples 2 | dependencies: 3 | lib1: 4 | path: lib1 5 | lib2: 6 | path: lib2 7 | mylib: 8 | path: mylib 9 | utils: 10 | path: utils 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/using_libraries.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/using_schemes.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:mylib/mylib.dart'; 3 | import 'package:utils/utils.dart'; 4 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/utils/lib/utils.dart: -------------------------------------------------------------------------------- 1 | library utils.dart; 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/libraries/utils/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: utils 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/list-indexing/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var list = [1, 2, 3]; 4 | assert(list.length == 3); 5 | assert(list[1] == 2); 6 | 7 | list[1] = 1; 8 | assert(list[1] == 1); 9 | // #enddocregion 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/list-indexing/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: list_indexing 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/list-literal/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var list = [1, 2, 3]; 4 | // #enddocregion 5 | 6 | // #docregion const 7 | var constantList = const [1, 2, 3]; 8 | // constantList[1] = 1; // Uncommenting this causes an error. 9 | // #enddocregion const 10 | 11 | list[1] = 1; // You can do this. 12 | try { 13 | constantList[1] = 1; // You can't do this. 14 | } catch (e) { 15 | print('Tsk tsk! $e'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples_archive/language_tour/list-literal/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: list_literal 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/list-map-default-function-parameters/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: list_map_default_function_parameters 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-add-item/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var gifts = {'first': 'partridge'}; 4 | gifts['fourth'] = 'calling birds'; // Add a key-value pair 5 | // #enddocregion 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-add-item/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_add_item 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-constructor/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var gifts = new Map(); 4 | gifts['first'] = 'partridge'; 5 | gifts['second'] = 'turtledoves'; 6 | gifts['fifth'] = 'golden rings'; 7 | 8 | var nobleGases = new Map(); 9 | nobleGases[2] = 'helium'; 10 | nobleGases[10] = 'neon'; 11 | nobleGases[18] = 'argon'; 12 | // #enddocregion 13 | } 14 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-constructor/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_constructor 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-length/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var gifts = {'first': 'partridge'}; 4 | gifts['fourth'] = 'calling birds'; 5 | assert(gifts.length == 2); 6 | // #enddocregion 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-length/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_length 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-missing-key/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var gifts = {'first': 'partridge'}; 4 | assert(gifts['fifth'] == null); 5 | // #enddocregion 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-missing-key/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_missing_key 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-retrieve-item/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var gifts = {'first': 'partridge'}; 4 | assert(gifts['first'] == 'partridge'); 5 | // #enddocregion 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/map-retrieve-item/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_retrieve_item 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/metadata/bin/deprecated.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var tv = new Television(); 3 | //tv.activate(); 4 | tv.turnOn(); 5 | } 6 | 7 | // #docregion 8 | class Television { 9 | /// _Deprecated: Use [turnOn] instead._ 10 | @deprecated 11 | void activate() { 12 | turnOn(); 13 | } 14 | 15 | /// Turns the TV's power on. 16 | void turnOn() { 17 | print('on!'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples_archive/language_tour/metadata/bin/main.dart: -------------------------------------------------------------------------------- 1 | //import 'dart:mirrors'; 2 | // #docregion 3 | import 'todo.dart'; 4 | 5 | @Todo('seth', 'make this do something') 6 | void doSomething() { 7 | print('do something'); 8 | } 9 | // #enddocregion 10 | 11 | void main() { 12 | // PENDING: Once reflection on annotations is implemented, show that here. 13 | print('tbd'); 14 | } 15 | -------------------------------------------------------------------------------- /examples_archive/language_tour/metadata/bin/override.dart: -------------------------------------------------------------------------------- 1 | class Television { 2 | void turnOn() {} 3 | } 4 | 5 | // #docregion 6 | class SmartTelevision extends Television { 7 | @override 8 | void turnOn() { 9 | // ··· 10 | } 11 | // ··· 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/metadata/bin/todo.dart: -------------------------------------------------------------------------------- 1 | library todo; 2 | 3 | class Todo { 4 | final String who; 5 | final String what; 6 | 7 | const Todo(this.who, this.what); 8 | } 9 | -------------------------------------------------------------------------------- /examples_archive/language_tour/metadata/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: metadata 2 | dependencies: 3 | meta: any 4 | -------------------------------------------------------------------------------- /examples_archive/language_tour/method-then-constructor/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: method_then_constructor 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/mixins/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mixins 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/multi-line-comments/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | /* 3 | * This is a lot of work. Consider raising chickens. 4 | 5 | Llama larry = new Llama(); 6 | larry.feed(); 7 | larry.exercise(); 8 | larry.clean(); 9 | */ 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/multi-line-comments/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: multi_line_comments 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/nested-functions/bin/main.dart: -------------------------------------------------------------------------------- 1 | bool topLevel = true; 2 | 3 | void main() { 4 | var insideMain = true; 5 | 6 | void myFunction() { 7 | var insideFunction = true; 8 | 9 | void nestedFunction() { 10 | var insideNestedFunction = true; 11 | 12 | assert(topLevel); 13 | assert(insideMain); 14 | assert(insideFunction); 15 | assert(insideNestedFunction); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/language_tour/nested-functions/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: nested_functions 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/no-such-method/bin/alt-to-proxy.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var a = new A(); 3 | a.doSomething(); 4 | a.doSomeOtherThing(); 5 | } 6 | 7 | class SomeClass { 8 | void doSomething() {} 9 | } 10 | 11 | class SomeOtherClass { 12 | void doSomeOtherThing() {} 13 | } 14 | 15 | // #docregion 16 | class A implements SomeClass, SomeOtherClass { 17 | @override 18 | void noSuchMethod(Invocation mirror) { 19 | // #enddocregion 20 | print('handling invocation: ${mirror.memberName}'); 21 | // #docregion 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples_archive/language_tour/no-such-method/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var a = new A(); 3 | //a.bar(); 4 | //a.baz; 5 | } 6 | 7 | // #docregion 8 | class A { 9 | // Unless you override noSuchMethod, using a 10 | // non-existent member results in a NoSuchMethodError. 11 | @override 12 | void noSuchMethod(Invocation mirror) { 13 | print('You tried to use a non-existent member:' + 14 | '${mirror.memberName}'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples_archive/language_tour/no-such-method/bin/proxy.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var a = new A(); 3 | a.doSomething(); 4 | } 5 | 6 | // #docregion 7 | @proxy 8 | class A { 9 | @override 10 | void noSuchMethod(Invocation mirror) { 11 | // #enddocregion 12 | print('handling invocation: ${mirror.memberName}'); 13 | // #docregion 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples_archive/language_tour/no-such-method/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: no_such_method 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/number-conversion/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | // String -> int 4 | var one = int.parse('1'); 5 | assert(one == 1); 6 | 7 | // String -> double 8 | var onePointOne = double.parse('1.1'); 9 | assert(onePointOne == 1.1); 10 | 11 | // int -> String 12 | String oneAsString = 1.toString(); 13 | assert(oneAsString == '1'); 14 | 15 | // double -> String 16 | String piAsString = 3.14159.toStringAsFixed(2); 17 | assert(piAsString == '3.14'); 18 | // #enddocregion 19 | } 20 | -------------------------------------------------------------------------------- /examples_archive/language_tour/number-conversion/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: number_conversion 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/number-literals/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | const msPerSecond = 1000; 4 | const secondsUntilRetry = 5; 5 | const msUntilRetry = secondsUntilRetry * msPerSecond; 6 | // #enddocregion 7 | print('Wait $msUntilRetry milliseconds.'); 8 | } 9 | -------------------------------------------------------------------------------- /examples_archive/language_tour/number-literals/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: number_literals 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/numbers-are-objects/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | int lineCount; 4 | assert(lineCount == null); 5 | // Variables (even if they will be numbers) are initially null. 6 | // #enddocregion 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/numbers-are-objects/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: numbers_are_objects 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/object-classes/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: object_classes 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-as/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: op_as 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-assign/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var a = 2; // Assign using = 4 | a *= 3; // Assign and multiply: a = a * 3 5 | assert(a == 6); 6 | // #enddocregion 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-assign/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: op_assign 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-bitwise/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | final value = 0x22; 4 | final bitmask = 0x0f; 5 | 6 | assert((value & bitmask) == 0x02); // AND 7 | assert((value & ~bitmask) == 0x20); // AND NOT 8 | assert((value | bitmask) == 0x2f); // OR 9 | assert((value ^ bitmask) == 0x2d); // XOR 10 | assert((value << 4) == 0x220); // Shift left 11 | assert((value >> 4) == 0x02); // Shift right 12 | // #enddocregion 13 | } 14 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-bitwise/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: op_bitwise 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-equality/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | assert(2 == 2); 4 | assert(2 != 3); 5 | assert(3 > 2); 6 | assert(2 < 3); 7 | assert(3 >= 3); 8 | assert(2 <= 3); 9 | // #enddocregion 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-equality/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: op_equality 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-increment-decrement/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: op_increment_decrement 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-logical/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var done = false; 3 | var col = 2; 4 | // #docregion 5 | if (!done && (col == 0 || col == 3)) { 6 | // ...Do something... 7 | } 8 | // #enddocregion 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/op-logical/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: op_logical 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/optional-positional-parameter-default/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: optional_positional_parameter_default 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/optional-positional-parameters/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: optional_positional_parameters 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/point/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class Point { 4 | num x; 5 | num y; 6 | Point(this.x, this.y); 7 | 8 | static num distanceBetween(Point a, Point b) { 9 | var dx = a.x - b.x; 10 | var dy = a.y - b.y; 11 | return sqrt(dx * dx + dy * dy); 12 | } 13 | } 14 | 15 | void main() { 16 | var a = new Point(2, 2); 17 | var b = new Point(4, 4); 18 | var distance = Point.distanceBetween(a, b); 19 | assert(distance < 2.9 && distance > 2.8); 20 | } 21 | -------------------------------------------------------------------------------- /examples_archive/language_tour/point/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: point 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/precedence/bin/main.dart: -------------------------------------------------------------------------------- 1 | // #docplaster 2 | void main() { 3 | var n = 4; 4 | var d = 2; 5 | var i = 2; 6 | 7 | // #docregion 8 | // 1: Parens improve readability. 9 | if ((n % i == 0) && (d % i == 0)) 10 | // #enddocregion 11 | {/* do nothing */} 12 | // #docregion 13 | 14 | // 2: Harder to read, but equivalent. 15 | if (n % i == 0 && d % i == 0) 16 | // #enddocregion 17 | {/* do nothing */} 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/language_tour/precedence/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: precedence 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/quoting/bin/main.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: unused_local_variable 2 | 3 | void main() { 4 | // #docregion 5 | var s1 = 'Single quotes work well for string literals.'; 6 | var s2 = "Double quotes work just as well."; 7 | var s3 = 'It\'s easy to escape the string delimiter.'; 8 | var s4 = "It's even easier to use the other delimiter."; 9 | // #enddocregion 10 | // Unicode escapes work: [heart] 11 | print('Unicode escapes work: \u2665'); 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/quoting/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: quoting 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/raw-strings/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var s = r"In a raw string, even \n isn't special."; 4 | // #enddocregion 5 | print(s); 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/language_tour/raw-strings/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: raw_strings 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/rectangle/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: rectangle 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/README: -------------------------------------------------------------------------------- 1 | The examples in this directory don't run. They are for reference only. 2 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/along_x_axis.dart: -------------------------------------------------------------------------------- 1 | class Point { 2 | num x; 3 | num y; 4 | 5 | // The main constructor for this class. 6 | Point(this.x, this.y); 7 | 8 | // Delegates to the main constructor. 9 | Point.alongXAxis(num x) : this(x, 0); 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/constructor_long_way.dart: -------------------------------------------------------------------------------- 1 | class Point { 2 | num x; 3 | num y; 4 | 5 | Point(num x, num y) { 6 | // There's a better way to do this, stay tuned. 7 | this.x = x; 8 | this.y = y; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/distance_to.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class Point { 4 | num x; 5 | num y; 6 | Point(this.x, this.y); 7 | 8 | num distanceTo(Point other) { 9 | var dx = x - other.x; 10 | var dy = y - other.y; 11 | return sqrt(dx * dx + dy * dy); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/doer.dart: -------------------------------------------------------------------------------- 1 | abstract class Doer { 2 | // ...Define instance variables and methods... 3 | 4 | void doSomething(); // Define an abstract method. 5 | } 6 | 7 | class EffectiveDoer extends Doer { 8 | void doSomething() { 9 | // ...Provide an implementation, so the method is not abstract here... 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/immutable_point.dart: -------------------------------------------------------------------------------- 1 | class ImmutablePoint { 2 | final num x; 3 | final num y; 4 | const ImmutablePoint(this.x, this.y); 5 | static final ImmutablePoint origin = 6 | const ImmutablePoint(0, 0); 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/initializer_list.dart: -------------------------------------------------------------------------------- 1 | class Point { 2 | num x; 3 | num y; 4 | 5 | Point(this.x, this.y); 6 | 7 | // Initializer list sets instance variables before 8 | // the constructor body runs. 9 | Point.fromJson(Map json) 10 | : x = json['x'], 11 | y = json['y'] { 12 | print('In Point.fromJson(): ($x, $y)'); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/initializer_list_final.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class Point { 4 | final num x; 5 | final num y; 6 | final num distanceFromOrigin; 7 | 8 | Point(x, y) 9 | : x = x, 10 | y = y, 11 | distanceFromOrigin = sqrt(x * x + y * y); 12 | } 13 | 14 | void main() { 15 | var p = new Point(2, 3); 16 | print(p.distanceFromOrigin); 17 | } 18 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/named_constructor.dart: -------------------------------------------------------------------------------- 1 | class Point { 2 | num x; 3 | num y; 4 | 5 | Point(this.x, this.y); 6 | 7 | // Named constructor 8 | Point.fromJson(Map json) { 9 | x = json['x']; 10 | y = json['y']; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/point_interfaces.dart: -------------------------------------------------------------------------------- 1 | class Comparable {} 2 | 3 | class Location {} 4 | 5 | // #docregion 6 | class Point implements Comparable, Location { 7 | // ... 8 | } 9 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/rethrow.dart: -------------------------------------------------------------------------------- 1 | final foo = ''; 2 | 3 | void misbehave() { 4 | try { 5 | foo = "You can't change a final variable's value."; 6 | } catch (e) { 7 | print('misbehave() partially handled ${e.runtimeType}.'); 8 | rethrow; // Allow callers to see the exception. 9 | } 10 | } 11 | 12 | void main() { 13 | try { 14 | misbehave(); 15 | } catch (e) { 16 | print('main() finished handling ${e.runtimeType}.'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/language_tour/reference/strictly_booleans.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | /* HACK: This code is fails the type checker, so I don't want to actually run it. 3 | // #docregion 4 | var name = 'Bob'; 5 | if (name) { 6 | // Prints in JavaScript, not in Dart. 7 | print('You have a name!'); 8 | } 9 | // #enddocregion 10 | */ 11 | } 12 | -------------------------------------------------------------------------------- /examples_archive/language_tour/runes/bin/main.dart: -------------------------------------------------------------------------------- 1 | // Unicode emoji: http://unicode.org/emoji/charts/full-emoji-list.html 2 | 3 | // #docregion 4 | void main() { 5 | var clapping = '\u{1f44f}'; 6 | print(clapping); 7 | print(clapping.codeUnits); 8 | print(clapping.runes.toList()); 9 | 10 | Runes input = new Runes( 11 | '\u2665 \u{1f605} \u{1f60e} \u{1f47b} \u{1f596} \u{1f44d}'); 12 | print(new String.fromCharCodes(input)); 13 | } 14 | // #enddocregion 15 | -------------------------------------------------------------------------------- /examples_archive/language_tour/runes/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: runes 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/single-line-comments/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // TODO: refactor into an AbstractLlamaGreetingFactory? 3 | print('Welcome to my Llama farm!'); 4 | } 5 | -------------------------------------------------------------------------------- /examples_archive/language_tour/single-line-comments/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: single_line_comments 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/sorted-collection/bin/main.dart: -------------------------------------------------------------------------------- 1 | typedef int Compare(T a, T b); 2 | 3 | int sort(int a, int b) => a - b; 4 | 5 | void main() { 6 | assert(sort is Compare); // True! 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/sorted-collection/bin/sorted_collection_broken.dart: -------------------------------------------------------------------------------- 1 | class SortedCollection { 2 | Function compare; 3 | 4 | SortedCollection(int f(Object a, Object b)) { 5 | compare = f; 6 | } 7 | } 8 | 9 | // Initial, broken implementation. 10 | int sort(Object a, Object b) => 0; 11 | 12 | void main() { 13 | SortedCollection coll = new SortedCollection(sort); 14 | 15 | // All we know is that compare is a function, 16 | // but what type of function? 17 | assert(coll.compare is Function); 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/language_tour/sorted-collection/bin/sorted_collection_broken_2.dart: -------------------------------------------------------------------------------- 1 | typedef int Compare(Object a, Object b); 2 | 3 | class SortedCollection { 4 | Compare compare; 5 | 6 | SortedCollection(this.compare); 7 | } 8 | 9 | // Initial, broken implementation. 10 | int sort(Object a, Object b) => 0; 11 | 12 | void main() { 13 | SortedCollection coll = new SortedCollection(sort); 14 | assert(coll.compare is Function); 15 | assert(coll.compare is Compare); 16 | } 17 | -------------------------------------------------------------------------------- /examples_archive/language_tour/sorted-collection/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: sorted_collection 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/specify-default-values/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | /// Sets the [bold] and [hidden] flags to the values you 4 | /// specify, defaulting to false. 5 | void enableFlags({bool bold = false, bool hidden = false}) { 6 | // ... 7 | } 8 | 9 | // bold will be true; hidden will be false. 10 | enableFlags(bold: true); 11 | // #enddocregion 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/language_tour/specify-default-values/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: specify_default_values 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/specify-named-parameters/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | /// Sets the [bold] and [hidden] flags to the values 4 | /// you specify. 5 | void enableFlags({bool bold, bool hidden}) { 6 | // ... 7 | } 8 | // #enddocregion 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/language_tour/specify-named-parameters/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: specify_named_parameters 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/static-types/bin/main.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | String name = 'Bob'; 3 | // #enddocregion 4 | 5 | void main() {} 6 | -------------------------------------------------------------------------------- /examples_archive/language_tour/static-types/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: static_types 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/string-interpolation/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var s = 'string interpolation'; 4 | 5 | assert('Dart has $s, which is very handy.' == 6 | 'Dart has string interpolation, ' + 7 | 'which is very handy.'); 8 | assert('That deserves all caps. ' + 9 | '${s.toUpperCase()} is very handy!' == 10 | 'That deserves all caps. ' + 11 | 'STRING INTERPOLATION is very handy!'); 12 | // #enddocregion 13 | } 14 | -------------------------------------------------------------------------------- /examples_archive/language_tour/string-interpolation/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: string_interpolation 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/string-literals/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: string_literals 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/symbols/bin/main.dart: -------------------------------------------------------------------------------- 1 | // MOVE TO library tour? 2 | 3 | void main() { 4 | print(Function.apply(int.parse, ['11'])); 5 | print(Function.apply(int.parse, ['11'], {#radix: 16})); 6 | print(Function.apply(int.parse, ['11a'], {#onError: handleError})); 7 | print( 8 | Function.apply(int.parse, ['11a'], {#radix: 16, #onError: handleError})); 9 | } 10 | 11 | int handleError(String source) { 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /examples_archive/language_tour/symbols/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: symbols 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/triple-quotes/bin/main.dart: -------------------------------------------------------------------------------- 1 | // #docregion 2 | var s1 = ''' 3 | You can create 4 | multi-line strings like this one. 5 | '''; 6 | 7 | var s2 = """This is also a 8 | multi-line string."""; 9 | // #enddocregion 10 | 11 | void main() { 12 | print(s1); 13 | print(s2); 14 | } 15 | -------------------------------------------------------------------------------- /examples_archive/language_tour/triple-quotes/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: triple_quotes 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/use-named-parameters/bin/main.dart: -------------------------------------------------------------------------------- 1 | void enableFlags({bool bold, bool hidden}) {} 2 | 3 | void main() { 4 | // #docregion 5 | enableFlags(bold: true, hidden: false); 6 | // #enddocregion 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/language_tour/use-named-parameters/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: use_named_parameters 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/vector/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: vector 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/language_tour/while-collection/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: while_collection 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/async-await/async-await-web/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: async_await_web 2 | description: A sample web application 3 | dependencies: 4 | browser: any 5 | -------------------------------------------------------------------------------- /examples_archive/library_tour/async-await/async-await-web/web/humans.txt: -------------------------------------------------------------------------------- 1 | We are not robots. -------------------------------------------------------------------------------- /examples_archive/library_tour/async-await/async-await-web/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | async-await 7 | 8 | 9 | 10 |

Ch03 4 async

11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples_archive/library_tour/async-await/async-await-web/web/styles.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #F8F8F8; 4 | font-family: 'Open Sans', sans-serif; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 1.2em; 8 | margin: 15px; 9 | } 10 | 11 | h1, p { 12 | color: #333; 13 | } 14 | 15 | #sample_container_id { 16 | width: 100%; 17 | height: 400px; 18 | position: relative; 19 | border: 1px solid #ccc; 20 | background-color: #fff; 21 | } 22 | 23 | #sample_text_id { 24 | font-size: 24pt; 25 | text-align: center; 26 | margin-top: 140px; 27 | } 28 | -------------------------------------------------------------------------------- /examples_archive/library_tour/client-server/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:convert'; 3 | import 'dart:async'; 4 | 5 | Future main() async { 6 | var url = Uri.parse('http://127.0.0.1:8888/languages/dart'); 7 | var httpClient = new HttpClient(); 8 | var request = await httpClient.getUrl(url); 9 | print('have request'); 10 | var response = await request.close(); 11 | print('have response'); 12 | var data = await response.transform(UTF8.decoder).toList(); 13 | var body = data.join(''); 14 | print(body); 15 | httpClient.close(); 16 | } 17 | -------------------------------------------------------------------------------- /examples_archive/library_tour/client-server/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: http_client 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/collection-any-every/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: collection_any_every 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/collection-apply-function/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var teas = ['green', 'black', 'chamomile', 'earl grey']; 3 | 4 | teas.forEach((tea) => print('I drink $tea')); 5 | 6 | var loudTeas = teas.map((tea) => tea.toUpperCase()); 7 | assert(loudTeas.any((tea) => tea == 'GREEN')); 8 | loudTeas.forEach(print); 9 | 10 | var loudTeaList = teas.map((tea) => tea.toUpperCase()).toList(); 11 | loudTeaList.forEach(print); 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/library_tour/collection-apply-function/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: collection_apply_function 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/collection-is-empty/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // #docregion 3 | var teas = ['green', 'black', 'chamomile', 'earl grey']; 4 | assert(teas.isNotEmpty); 5 | // #enddocregion 6 | } 7 | -------------------------------------------------------------------------------- /examples_archive/library_tour/collection-is-empty/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: collection_is_empty 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/comparable/bin/main.dart: -------------------------------------------------------------------------------- 1 | class Line implements Comparable { 2 | final int length; 3 | const Line(this.length); 4 | @override 5 | int compareTo(Line other) => length - other.length; 6 | } 7 | 8 | void main() { 9 | var short = const Line(1); 10 | var long = const Line(100); 11 | assert(short.compareTo(long) < 0); 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/library_tour/comparable/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: comparable 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/date/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: date 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/decode-utf-8/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: decode_utf_8 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/duration/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: duration 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/encode-uri-components/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var uri = 'http://example.org/api?foo=some message'; 3 | 4 | var encoded = Uri.encodeComponent(uri); 5 | assert(encoded == 'http%3A%2F%2Fexample.org%2Fapi%3Ffoo%3Dsome%20message'); 6 | 7 | var decoded = Uri.decodeComponent(encoded); 8 | assert(uri == decoded); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/library_tour/encode-uri-components/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: encode_uri_components 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/encode-uri/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var uri = 'http://example.org/api?foo=some message'; 3 | 4 | var encoded = Uri.encodeFull(uri); 5 | assert(encoded == 'http://example.org/api?foo=some%20message'); 6 | 7 | var decoded = Uri.decodeFull(encoded); 8 | assert(uri == decoded); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/library_tour/encode-uri/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: encode_uri 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/encode-utf-8/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: encode_utf_8 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/future-then/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: future_then 2 | description: A sample web application 3 | dependencies: 4 | browser: any 5 | -------------------------------------------------------------------------------- /examples_archive/library_tour/futures/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: futures 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: getting_data_from_server 2 | description: A sample web application 3 | dependencies: 4 | browser: any 5 | -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/baddata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dart-up-and-running", 3 | "home": "https://github.com/dart-lang/dart-up-and-running-book" 4 | } 5 | -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dart-up-and-running", 3 | "license": "CC BY-NC-ND", 4 | "home": "https://github.com/dart-lang/dart-up-and-running-book" 5 | } 6 | -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | dart-up-and-running 4 | CC BY-NC-ND 5 | https://github.com/dart-lang/dart-up-and-running-book 6 | 7 | -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | HTML testing from Library Tour 7 | 8 | 9 | 10 |

HTML testing from Library Tour

11 | 12 |

Nothing to see here. Look in the console for output.

13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/nodata.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/examples_archive/library_tour/get-data-from-server/web/nodata.json -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/nodata.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/examples_archive/library_tour/get-data-from-server/web/nodata.xml -------------------------------------------------------------------------------- /examples_archive/library_tour/get-data-from-server/web/styles.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #F8F8F8; 4 | font-family: 'Open Sans', sans-serif; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 1.2em; 8 | margin: 15px; 9 | } 10 | 11 | h1, p { 12 | color: #333; 13 | } -------------------------------------------------------------------------------- /examples_archive/library_tour/iterator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: iterator 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/json-parse/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert' show JSON; 2 | 3 | void main() { 4 | // NOTE: Be sure to use double quotes ("), 5 | // not single quotes ('), inside the JSON string. 6 | // This string is JSON, not Dart. 7 | var jsonString = ''' 8 | [ 9 | {"score": 40}, 10 | {"score": 80} 11 | ] 12 | '''; 13 | 14 | var scores = JSON.decode(jsonString); 15 | assert(scores is List); 16 | 17 | var firstScore = scores[0]; 18 | assert(firstScore is Map); 19 | assert(firstScore['score'] == 40); 20 | } 21 | -------------------------------------------------------------------------------- /examples_archive/library_tour/json-parse/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: json_parse 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/json-stringify/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert' show JSON; 2 | 3 | void main() { 4 | var scores = [ 5 | {'score': 40}, 6 | {'score': 80}, 7 | {'score': 100, 'overtime': true, 'special_guest': null} 8 | ]; 9 | 10 | var jsonText = JSON.encode(scores); 11 | assert(jsonText == 12 | '[{"score":40},{"score":80},' 13 | '{"score":100,"overtime":true,' 14 | '"special_guest":null}]'); 15 | } 16 | -------------------------------------------------------------------------------- /examples_archive/library_tour/json-stringify/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: json_stringify 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/list-files/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | var dir = new Directory('/tmp'); 6 | 7 | try { 8 | var dirList = dir.list(); 9 | await for (FileSystemEntity f in dirList) { 10 | if (f is File) { 11 | print('Found file ${f.path}'); 12 | } else if (f is Directory) { 13 | print('Found dir ${f.path}'); 14 | } 15 | } 16 | } catch (e) { 17 | print(e.toString()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples_archive/library_tour/list-files/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: list_files 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/list-tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: list_tests 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/map-1/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_1 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/map-keys/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: map_keys 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/math-tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: math_tests 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/mirrors/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mirrors 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/number-tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: number_tests 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/parse-uri/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var uri = Uri.parse('http://example.org:8080/foo/bar#frag'); 3 | 4 | assert(uri.scheme == 'http'); 5 | assert(uri.host == 'example.org'); 6 | assert(uri.path == '/foo/bar'); 7 | assert(uri.fragment == 'frag'); 8 | assert(uri.origin == 'http://example.org:8080'); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/library_tour/parse-uri/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: parse_uri 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/port-send-receive/port_receive.dart: -------------------------------------------------------------------------------- 1 | //import 'dart:isolate'; 2 | // 3 | //echo() { 4 | // port.receive((msg, reply) { 5 | // print('I received: $msg'); 6 | // }); 7 | //} 8 | // 9 | //main() { 10 | // var sendPort = spawnFunction(echo); 11 | // sendPort.send('Hello from main'); 12 | // 13 | // // Note: incomplete. 14 | // // Use a ReceivePort (details below) to keep the root isolate alive 15 | // // long enough for echo() to perform its work. 16 | //} 17 | -------------------------------------------------------------------------------- /examples_archive/library_tour/port-send-receive/port_send.dart: -------------------------------------------------------------------------------- 1 | //import 'dart:isolate'; 2 | // 3 | //echo() { 4 | // // Receive messages here. (See the next section.) 5 | //} 6 | // 7 | //main() { 8 | // var sendPort = spawnFunction(echo); 9 | // sendPort.send('Hello from main'); 10 | // 11 | // // Note: incomplete. 12 | // // Use a ReceivePort (details below) to keep the root isolate alive 13 | // // long enough for echo() to perform its work. 14 | //} 15 | -------------------------------------------------------------------------------- /examples_archive/library_tour/post-data-to-server/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: post_data_to_server 2 | description: A sample web application 3 | dependencies: 4 | browser: any 5 | -------------------------------------------------------------------------------- /examples_archive/library_tour/post-data-to-server/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | HTML testing from Chapter 3 7 | 8 | 9 | 10 |

HTML testing from Chapter 3

11 | 12 |

Nothing to see here. Look in the console for output.

13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples_archive/library_tour/post-data-to-server/web/styles.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #F8F8F8; 4 | font-family: 'Open Sans', sans-serif; 5 | font-size: 14px; 6 | font-weight: normal; 7 | line-height: 1.2em; 8 | margin: 15px; 9 | } 10 | 11 | h1, p { 12 | color: #333; 13 | } -------------------------------------------------------------------------------- /examples_archive/library_tour/read-file/bin/binary_read.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | var config = new File('config.txt'); 6 | 7 | var contents = await config.readAsBytes(); 8 | print('The entire file is ${contents.length} bytes long'); 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/library_tour/read-file/bin/config.txt: -------------------------------------------------------------------------------- 1 | Llamas 2 | Dromedaries 3 | Oases in the Desert 4 | And other oddities 5 | -------------------------------------------------------------------------------- /examples_archive/library_tour/read-file/bin/file_errors.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:async'; 3 | 4 | Future main() async { 5 | var config = new File('config.txt'); 6 | try { 7 | var contents = await config.readAsString(); 8 | print(contents); 9 | } catch (e) { 10 | print(e); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples_archive/library_tour/read-file/bin/text_read.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | Future main() async { 5 | var config = new File('config.txt'); 6 | var contents; 7 | 8 | // Put the whole file in a single string. 9 | contents = await config.readAsString(); 10 | print('The entire file is ${contents.length} characters long.'); 11 | 12 | // Put each line of the file into its own string. 13 | contents = await config.readAsLines(); 14 | print('The entire file is ${contents.length} lines long.'); 15 | } 16 | -------------------------------------------------------------------------------- /examples_archive/library_tour/read-file/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: read_file 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/reference/exceptions.dart: -------------------------------------------------------------------------------- 1 | main() { 2 | throw new FooException(); 3 | } 4 | 5 | class FooException implements Exception { 6 | final String msg; 7 | const FooException([this.msg]); 8 | String toString() => msg ?? 'FooException (no message)'; 9 | } 10 | -------------------------------------------------------------------------------- /examples_archive/library_tour/reference/spawnIsolate.dart: -------------------------------------------------------------------------------- 1 | //import 'dart:isolate'; 2 | // 3 | //runInIsolate() { 4 | // print('hello from an isolate!'); 5 | //} 6 | // 7 | //main() { 8 | // spawnFunction(runInIsolate); 9 | // 10 | // // Note: incomplete. 11 | // // Use a ReceivePort (details below) to keep the root isolate alive 12 | // // long enough for runInIsolate() to perform its work. 13 | //} 14 | -------------------------------------------------------------------------------- /examples_archive/library_tour/set-tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: set_tests 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/string-tests/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: string_tests 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/uri-from-components/bin/main.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | var uri = new Uri( 3 | scheme: 'http', host: 'example.org', path: '/foo/bar', fragment: 'frag'); 4 | assert(uri.toString() == 'http://example.org/foo/bar#frag'); 5 | } 6 | -------------------------------------------------------------------------------- /examples_archive/library_tour/uri-from-components/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: uri_from_components 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/library_tour/write-file/betterLog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/examples_archive/library_tour/write-file/betterLog.txt -------------------------------------------------------------------------------- /examples_archive/library_tour/write-file/bin/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/examples_archive/library_tour/write-file/bin/icon.ico -------------------------------------------------------------------------------- /examples_archive/library_tour/write-file/copyOfIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/examples_archive/library_tour/write-file/copyOfIcon.ico -------------------------------------------------------------------------------- /examples_archive/library_tour/write-file/log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/examples_archive/library_tour/write-file/log.txt -------------------------------------------------------------------------------- /examples_archive/library_tour/write-file/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: write_file 2 | version: 0.0.2 3 | -------------------------------------------------------------------------------- /examples_archive/site_tests/README.md: -------------------------------------------------------------------------------- 1 | These old test files used to be under src/tests/site. 2 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/broadcast-streams/README.txt: -------------------------------------------------------------------------------- 1 | The first example needs a connection from the outside to trigger the error. 2 | I added example1b.dart to show what actually happens: the error shuts down 3 | the broadcast stream, but the actual requests are still coming in (showing 4 | that the socket wasn't shut down, and we have a resource leak). 5 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/broadcast-streams/example1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:async'; 3 | 4 | main() { 5 | ServerSocket.bind("localhost", 4999).then((socket) { 6 | socket.asBroadcastStream() // <== asBroadcastStream. 7 | .map((x) { throw "oops, my mistake"; }) 8 | .listen(print) 9 | .asFuture() // Automatically cancels on error. 10 | .catchError((_) { print("caught error"); }); 11 | }); 12 | print("connect to http://localhost:4999 to trigger error"); 13 | } 14 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/broadcast-streams/example4.data: -------------------------------------------------------------------------------- 1 | header 2 | fileName 3 | footer 4 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/converters-and-codecs/example2.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | main() { 4 | var outSink = new ChunkedConversionSink.withCallback((chunks) { 5 | print(chunks.single); // 𝅘𝅥𝅯 6 | }); 7 | 8 | var inSink = UTF8.decoder.startChunkedConversion(outSink); 9 | var list = [0xF0, 0x9D]; 10 | inSink.addSlice(list, 0, 2, false); 11 | // Since we used `addSlice` we are allowed to reuse the list. 12 | list[0] = 0x85; 13 | list[1] = 0xA1; 14 | inSink.addSlice(list, 0, 2, true); 15 | } 16 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/event-loop/eventloop_test1/bin/eventloop_test1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | main() { 3 | print('main #1 of 2'); 4 | scheduleMicrotask(() => print('microtask #1 of 2')); 5 | 6 | new Future.delayed(new Duration(seconds:1), 7 | () => print('future #1 (delayed)')); 8 | new Future(() => print('future #2 of 3')); 9 | new Future(() => print('future #3 of 3')); 10 | 11 | scheduleMicrotask(() => print('microtask #2 of 2')); 12 | 13 | print('main #2 of 2'); 14 | } 15 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/event-loop/eventloop_test1/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: eventloop_test1 2 | description: A sample command-line application 3 | #dependencies: 4 | # unittest: '>=0.10.0 <0.12.0' 5 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/event-loop/eventloop_test2/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: eventloop_test2 2 | description: A sample command-line application 3 | #dependencies: 4 | # unittest: '>=0.10.0 <0.12.0' 5 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/json-web-service/json_foreach_test.dart: -------------------------------------------------------------------------------- 1 | 2 | a() { 3 | var data; // ... initialize data ... 4 | 5 | // property access is validated by tools 6 | print(data.language); 7 | print(data.targets[0]); 8 | data.website.forEach((key, value) => print("$key=$value")); 9 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/json-web-service/json_getting_data_test.dart: -------------------------------------------------------------------------------- 1 | import "dart:html"; 2 | 3 | void loadData() { 4 | var url = "http://127.0.0.1:8080/programming-languages"; 5 | 6 | // call the web server asynchronously 7 | var request = HttpRequest.getString(url).then(onDataLoaded); 8 | } 9 | 10 | // print the raw json response text from the server 11 | void onDataLoaded(String responseText) { 12 | var jsonString = responseText; 13 | print(jsonString); 14 | } 15 | 16 | main() { 17 | loadData(); 18 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/json-web-service/json_http_request_parse.dart: -------------------------------------------------------------------------------- 1 | import "dart:convert"; 2 | import "dart:html"; 3 | 4 | void onDataLoaded(HttpRequest req) { 5 | Map data = JSON.decode(req.responseText); // parse response text 6 | print(data["language"]); // dart 7 | print(data["targets"][0]); // dartium 8 | print(data["website"]["homepage"]); // www.dartlang.org 9 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/json-web-service/json_parse_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | main() { 4 | String listAsJson = '["Dart",0.8]'; // input List of data 5 | List parsedList = JSON.decode(listAsJson); 6 | print(parsedList[0]); // Dart 7 | print(parsedList[1]); // 0.8 8 | 9 | String mapAsJson = '{"language":"dart"}'; // input Map of data 10 | Map parsedMap = JSON.decode(mapAsJson); 11 | print(parsedMap["language"]); // dart 12 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/json-web-service/json_stringify_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:html'; 3 | HttpRequest request; 4 | 5 | void saveData() { 6 | 7 | // snip setting up HttpRequest 8 | 9 | var mapData = new Map(); 10 | mapData["language"] = "dart"; 11 | mapData["targets"] = new List(); 12 | mapData["targets"].add("dartium"); 13 | 14 | String jsonData = JSON.encode(mapData); // convert map to String 15 | request.send(jsonData); // perform the async POST 16 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/json-web-service/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: json_object_code 2 | description: A sample application 3 | 4 | dependencies: 5 | json_object: ">=1.0.11 <2.0.0" 6 | js: any -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/style-guide/prefer-constructors-bad.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | class Point { 4 | num x, y; 5 | Point(this.x, this.y); 6 | static Point polar(num theta, num radius) { 7 | return new Point(radius * math.cos(theta), 8 | radius * math.sin(theta)); 9 | } 10 | } 11 | 12 | main() { 13 | var p1 = new Point(0,0); 14 | var p2 = Point.polar(0,0); 15 | 16 | print('${p1.x}, ${p1.y}'); 17 | print('${p2.x}, ${p2.y}'); 18 | } 19 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/style-guide/prefer-constructors-good.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | class Point { 4 | num x, y; 5 | Point(this.x, this.y); 6 | Point.polar(num theta, num radius) 7 | : x = radius * math.cos(theta), 8 | y = radius * math.sin(theta); 9 | } 10 | 11 | main() { 12 | var p1 = new Point(0,0); 13 | var p2 = new Point.polar(0,0); 14 | 15 | print('${p1.x}, ${p1.y}'); 16 | print('${p2.x}, ${p2.y}'); 17 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/bar.txt: -------------------------------------------------------------------------------- 1 | bar1 2 | bar2 3 | bar3 4 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/ex1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | main() { 4 | foo(); 5 | var future; 6 | runZoned(() { // Starts a new child zone. 7 | future = new Future(bar).then(baz); 8 | }); 9 | future.then(qux); 10 | } 11 | 12 | foo() => print('foo'); // Executed twice (once each in two zones). 13 | bar() => print('bar'); 14 | baz(x) => runZoned(() => foo()); 15 | qux(x) => print('qux: $x'); 16 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/foo.txt: -------------------------------------------------------------------------------- 1 | foo1 2 | foo2 3 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/run_zoned1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | main() { 4 | runZoned(() { 5 | Timer.run(() { throw 'Would normally kill the program'; }); 6 | }, onError: (error, stackTrace) { 7 | print('Uncaught error: $error'); 8 | }); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/run_zoned3.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | main() { 4 | var completer = new Completer(); 5 | var future = completer.future.then((x) => x + 1); 6 | var zoneFuture; 7 | runZoned(() { 8 | zoneFuture = future.then((y) => throw 'Inside zone'); 9 | }, onError: (error) { 10 | print('Caught: $error'); 11 | }); 12 | zoneFuture.catchError((e) { print('Never reached'); }); 13 | completer.complete(499); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/specification1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | main() { 4 | runZoned(() { 5 | print('Will be ignored'); 6 | }, zoneSpecification: new ZoneSpecification( 7 | print: (self, parent, zone, message) { 8 | // Ignore message. 9 | })); 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/stream.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:async'; 3 | 4 | main() { 5 | var stream = new File('stream.dart').openRead() 6 | .map((x) => throw 'Callback throws'); 7 | 8 | runZoned(() { stream.listen(print); }, 9 | onError: (e) { print('Caught error: $e'); }); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/value1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | main() { 4 | runZoned(() { 5 | print(Zone.current[#key]); 6 | }, zoneValues: { #key: 499 }); 7 | } 8 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/value1_1.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | main() { 4 | runZoned(() { 5 | Zone.current[#key].add(499); 6 | print(Zone.current[#key]); // [499] 7 | }, zoneValues: { #key: [] }); 8 | } 9 | -------------------------------------------------------------------------------- /examples_archive/site_tests/articles/zones/value2.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'dart:io'; 4 | 5 | Future splitLinesStream(stream) { 6 | return stream 7 | .transform(ASCII.decoder) 8 | .transform(const LineSplitter()) 9 | .toList(); 10 | } 11 | 12 | Future splitLines(filename) { 13 | return splitLinesStream(new File(filename).openRead()); 14 | } 15 | main() { 16 | Future.forEach(['foo.txt', 'bar.txt'], 17 | (file) => splitLines(file) 18 | .then((lines) { lines.forEach(print); })); 19 | } -------------------------------------------------------------------------------- /examples_archive/site_tests/code/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: frontpagesamples 2 | description: Example code that appears on the front page of dartlang.org 3 | dependencies: 4 | unittest: '>=0.10.0 <0.12.0' 5 | -------------------------------------------------------------------------------- /examples_archive/site_tests/code/types_no.dart: -------------------------------------------------------------------------------- 1 | 2 | void main() { 3 | print('Hello World!'); 4 | recalculate(1, 'bob', 3); 5 | } 6 | 7 | // Without types. 8 | recalculate(origin, offset, estimate) { 9 | // ... 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/site_tests/code/types_yes.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' show Point; 2 | 3 | void main() { 4 | print('Hello, World!'); 5 | // recalculate(1, 'bob', 3); 6 | } 7 | 8 | num recalculate(Point origin, num offset, {bool estimate: false}) { 9 | // ... 10 | } 11 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/deferred_loading_example/bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:deferred_loading_example/hello.dart' deferred as hello; 2 | 3 | main() { 4 | hello.loadLibrary().then((_) => hello.printGreeting()); 5 | } 6 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/deferred_loading_example/lib/hello.dart: -------------------------------------------------------------------------------- 1 | library deferred_loading_example.hello; 2 | 3 | printGreeting() { 4 | print('Hello World, from the deferred library!'); 5 | } 6 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/deferred_loading_example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: test 2 | description: A sample web application that loads a library lazily. 3 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/deferred_loading_example/readme.md: -------------------------------------------------------------------------------- 1 | This project demonstrates the simplest example of deferred loading. 2 | 3 | The lib/hello.dart file is loaded lazily, on startup. 4 | Once loaded, the library prints a Hello World style greeting. 5 | You can run this from the command line, using 6 | `pub run bin/main', for example. 7 | 8 | For more information, see 9 | [Dart Deferred Loading](/docs/spec/deferred-loading.html). 10 | 11 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/lazyloader/lib/breakfast.dart: -------------------------------------------------------------------------------- 1 | library lazyloader.breakfast; 2 | 3 | const String menu = "Scrambled eggs, toast, berries, and coffee."; 4 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/lazyloader/lib/dinner.dart: -------------------------------------------------------------------------------- 1 | library lazyloader.dinner; 2 | 3 | const String menu = "Lasagna, green salad, garlic bread, and red wine."; 4 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/lazyloader/lib/lunch.dart: -------------------------------------------------------------------------------- 1 | library lazyloader.lunch; 2 | 3 | const String menu = "Grilled cheese sandwich, tomato soup, and juice."; 4 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/lazyloader/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: lazyloader 2 | description: A sample web application 3 | dependencies: 4 | browser: any 5 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/lazyloader/readme.md: -------------------------------------------------------------------------------- 1 | This project demonstrates a very simple example of deferred loading. 2 | 3 | The breakfast.dart, lunch.dart, and dinner.dart libraries (in /lib) 4 | are loaded lazily, when the user clicks the **Breakfast menu**, 5 | **Lunch menu**, or **Dinner menu** buttons in the browser, respectively. 6 | 7 | For more information, see 8 | [Dart Deferred Loading](/docs/spec/deferred-loading.html). 9 | 10 | -------------------------------------------------------------------------------- /examples_archive/site_tests/deferred-loading/lazyloader/web/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #F8F8F8; 3 | font-family: 'Open Sans', sans-serif; 4 | font-size: 14px; 5 | font-weight: normal; 6 | line-height: 1.2em; 7 | margin: 15px; 8 | } 9 | 10 | h1, p { 11 | color: #333; 12 | } 13 | 14 | #sample_text_id { 15 | font-size: 24pt; 16 | text-align: center; 17 | margin-top: 140px; 18 | -webkit-user-select: none; 19 | user-select: none; 20 | } 21 | -------------------------------------------------------------------------------- /examples_archive/site_tests/gists/homepage_jw/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: homepage_jw 2 | version: 0.0.1 3 | description: First example at the top of the new homepage 4 | 5 | gist: https://gist.github.com/kwalrath/a6907e26b96678b75303 6 | dartpad: https://dartpad.dartlang.org/a6907e26b96678b75303 7 | -------------------------------------------------------------------------------- /examples_archive/site_tests/gists/optional_types_article/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: optional_types_article 2 | version: 0.0.1 3 | description: Example showing a warning from the static checker 4 | 5 | gist: https://gist.github.com/Sfshaza/f046152d323ca12aadfa 6 | dartpad: https://dartpad.dartlang.org/f046152d323ca12aadfa 7 | -------------------------------------------------------------------------------- /examples_archive/site_tests/tools/observatory/profile/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: profile 2 | 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "www.dartlang.org", 3 | "version": "0.0.0", 4 | "private": true, 5 | "description": "www.dartlang.org", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/dart-lang/site-www.git" 9 | }, 10 | "devDependencies": { 11 | "firebase-tools": "^6.1.2", 12 | "superstatic": "^6.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: site_www 2 | 3 | author: Dart Team 4 | homepage: https://webdev.dartlang.org 5 | 6 | environment: 7 | sdk: '>=2.0.0 <3.0.0' 8 | 9 | dev_dependencies: 10 | build_runner: ^1.1.2 11 | code_excerpt_updater: any 12 | code_excerpter: any 13 | linkcheck: ^2.0.0+1 14 | 15 | dependency_overrides: 16 | code_excerpt_updater: 17 | git: https://github.com/chalin/code_excerpt_updater.git 18 | # path: ../code_excerpt_updater 19 | code_excerpter: 20 | git: https://github.com/chalin/code_excerpter.git 21 | # path: ../code_excerpter 22 | -------------------------------------------------------------------------------- /src/_articles/archive/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/1.png -------------------------------------------------------------------------------- /src/_articles/archive/images/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/10.png -------------------------------------------------------------------------------- /src/_articles/archive/images/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/11.png -------------------------------------------------------------------------------- /src/_articles/archive/images/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/12.png -------------------------------------------------------------------------------- /src/_articles/archive/images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/2.png -------------------------------------------------------------------------------- /src/_articles/archive/images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/3.png -------------------------------------------------------------------------------- /src/_articles/archive/images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/4.png -------------------------------------------------------------------------------- /src/_articles/archive/images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/5.png -------------------------------------------------------------------------------- /src/_articles/archive/images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/6.png -------------------------------------------------------------------------------- /src/_articles/archive/images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/7.png -------------------------------------------------------------------------------- /src/_articles/archive/images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/8.png -------------------------------------------------------------------------------- /src/_articles/archive/images/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/9.png -------------------------------------------------------------------------------- /src/_articles/archive/images/both-queues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/both-queues.png -------------------------------------------------------------------------------- /src/_articles/archive/images/chunked-conversion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/chunked-conversion.png -------------------------------------------------------------------------------- /src/_articles/archive/images/event-loop-and-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/event-loop-and-main.png -------------------------------------------------------------------------------- /src/_articles/archive/images/event-loop-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/event-loop-example.png -------------------------------------------------------------------------------- /src/_articles/archive/images/event-loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/event-loop.png -------------------------------------------------------------------------------- /src/_articles/archive/images/scheduling-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/scheduling-tasks.png -------------------------------------------------------------------------------- /src/_articles/archive/images/test-annotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/test-annotated.png -------------------------------------------------------------------------------- /src/_articles/archive/images/test-queue-output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/test-queue-output.png -------------------------------------------------------------------------------- /src/_articles/archive/images/trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_articles/archive/images/trace.png -------------------------------------------------------------------------------- /src/_articles/styles.css: -------------------------------------------------------------------------------- 1 | .zone1 { 2 | background-color: rgb(208, 211, 255); 3 | } 4 | 5 | .zone2 { 6 | background-color: rgb(195, 255, 231); 7 | } 8 | 9 | .zone3 { 10 | background-color: rgb(255, 240, 164); 11 | } 12 | 13 | .subtitle { 14 | font-size: 1.5em; 15 | color: Silver; 16 | font-weight: bold; 17 | font-style: italic; 18 | } 19 | -------------------------------------------------------------------------------- /src/_assets/css/README.md: -------------------------------------------------------------------------------- 1 | Exceptionally, we've left the prettify.css under ../js/vendor/code-prettify, since all other code-prettify files are there. 2 | -------------------------------------------------------------------------------- /src/_assets/css/_animations.scss: -------------------------------------------------------------------------------- 1 | @mixin animation($effect: fadeIn, $duration: 0.5s, $delay: 0s) { 2 | animation-name: $effect; 3 | animation-duration: $duration; 4 | animation-fill-mode: both; 5 | animation-delay: ($delay); 6 | } 7 | -------------------------------------------------------------------------------- /src/_assets/css/_books.scss: -------------------------------------------------------------------------------- 1 | .item-with-pic { 2 | display: flex; 3 | align-items: flex-start; 4 | margin-bottom: 20px; 5 | img { 6 | margin:0; 7 | max-width: none; 8 | } 9 | .details { 10 | margin-left: 20px; 11 | .title { 12 | margin: 0; 13 | } 14 | .authors { 15 | margin: 0; 16 | margin-bottom: 5px; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/_assets/css/_bootstrap_adjust.scss: -------------------------------------------------------------------------------- 1 | @mixin pre-defaults { 2 | padding: 2px 3px; // bs-spacer(3) bs-spacer(4); 3 | } 4 | 5 | b, strong { 6 | font-weight: bold; 7 | } 8 | -------------------------------------------------------------------------------- /src/_assets/css/_dartvm.scss: -------------------------------------------------------------------------------- 1 | #stable, 2 | #dev { 3 | tbody { 4 | tr { 5 | @include transition(); 6 | &.hidden { 7 | display:none; 8 | } 9 | // &:not(.hidden):nth-child(even) { 10 | // td { 11 | // background-color: $gray-lighter; 12 | // } 13 | // } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/_assets/css/_mixins.scss: -------------------------------------------------------------------------------- 1 | /* ----------------------------------------- 2 | Mixins 3 | ----------------------------------------- */ 4 | 5 | @mixin transition($duration: 0.3s, $property: all, $effect: ease-in-out) { 6 | transition: $property $duration $effect; 7 | } -------------------------------------------------------------------------------- /src/_assets/css/_site_overrides.scss: -------------------------------------------------------------------------------- 1 | // Dart-site specific style overrides 2 | 3 | .site-toc--button__page-top { display: none; } 4 | 5 | .highlight .gp { user-select: none; } 6 | -------------------------------------------------------------------------------- /src/_assets/fonts/dart.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/fonts/dart.eot -------------------------------------------------------------------------------- /src/_assets/fonts/dart.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/fonts/dart.ttf -------------------------------------------------------------------------------- /src/_assets/fonts/dart.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/fonts/dart.woff -------------------------------------------------------------------------------- /src/_assets/fonts/dart.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/fonts/dart.woff2 -------------------------------------------------------------------------------- /src/_assets/image/404-bg-pattern.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/404-bg-pattern.jpg -------------------------------------------------------------------------------- /src/_assets/image/adwords-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/adwords-screenshot.png -------------------------------------------------------------------------------- /src/_assets/image/bare-bones-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/bare-bones-todo.png -------------------------------------------------------------------------------- /src/_assets/image/bare-bones-web-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/bare-bones-web-app.png -------------------------------------------------------------------------------- /src/_assets/image/chrome-devtools-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/chrome-devtools-screenshot.png -------------------------------------------------------------------------------- /src/_assets/image/cover/aprende-dart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/aprende-dart.jpg -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-by-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-by-example.png -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-cookbook.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-cookbook.jpg -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-essentials-sikora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-essentials-sikora.png -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-for-absolute-beginners.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-for-absolute-beginners.jpg -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-for-hipsters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-for-hipsters.png -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-in-action.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-in-action.jpg -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-programming-language.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-programming-language.jpg -------------------------------------------------------------------------------- /src/_assets/image/cover/dart-up-and-running.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/dart-up-and-running.gif -------------------------------------------------------------------------------- /src/_assets/image/cover/learning-dart-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/learning-dart-video.png -------------------------------------------------------------------------------- /src/_assets/image/cover/learning-dart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/learning-dart.png -------------------------------------------------------------------------------- /src/_assets/image/cover/mastering-dart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/mastering-dart.jpg -------------------------------------------------------------------------------- /src/_assets/image/cover/scalable-app-development.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/scalable-app-development.png -------------------------------------------------------------------------------- /src/_assets/image/cover/web-programming-with-dart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/cover/web-programming-with-dart.jpg -------------------------------------------------------------------------------- /src/_assets/image/dartpad-hello.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/dartpad-hello.png -------------------------------------------------------------------------------- /src/_assets/image/ff-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/ff-debug.png -------------------------------------------------------------------------------- /src/_assets/image/green-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/green-run.png -------------------------------------------------------------------------------- /src/_assets/image/guides/analysis-options-directory-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/guides/analysis-options-directory-structure.png -------------------------------------------------------------------------------- /src/_assets/image/guides/avoid-empty-statements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/guides/avoid-empty-statements.png -------------------------------------------------------------------------------- /src/_assets/image/guides/close-sinks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/guides/close-sinks.png -------------------------------------------------------------------------------- /src/_assets/image/ic_link_black_24px.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/_assets/image/libraries/import-lib-rules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/libraries/import-lib-rules.png -------------------------------------------------------------------------------- /src/_assets/image/libraries/shelf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/libraries/shelf.png -------------------------------------------------------------------------------- /src/_assets/image/libraries/simple-lib2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/libraries/simple-lib2.png -------------------------------------------------------------------------------- /src/_assets/image/red-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/red-run.png -------------------------------------------------------------------------------- /src/_assets/image/shared: -------------------------------------------------------------------------------- 1 | ../../_shared/_assets/image/ -------------------------------------------------------------------------------- /src/_assets/image/tools/android_studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/android_studio.png -------------------------------------------------------------------------------- /src/_assets/image/tools/atom-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/atom-logo.png -------------------------------------------------------------------------------- /src/_assets/image/tools/emacs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/emacs.png -------------------------------------------------------------------------------- /src/_assets/image/tools/pub/PubConstraintsDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/pub/PubConstraintsDiagram.png -------------------------------------------------------------------------------- /src/_assets/image/tools/pub/PubExportedConstraints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/pub/PubExportedConstraints.png -------------------------------------------------------------------------------- /src/_assets/image/tools/vim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/vim.png -------------------------------------------------------------------------------- /src/_assets/image/tools/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/tools/vscode.png -------------------------------------------------------------------------------- /src/_assets/image/touch-icon-ipad-retina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/touch-icon-ipad-retina.png -------------------------------------------------------------------------------- /src/_assets/image/touch-icon-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/touch-icon-ipad.png -------------------------------------------------------------------------------- /src/_assets/image/touch-icon-iphone-retina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/touch-icon-iphone-retina.png -------------------------------------------------------------------------------- /src/_assets/image/touch-icon-iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_assets/image/touch-icon-iphone.png -------------------------------------------------------------------------------- /src/_data/pkg-vers.json: -------------------------------------------------------------------------------- 1 | { 2 | "SDK": { 3 | "doc-path": "install", 4 | "channel": "stable", 5 | "prev-vers": "1.24.3", 6 | "vers": "2.4" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/_guides/language/images/consumer-producer-methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_guides/language/images/consumer-producer-methods.png -------------------------------------------------------------------------------- /src/_guides/language/images/type-hierarchy-generics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_guides/language/images/type-hierarchy-generics.png -------------------------------------------------------------------------------- /src/_guides/language/images/type-hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_guides/language/images/type-hierarchy.png -------------------------------------------------------------------------------- /src/_guides/language/specifications/DartLangSpec-v2.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_guides/language/specifications/DartLangSpec-v2.2.pdf -------------------------------------------------------------------------------- /src/_guides/libraries/images/then_and_catcherror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_guides/libraries/images/then_and_catcherror.png -------------------------------------------------------------------------------- /src/_includes/analytics.html: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /src/_includes/article_index_warning.md: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /src/_includes/article_summary.html: -------------------------------------------------------------------------------- 1 |

{{ article.title }}

2 | {{ article.original-date | default: article.date | date: '%B %Y' }} {% if article.original-date %}(updated: {{ article.date | date: '%B %Y' }}){% endif %} 3 |

{{ article.description }}

4 | -------------------------------------------------------------------------------- /src/_includes/async-await-2.0.md: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/_includes/banner.html: -------------------------------------------------------------------------------- 1 | {% comment %}Drop the div .alert classes to revert to the default banner styling.{% endcomment -%} 2 | 9 | -------------------------------------------------------------------------------- /src/_includes/capture_output.html: -------------------------------------------------------------------------------- 1 |

Here ya go: {{ test }}

2 | -------------------------------------------------------------------------------- /src/_includes/flutter-packages.md: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/_includes/linter-rule.html: -------------------------------------------------------------------------------- 1 | {:.linter-rule} 2 | {% if include.rule %} 3 | Linter rule: {{ include.rule }} 4 | {% else %} 5 | Linter rules: {{ include.rule1 }}, {{ include.rule2 }} 6 | {% endif %} 7 | -------------------------------------------------------------------------------- /src/_includes/navigation-sub.html: -------------------------------------------------------------------------------- 1 | {% if page.nextpage.url or page.prevpage.url %} 2 | 16 | {% endif %} 17 | -------------------------------------------------------------------------------- /src/_includes/packages-dir.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/_includes/page-header.html: -------------------------------------------------------------------------------- 1 | 11 | {% if site.show_banner %} {% include banner.html %} {% endif %} 12 | -------------------------------------------------------------------------------- /src/_includes/pub-in-prereleases.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /src/_includes/shared: -------------------------------------------------------------------------------- 1 | ../_shared/_includes -------------------------------------------------------------------------------- /src/_includes/tools/jetbrains-reporting-issues.html: -------------------------------------------------------------------------------- 1 | Please report issues and feedback via the official 2 | [JetBrains issue tracker for Dart.](https://youtrack.jetbrains.com/issues/WEB?q=Subsystem%3A+Dart) 3 | Include details of the expected behavior, the actual behavior, 4 | and screenshots if appropriate. 5 | -------------------------------------------------------------------------------- /src/_includes/tools/pub-was-a-builder.md: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /src/_includes/tutorial-banner.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/_layouts/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include page-header.html %} 6 | {% include navigation-side.html %} 7 |
8 |
9 | {{ content }} 10 |
11 |
12 | {% include page-footer.html %} 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/_layouts/homepage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include page-header.html %} 6 | {% include navigation-side.html %} 7 |
8 | {{ content }} 9 |
10 | {% include page-footer.html %} 11 | 12 | -------------------------------------------------------------------------------- /src/_plugins/breadcrumb.rb: -------------------------------------------------------------------------------- 1 | ../_shared/_plugins/breadcrumb.rb -------------------------------------------------------------------------------- /src/_plugins/date_to_rfc2822.rb: -------------------------------------------------------------------------------- 1 | require 'time' 2 | 3 | module RFC2822Filter 4 | def date_to_rfc2822(input) 5 | if input == 'now' 6 | Time.new.rfc2822 7 | else 8 | # input might be a date and not a string 9 | Time.parse(input.to_s).rfc2822 10 | end 11 | end 12 | end 13 | 14 | Liquid::Template.register_filter(RFC2822Filter) -------------------------------------------------------------------------------- /src/_plugins/format_num_filter.rb: -------------------------------------------------------------------------------- 1 | module FormatNumFilter 2 | def format_num(input, fmt) 3 | fmt % input 4 | end 5 | end 6 | 7 | Liquid::Template.register_filter(FormatNumFilter) -------------------------------------------------------------------------------- /src/_plugins/load-bootstrap-sass.rb: -------------------------------------------------------------------------------- 1 | # Register path to bootstrap-sass for bootstrap 3 2 | # TODO: drop if/when we migrate to bootstrap 4 3 | 4 | Jekyll::Assets::Utils.activate "bootstrap-sass" do 5 | Bootstrap.load! 6 | end 7 | -------------------------------------------------------------------------------- /src/_plugins/prettify.rb: -------------------------------------------------------------------------------- 1 | ../_shared/_plugins/prettify.rb -------------------------------------------------------------------------------- /src/_plugins/regex_replace_filter.rb: -------------------------------------------------------------------------------- 1 | ../_shared/_plugins/regex_replace_filter.rb -------------------------------------------------------------------------------- /src/_plugins/sidenav-active-entry-filter.rb: -------------------------------------------------------------------------------- 1 | ../_shared/_plugins/sidenav-active-entry-filter.rb -------------------------------------------------------------------------------- /src/_plugins/strip_html_filter.rb: -------------------------------------------------------------------------------- 1 | module StripHtmlFilter 2 | def self.strip_html(input) 3 | input.to_s.gsub(/<\/?[^>]*>/,"") 4 | end 5 | end 6 | 7 | Liquid::Template.register_filter(StripHtmlFilter) -------------------------------------------------------------------------------- /src/_plugins/svg_mime_type.rb: -------------------------------------------------------------------------------- 1 | require 'webrick' 2 | include WEBrick 3 | WEBrick::HTTPUtils::DefaultMimeTypes.store 'svg', 'image/svg+xml' -------------------------------------------------------------------------------- /src/_plugins/symlinked_sources_listener.rb: -------------------------------------------------------------------------------- 1 | ../_shared/_plugins/symlinked_sources_listener.rb -------------------------------------------------------------------------------- /src/_shared: -------------------------------------------------------------------------------- 1 | ../site-shared/src -------------------------------------------------------------------------------- /src/_tutorials/images/async-await.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/async-await.png -------------------------------------------------------------------------------- /src/_tutorials/images/futures-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/futures-code.png -------------------------------------------------------------------------------- /src/_tutorials/images/housekeeping-files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/housekeeping-files.png -------------------------------------------------------------------------------- /src/_tutorials/images/libraries-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/libraries-folder.png -------------------------------------------------------------------------------- /src/_tutorials/images/other-folders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/other-folders.png -------------------------------------------------------------------------------- /src/_tutorials/images/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/run.png -------------------------------------------------------------------------------- /src/_tutorials/images/streams-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/streams-code.png -------------------------------------------------------------------------------- /src/_tutorials/images/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/target.png -------------------------------------------------------------------------------- /src/_tutorials/images/tute-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/images/tute-home.png -------------------------------------------------------------------------------- /src/_tutorials/libraries/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Dart tutorials: libraries" 3 | description: "Tutorials relating to Dart's core libraries and APIs." 4 | toc: false 5 | --- 6 | 7 | Dart developers have been busy creating code libraries that can help you 8 | be more productive. Leverage that code or put your code out in the world 9 | to share with others. 10 | 11 | * [Install shared packages](/tutorials/libraries/shared-pkgs). 12 | Organize and share code at the [Pub site]({{site.pub}}). 13 | 14 | -------------------------------------------------------------------------------- /src/_tutorials/server/images/commandlineargs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/commandlineargs.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/dartvm-cmd-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/dartvm-cmd-line.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/flowchart.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/function-parts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/function-parts.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/guessing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/guessing.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/hello_world_response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/hello_world_response.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/index_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/index_file.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/index_file_4046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/index_file_4046.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/pub-directory-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/pub-directory-structure.png -------------------------------------------------------------------------------- /src/_tutorials/server/images/signature-parts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/server/images/signature-parts.png -------------------------------------------------------------------------------- /src/_tutorials/server/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Tutorials: command-line apps and servers' 3 | description: Tutorials for writing command-line apps and servers. 4 | --- 5 | 6 | {% include server-tutorials.md %} 7 | 8 | For more tutorials, see the [Dart tutorials page](/tutorials). -------------------------------------------------------------------------------- /src/_tutorials/web/images/0-mini-code-walk-through.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/0-mini-code-walk-through.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/add-element-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/add-element-code.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/add-element.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/add-element.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/anagram-move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/anagram-move.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/anagram-newletters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/anagram-newletters.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/child-references.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/child-references.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/client-server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/client-server.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/css-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/css-code.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/css-property-value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/css-property-value.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/css-rule-explained.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/css-rule-explained.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/dart-html-connect-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/dart-html-connect-full.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/dart-html-connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/dart-html-connect.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/dynamic-dart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/dynamic-dart.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/event-handler-idiom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/event-handler-idiom.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/event-handler-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/event-handler-todo.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/event-listener-exp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/event-listener-exp.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/jsonstring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/jsonstring.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/paragraph-dom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/paragraph-dom.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/parent-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/parent-reference.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/portmanteaux-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/portmanteaux-code.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/relationships.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/relationships.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/remove-all-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/remove-all-code.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/remove-all-elements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/remove-all-elements.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/remove-element-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/remove-element-code.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/remove-element.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/remove-element.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/run.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/set-callback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/set-callback.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/simple-dom-tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/simple-dom-tree.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/simple-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/simple-html.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/todo-dart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/todo-dart.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/todo-dom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/todo-dom.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/todo-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/todo-html.png -------------------------------------------------------------------------------- /src/_tutorials/web/images/uri-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/_tutorials/web/images/uri-details.png -------------------------------------------------------------------------------- /src/_tutorials/web/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Tutorials: web apps' 3 | description: Tutorials for writing Dart web apps. 4 | --- 5 | 6 | {% include web-tutorials.md %} 7 | 8 | For more tutorials, see the [Dart tutorials page](/tutorials). 9 | -------------------------------------------------------------------------------- /src/assets/dash/1x/1-1 async await-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/1-1 async await-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/1-2 language optimized-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/1-2 language optimized-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/1-3 familiar syntax-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/1-3 familiar syntax-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/2-1 hot reload iterative changes-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/2-1 hot reload iterative changes-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/2-2 flexible type-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/2-2 flexible type-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/2-3 runtime insights-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/2-3 runtime insights-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/3-1 - aot compile-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/3-1 - aot compile-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/3-2 target web-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/3-2 target web-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/3-3 backend code-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/3-3 backend code-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/bg-pattern.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/bg-pattern.jpg -------------------------------------------------------------------------------- /src/assets/dash/1x/client optimised light op1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/client optimised light op1.png -------------------------------------------------------------------------------- /src/assets/dash/1x/icon_pub dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/icon_pub dev.png -------------------------------------------------------------------------------- /src/assets/dash/1x/logo_dart packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/logo_dart packages.png -------------------------------------------------------------------------------- /src/assets/dash/1x/logo_lockup_dart_horizontal_wht.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/logo_lockup_dart_horizontal_wht.png -------------------------------------------------------------------------------- /src/assets/dash/1x/made by google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/made by google.png -------------------------------------------------------------------------------- /src/assets/dash/1x/multiplatform performance light op1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/multiplatform performance light op1.png -------------------------------------------------------------------------------- /src/assets/dash/1x/productive dev light op1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/productive dev light op1.png -------------------------------------------------------------------------------- /src/assets/dash/1x/slideover menu_45px example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/1x/slideover menu_45px example.png -------------------------------------------------------------------------------- /src/assets/dash/2x/1-1 async await@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/1-1 async await@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/1-2 language optimized@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/1-2 language optimized@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/1-3 familiar syntax@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/1-3 familiar syntax@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/2-1 hot reload iterative changes@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/2-1 hot reload iterative changes@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/2-2 flexible type@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/2-2 flexible type@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/2-3 runtime insights@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/2-3 runtime insights@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/3-1 - aot compile@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/3-1 - aot compile@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/3-2 target web@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/3-2 target web@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/3-3 backend code@2x-80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/3-3 backend code@2x-80.jpg -------------------------------------------------------------------------------- /src/assets/dash/2x/bullet-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/bullet-black.png -------------------------------------------------------------------------------- /src/assets/dash/2x/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/bullet.png -------------------------------------------------------------------------------- /src/assets/dash/2x/client optimised light op1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/client optimised light op1@2x.png -------------------------------------------------------------------------------- /src/assets/dash/2x/icon_pub dev@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/icon_pub dev@2x.png -------------------------------------------------------------------------------- /src/assets/dash/2x/logo_dart packages@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/logo_dart packages@2x.png -------------------------------------------------------------------------------- /src/assets/dash/2x/logo_lockup_dart_horizontal_wht@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/logo_lockup_dart_horizontal_wht@2x.png -------------------------------------------------------------------------------- /src/assets/dash/2x/made by google@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/made by google@2x.png -------------------------------------------------------------------------------- /src/assets/dash/2x/multiplatform performance light op1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/multiplatform performance light op1@2x.png -------------------------------------------------------------------------------- /src/assets/dash/2x/paint-your-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/paint-your-ui.png -------------------------------------------------------------------------------- /src/assets/dash/2x/productive dev light op1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/2x/productive dev light op1@2x.png -------------------------------------------------------------------------------- /src/assets/dash/video/hotreload.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/video/hotreload.mp4 -------------------------------------------------------------------------------- /src/assets/dash/video/hotreload.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/assets/dash/video/hotreload.webm -------------------------------------------------------------------------------- /src/assets/shared: -------------------------------------------------------------------------------- 1 | ../_shared/assets -------------------------------------------------------------------------------- /src/codelabs/images/from-java-to-dart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/codelabs/images/from-java-to-dart.png -------------------------------------------------------------------------------- /src/diagrams/articles/converters-and-codecs/chunked-conversion.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/articles/converters-and-codecs/chunked-conversion.graffle/image1.png -------------------------------------------------------------------------------- /src/diagrams/articles/event-loop/event-loop.graffle/image4.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/articles/event-loop/event-loop.graffle/image4.tiff -------------------------------------------------------------------------------- /src/diagrams/guides/analysis-options-directory-structure.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/guides/analysis-options-directory-structure.graffle -------------------------------------------------------------------------------- /src/diagrams/guides/type-hierarchy.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/guides/type-hierarchy.graffle -------------------------------------------------------------------------------- /src/diagrams/tools/MobileDeployment.graffle/image1.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/MobileDeployment.graffle/image1.tiff -------------------------------------------------------------------------------- /src/diagrams/tools/MobileDeployment.graffle/image10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/MobileDeployment.graffle/image10.pdf -------------------------------------------------------------------------------- /src/diagrams/tools/MobileDeployment.graffle/image12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/MobileDeployment.graffle/image12.pdf -------------------------------------------------------------------------------- /src/diagrams/tools/MobileDeployment.graffle/image6.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/MobileDeployment.graffle/image6.tiff -------------------------------------------------------------------------------- /src/diagrams/tools/MobileDeployment.graffle/image9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/MobileDeployment.graffle/image9.pdf -------------------------------------------------------------------------------- /src/diagrams/tools/PubConstraintsDiagram.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/PubConstraintsDiagram.graffle -------------------------------------------------------------------------------- /src/diagrams/tools/PubExportedConstraints.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tools/PubExportedConstraints.graffle -------------------------------------------------------------------------------- /src/diagrams/tutorials/README.md: -------------------------------------------------------------------------------- 1 | dart-tutorials-images 2 | ===================== -------------------------------------------------------------------------------- /src/diagrams/tutorials/futures/async-await.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/futures/async-await.graffle -------------------------------------------------------------------------------- /src/diagrams/tutorials/get-started/dart-editor-ui.graffle/data.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/get-started/dart-editor-ui.graffle/data.plist -------------------------------------------------------------------------------- /src/diagrams/tutorials/get-started/dart-editor-ui.graffle/image4.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/get-started/dart-editor-ui.graffle/image4.tiff -------------------------------------------------------------------------------- /src/diagrams/tutorials/get-started/dartvm-js.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/get-started/dartvm-js.graffle/image1.png -------------------------------------------------------------------------------- /src/diagrams/tutorials/newbanner.graffle/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/newbanner.graffle/image10.png -------------------------------------------------------------------------------- /src/diagrams/tutorials/shared-pkgs/package-files.graffle/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/shared-pkgs/package-files.graffle/image1.png -------------------------------------------------------------------------------- /src/diagrams/tutorials/top-level-banner.graffle/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dartchina/site-www-cn/171c9edc87c3d40ce396d95fcc4dd8f8b012c27c/src/diagrams/tutorials/top-level-banner.graffle/image3.png -------------------------------------------------------------------------------- /src/f/README: -------------------------------------------------------------------------------- 1 | Welcome to the home for files used by samples! 2 | 3 | This is where you can put files that a sample app might read. 4 | 5 | Please make sure that any content is copyright free 6 | (such as Jabberwocky by Lewis Carroll). 7 | 8 | The dartlang site is set up with CORS headers so that apps, 9 | such as DartPad, can read these files. 10 | Sample apps can only read these files--they can't 11 | write to, or modify, the files in any way. 12 | -------------------------------------------------------------------------------- /src/f/dailyNewsDigest.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/f/portmanteaux.json: -------------------------------------------------------------------------------- 1 | [ 2 | "portmanteau", "fantabulous", "spork", "smog", 3 | "spanglish", "gerrymander", "turducken", "stagflation", 4 | "bromance", "freeware", "oxbridge", "palimony", "netiquette", 5 | "brunch", "blog", "chortle", "Hassenpfeffer", "Schnitzelbank" 6 | ] 7 | -------------------------------------------------------------------------------- /src/resources/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Resources 3 | description: Landing page for dartlang's resources. 4 | toc: false 5 | --- 6 | 7 | Check out the following Dart language resources: 8 | 9 | {% comment %} PENDING: Add links to other resources if we keep the Resources menu. 10 | {% endcomment %} 11 | 12 |
13 |
14 |

Books on Dart

15 |

A collection of books about Dart.

16 |
17 |
18 | -------------------------------------------------------------------------------- /src/robots.txt: -------------------------------------------------------------------------------- 1 | _shared/robots.txt -------------------------------------------------------------------------------- /src/sitemap.xml: -------------------------------------------------------------------------------- 1 | _shared/sitemap.xml -------------------------------------------------------------------------------- /src/tools/sdk: -------------------------------------------------------------------------------- 1 | ../_shared/tools/sdk -------------------------------------------------------------------------------- /tool/before-install.sh: -------------------------------------------------------------------------------- 1 | shared/before-install.sh -------------------------------------------------------------------------------- /tool/config/linkcheck-skip-list.txt: -------------------------------------------------------------------------------- 1 | # Enter regexp pattern, one per line. 2 | 3 | # FIXME(Temporary): linkcheck seems to be intermittently failing when accessing main.css 4 | # https://github.com/dart-lang/site-www/issues/1107 5 | /assets/main(-[0-9a-f]+)?.css 6 | -------------------------------------------------------------------------------- /tool/env-set.sh: -------------------------------------------------------------------------------- 1 | # This bash file is meant to be source'd, not executed. 2 | 3 | source tool/shared/env-set.sh 4 | 5 | # site-www specific settings here: currently, none. 6 | -------------------------------------------------------------------------------- /tool/frontpage_only_config.yml: -------------------------------------------------------------------------------- 1 | exclude: 2 | # These are copied from the main _config.yml. 3 | - diagrams 4 | - appengine 5 | - tests 6 | - site 7 | # These speed up the build when all you worry about is the frontpage. 8 | - _articles 9 | - _tutorials 10 | - _guides/language 11 | - _guides/libraries 12 | - tools 13 | - install 14 | - resources -------------------------------------------------------------------------------- /tool/install.sh: -------------------------------------------------------------------------------- 1 | shared/install.sh -------------------------------------------------------------------------------- /tool/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: site_scripts 2 | description: Utility scripts 3 | 4 | dependencies: 5 | html_unescape: ^1.0.0 6 | http: ^0.12.0 7 | logging: ^0.11.3+1 8 | path: ^1.4.0 9 | -------------------------------------------------------------------------------- /tool/serve.sh: -------------------------------------------------------------------------------- 1 | shared/serve.sh -------------------------------------------------------------------------------- /tool/shared: -------------------------------------------------------------------------------- 1 | ../site-shared/tool/ -------------------------------------------------------------------------------- /tool/youtube.dart: -------------------------------------------------------------------------------- 1 | library youtube; 2 | 3 | import 'dart:convert'; 4 | import 'dart:async'; 5 | 6 | import 'package:http/http.dart' as http; 7 | 8 | final String YT_PLAYLIST_URL = 'http://gdata.youtube.com/feeds/api/playlists/'; 9 | 10 | Future fetchPlaylist(String playlistId) { 11 | var uri = Uri.parse('$YT_PLAYLIST_URL$playlistId?alt=json'); 12 | return http.get(uri).then((resp) => jsonDecode(resp.body)); 13 | } 14 | --------------------------------------------------------------------------------