Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flutter Lintツールを完全に理解した

Flutter Lintツールを完全に理解した

Flutter Lintツールを完全に理解した
完全に理解したTalkの32回目開催回のトーク資料です。

#flutter
#flutterjp
#完全に理解したTalk

Kenichi Kambara

August 25, 2022
Tweet

More Decks by Kenichi Kambara

Other Decks in Technology

Transcript

  1. About me •Mobile App Development •Speeches (e.g. 9 International confs.)

    •Writings (e.g. 6 Dev Books) •[Of fi cial] Evangelist at NTT TechnoCross •[Private] iplatform.org ਆݪɹ݈Ұ (@korodroid)
  2.  Walking through “ fl utter.yaml” # Recommended lints for

    Flutter apps, packages, and plugins. include: package:lints/recommended.yaml linter: rules: - avoid_print - avoid_unnecessary_containers - avoid_web_libraries_in_ fl utter - no_logic_in_create_state - prefer_const_constructors - prefer_const_constructors_in_immutables - prefer_const_declarations - prefer_const_literals_to_create_immutables - sized_box_for_whitespace - sort_child_properties_last - use_build_context_synchronously - use_full_hex_values_for_ fl utter_colors - use_key_in_widget_constructors
  3.  # Recommended lints for Flutter apps, packages, and plugins.

    include: package:lints/recommended.yaml linter: rules: - avoid_print - avoid_unnecessary_containers - avoid_web_libraries_in_ fl utter - no_logic_in_create_state - prefer_const_constructors - prefer_const_constructors_in_immutables - prefer_const_declarations - prefer_const_literals_to_create_immutables - sized_box_for_whitespace - sort_child_properties_last - use_build_context_synchronously - use_full_hex_values_for_ fl utter_colors - use_key_in_widget_constructors Walking through “ fl utter.yaml”
  4.  Walking through “ fl utter.yaml” # Recommended lints for

    Flutter apps, packages, and plugins. include: package:lints/recommended.yaml linter: rules: - avoid_print - avoid_unnecessary_containers - avoid_web_libraries_in_ fl utter - no_logic_in_create_state - prefer_const_constructors - prefer_const_constructors_in_immutables - prefer_const_declarations - prefer_const_literals_to_create_immutables - sized_box_for_whitespace - sort_child_properties_last - use_build_context_synchronously - use_full_hex_values_for_ fl utter_colors - use_key_in_widget_constructors
  5.  Walking through “samples/analysis_options.yaml” include: package: fl utter_lints/ fl utter.yaml

    analyzer: strong-mode: implicit-casts: false implicit-dynamic: false linter: rules: avoid_types_on_closure_parameters: true avoid_void_async: true cancel_subscriptions: true close_sinks: true directives_ordering: true package_api_docs: true package_pre fi xed_library_names: true test_types_in_equals: true throw_in_ fi nally: true unawaited_futures: true unnecessary_statements: true use_super_parameters: true
  6.  Walking through “samples/analysis_options.yaml” include: package: fl utter_lints/ fl utter.yaml

    analyzer: strong-mode: implicit-casts: false implicit-dynamic: false linter: rules: avoid_types_on_closure_parameters: true avoid_void_async: true cancel_subscriptions: true close_sinks: true directives_ordering: true package_api_docs: true package_pre fi xed_library_names: true test_types_in_equals: true throw_in_ fi nally: true unawaited_futures: true unnecessary_statements: true use_super_parameters: true
  7.  One more examples… analyzer: errors: avoid_print: error ྫ.avoid_printҧ൓ΛΤϥʔʹ analyzer:

    exclude: - “**/*.g.dart" - "**/*.freezed.dart" - test/*.dart ྫ.ର৅ύεͷϑΝΠϧΛνΣοΫର৅֎΁
  8.  Please let me know if you have any requests

    
 such as technical speeches, technical writings and so on. Facebook:http://fb.com/kanbara.kenichi Twitter:@korodroid LinkedIn:http://www.linkedin.com/in/korodroid Thank you so much