title: how to properly build.yaml?
body: <p>I just started to learn Flutter.
  I use vscode as editor</p>
  <p>I need to use json_serializable on my code.
  I read <a href="https://pub.dev/packages/json_serializable" rel="noreferrer">https://pub.dev/packages/json_serializable</a> and make my build.yaml just like what show there.</p>
  <pre><code>targets:
    $default:
      builders:
        json_serializable:
          options:
            # Options configure how source code is generated for every
            # `@JsonSerializable`-annotated class in the package.
            #
            # The default value for each is listed.
            any_map: false
            checked: false
            constructor: &quot;&quot;
            create_factory: true
            create_to_json: true
            disallow_unrecognized_keys: false
            explicit_to_json: false
            field_rename: none
            generic_argument_factories: false
            ignore_unannotated: false
            include_if_null: true
  </code></pre>
  <p>but vscode say : Property targets is not allowed. yaml-schema: Hammerkit YAML Schema [1,1]</p>
  <p>FYI, here is my pubspec.lock</p>
  <pre><code># Generated by pub
  # See https://dart.dev/tools/pub/glossary#lockfile
  packages:
    _fe_analyzer_shared:
      dependency: transitive
      description:
        name: _fe_analyzer_shared
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;29.0.0&quot;
    analyzer:
      dependency: transitive
      description:
        name: analyzer
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.6.0&quot;
    args:
      dependency: transitive
      description:
        name: args
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.3.0&quot;
    async:
      dependency: transitive
      description:
        name: async
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.8.1&quot;
    auto_route:
      dependency: &quot;direct main&quot;
      description:
        name: auto_route
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.1&quot;
    auto_route_generator:
      dependency: &quot;direct dev&quot;
      description:
        name: auto_route_generator
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.1&quot;
    boolean_selector:
      dependency: transitive
      description:
        name: boolean_selector
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    build:
      dependency: transitive
      description:
        name: build
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.1&quot;
    build_config:
      dependency: transitive
      description:
        name: build_config
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0&quot;
    build_daemon:
      dependency: transitive
      description:
        name: build_daemon
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.1&quot;
    build_resolvers:
      dependency: transitive
      description:
        name: build_resolvers
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.4&quot;
    build_runner:
      dependency: &quot;direct dev&quot;
      description:
        name: build_runner
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.5&quot;
    build_runner_core:
      dependency: transitive
      description:
        name: build_runner_core
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;7.2.2&quot;
    built_collection:
      dependency: transitive
      description:
        name: built_collection
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;5.1.1&quot;
    built_value:
      dependency: transitive
      description:
        name: built_value
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;8.1.2&quot;
    characters:
      dependency: transitive
      description:
        name: characters
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.1.0&quot;
    charcode:
      dependency: transitive
      description:
        name: charcode
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.3.1&quot;
    checked_yaml:
      dependency: transitive
      description:
        name: checked_yaml
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.1&quot;
    cli_util:
      dependency: transitive
      description:
        name: cli_util
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.3.5&quot;
    clock:
      dependency: transitive
      description:
        name: clock
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.1.0&quot;
    code_builder:
      dependency: transitive
      description:
        name: code_builder
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;4.1.0&quot;
    collection:
      dependency: transitive
      description:
        name: collection
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.15.0&quot;
    convert:
      dependency: transitive
      description:
        name: convert
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.1&quot;
    crypto:
      dependency: transitive
      description:
        name: crypto
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.1&quot;
    cupertino_icons:
      dependency: &quot;direct main&quot;
      description:
        name: cupertino_icons
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.3&quot;
    dart_style:
      dependency: transitive
      description:
        name: dart_style
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.2.0&quot;
    dartz:
      dependency: &quot;direct main&quot;
      description:
        name: dartz
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.10.0&quot;
    dio:
      dependency: &quot;direct main&quot;
      description:
        name: dio
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;4.0.0&quot;
    fake_async:
      dependency: transitive
      description:
        name: fake_async
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.2.0&quot;
    ffi:
      dependency: transitive
      description:
        name: ffi
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.1.2&quot;
    file:
      dependency: transitive
      description:
        name: file
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;6.1.2&quot;
    fixnum:
      dependency: transitive
      description:
        name: fixnum
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0&quot;
    flash:
      dependency: &quot;direct main&quot;
      description:
        name: flash
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.3&quot;
    flutter:
      dependency: &quot;direct main&quot;
      description: flutter
      source: sdk
      version: &quot;0.0.0&quot;
    flutter_hooks:
      dependency: &quot;direct main&quot;
      description:
        name: flutter_hooks
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.18.0&quot;
    flutter_riverpod:
      dependency: transitive
      description:
        name: flutter_riverpod
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0-dev.11&quot;
    flutter_secure_storage:
      dependency: &quot;direct main&quot;
      description:
        name: flutter_secure_storage
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;4.2.1&quot;
    flutter_test:
      dependency: &quot;direct dev&quot;
      description: flutter
      source: sdk
      version: &quot;0.0.0&quot;
    freezed:
      dependency: &quot;direct dev&quot;
      description:
        name: freezed
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.15.0+1&quot;
    freezed_annotation:
      dependency: &quot;direct main&quot;
      description:
        name: freezed_annotation
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.15.0&quot;
    frontend_server_client:
      dependency: transitive
      description:
        name: frontend_server_client
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.2&quot;
    glob:
      dependency: transitive
      description:
        name: glob
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.2&quot;
    graphs:
      dependency: transitive
      description:
        name: graphs
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    hooks_riverpod:
      dependency: &quot;direct main&quot;
      description:
        name: hooks_riverpod
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0-dev.11&quot;
    http:
      dependency: transitive
      description:
        name: http
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.13.4&quot;
    http_multi_server:
      dependency: transitive
      description:
        name: http_multi_server
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.1&quot;
    http_parser:
      dependency: transitive
      description:
        name: http_parser
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;4.0.0&quot;
    io:
      dependency: transitive
      description:
        name: io
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.3&quot;
    js:
      dependency: transitive
      description:
        name: js
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.6.3&quot;
    json_annotation:
      dependency: &quot;direct main&quot;
      description:
        name: json_annotation
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;4.3.0&quot;
    json_serializable:
      dependency: &quot;direct dev&quot;
      description:
        name: json_serializable
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;6.0.1&quot;
    lint:
      dependency: &quot;direct dev&quot;
      description:
        name: lint
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.7.2&quot;
    logging:
      dependency: transitive
      description:
        name: logging
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.2&quot;
    matcher:
      dependency: transitive
      description:
        name: matcher
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.12.10&quot;
    material_design_icons_flutter:
      dependency: &quot;direct main&quot;
      description:
        name: material_design_icons_flutter
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;5.0.6295&quot;
    meta:
      dependency: transitive
      description:
        name: meta
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.7.0&quot;
    mime:
      dependency: transitive
      description:
        name: mime
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0&quot;
    oauth2:
      dependency: &quot;direct main&quot;
      description:
        name: oauth2
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.0&quot;
    package_config:
      dependency: transitive
      description:
        name: package_config
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.2&quot;
    path:
      dependency: &quot;direct main&quot;
      description:
        name: path
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.8.0&quot;
    path_provider:
      dependency: &quot;direct main&quot;
      description:
        name: path_provider
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.6&quot;
    path_provider_linux:
      dependency: transitive
      description:
        name: path_provider_linux
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    path_provider_macos:
      dependency: transitive
      description:
        name: path_provider_macos
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.2&quot;
    path_provider_platform_interface:
      dependency: transitive
      description:
        name: path_provider_platform_interface
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.1&quot;
    path_provider_windows:
      dependency: transitive
      description:
        name: path_provider_windows
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.3&quot;
    platform:
      dependency: transitive
      description:
        name: platform
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.2&quot;
    plugin_platform_interface:
      dependency: transitive
      description:
        name: plugin_platform_interface
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.2&quot;
    pool:
      dependency: transitive
      description:
        name: pool
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.5.0&quot;
    process:
      dependency: transitive
      description:
        name: process
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;4.2.4&quot;
    pub_semver:
      dependency: transitive
      description:
        name: pub_semver
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    pubspec_parse:
      dependency: transitive
      description:
        name: pubspec_parse
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.1.0&quot;
    riverpod:
      dependency: transitive
      description:
        name: riverpod
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0-dev.10&quot;
    sembast:
      dependency: &quot;direct main&quot;
      description:
        name: sembast
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.1.1&quot;
    shelf:
      dependency: transitive
      description:
        name: shelf
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.2.0&quot;
    shelf_web_socket:
      dependency: transitive
      description:
        name: shelf_web_socket
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.1&quot;
    sky_engine:
      dependency: transitive
      description: flutter
      source: sdk
      version: &quot;0.0.99&quot;
    source_gen:
      dependency: transitive
      description:
        name: source_gen
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.1.1&quot;
    source_helper:
      dependency: transitive
      description:
        name: source_helper
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.3.0&quot;
    source_span:
      dependency: transitive
      description:
        name: source_span
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.8.1&quot;
    stack_trace:
      dependency: transitive
      description:
        name: stack_trace
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.10.0&quot;
    state_notifier:
      dependency: transitive
      description:
        name: state_notifier
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.7.1&quot;
    stream_channel:
      dependency: transitive
      description:
        name: stream_channel
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    stream_transform:
      dependency: transitive
      description:
        name: stream_transform
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.0&quot;
    string_scanner:
      dependency: transitive
      description:
        name: string_scanner
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.1.0&quot;
    synchronized:
      dependency: transitive
      description:
        name: synchronized
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.0.0&quot;
    term_glyph:
      dependency: transitive
      description:
        name: term_glyph
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.2.0&quot;
    test_api:
      dependency: transitive
      description:
        name: test_api
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.4.2&quot;
    timing:
      dependency: transitive
      description:
        name: timing
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.0&quot;
    typed_data:
      dependency: transitive
      description:
        name: typed_data
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.3.0&quot;
    vector_math:
      dependency: transitive
      description:
        name: vector_math
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    watcher:
      dependency: transitive
      description:
        name: watcher
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.0.1&quot;
    web_socket_channel:
      dependency: transitive
      description:
        name: web_socket_channel
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.0&quot;
    webview_flutter:
      dependency: &quot;direct main&quot;
      description:
        name: webview_flutter
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.1.1&quot;
    webview_flutter_android:
      dependency: transitive
      description:
        name: webview_flutter_android
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.15&quot;
    webview_flutter_platform_interface:
      dependency: transitive
      description:
        name: webview_flutter_platform_interface
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;1.2.0&quot;
    webview_flutter_wkwebview:
      dependency: transitive
      description:
        name: webview_flutter_wkwebview
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.0.14&quot;
    win32:
      dependency: transitive
      description:
        name: win32
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;2.2.10&quot;
    xdg_directories:
      dependency: transitive
      description:
        name: xdg_directories
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;0.2.0&quot;
    yaml:
      dependency: transitive
      description:
        name: yaml
        url: &quot;https://pub.dartlang.org&quot;
      source: hosted
      version: &quot;3.1.0&quot;
  sdks:
    dart: &quot;&gt;=2.14.0 &lt;3.0.0&quot;
    flutter: &quot;&gt;=2.5.0&quot;
  </code></pre>
  <p>So kindly pelase tell me how to write proper build.yaml for flutter.</p>
  <p>Note : I need to change explicit_to_json value to true</p>
  <p>Sincerely</p>
  <p>-bino-</p>