Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Writing better Flutter Code with Flutter Lint /...
Search
Kenichi Kambara
April 21, 2023
Technology
530
0
Share
Writing better Flutter Code with Flutter Lint / Part2
#flutter
#flutterjp
#flutterdev
##shibuya_apk
Kenichi Kambara
April 21, 2023
More Decks by Kenichi Kambara
See All by Kenichi Kambara
n個のアプリ開発系 Skills を 作り育てて気づいたこと
korodroid
0
800
[爆速開発LT #2] Codex-Powered Mobile Apps Development - Deep Dive Edition -
korodroid
0
50
[DevFest Singapore] Getting Started with Mobile Development Using Generative AI
korodroid
0
58
[FlutterAlliance]Designing Borderless UX in Flutter: Insights from 50 Countries
korodroid
0
36
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
1.5k
[AgentConHelsinki2025]From Assistant to Agent: How Developer Agents Reshape Mobile Workflows
korodroid
0
31
[FlutterTokyo#10]In-App Language Switching in Flutter
korodroid
0
46
[potatotips #92]Integrating Quick Settings Tiles into Your Android App
korodroid
1
190
[ABC2025Spring]Code Less, Build More: A Practical Guide to Mobile Apps with Generative AI
korodroid
0
250
Other Decks in Technology
See All in Technology
世界の中心でApp Runnerを叫ぶ FINAL
tsukuboshi
0
260
Claude Code / Codex / Kiro に AWS 権限を 渡すとき、何を設計すべきか
k_adachi_01
4
1.1k
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
450
ServiceによるKubernetes通信制御ーClusterIPを例に
miku01
1
160
How to learn AWS Well-Architected with AWS BuilderCards: Security Edition
coosuke
PRO
0
120
なぜ、私がCommunity Builderに?〜活動期間1か月半でも選出されたワケ〜
yama3133
0
120
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.5k
CyberAgent YJC Connect
shimaf4979
1
180
「強制アップデート」か「チームの自律」か?エンタープライズが辿り着いたプラットフォームのハイブリッド運用/cloudnative-kaigi-hybrid-platform-operations
mhrtech
0
180
Databricks 月刊サービスアップデートまとめ 2026年04月号
tyosi1212
0
110
雑談は、センサーだった
bitkey
PRO
2
230
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
100k
Featured
See All Featured
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
How to build a perfect <img>
jonoalderson
1
5.5k
Automating Front-end Workflow
addyosmani
1370
200k
GitHub's CSS Performance
jonrohan
1032
470k
So, you think you're a good person
axbom
PRO
2
2k
How to Talk to Developers About Accessibility
jct
2
190
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Transcript
2023.04.21 ਆݪ ݈Ұ (@korodroid) Writing better Flutter Code with
Flutter Lint / Part2 shibuya.apk #41
ࣗݾհ •ۀɿϞόΠϧΞϓϦ։ൃ/ٕज़ࢧԉ/จԽৢ׆ಈ •ߨԋɿΠϕϯτొஃ(ւ֎14ճɺࠃ100ճ+) •ࣥචɿ7 •झຯɿϥϯχϯά/ӳձ/ΞϓϦ։ൃ ਆݪ ݈Ұ (NTTςΫϊΫϩε/ΤόϯδΣϦετ) @korodroid
ॳΊͯͷshibuya.apkొஃ(8લ…)
About my Flutter product (Private works) Sekaiphone Pro(Flutter/Kotlin/Swift) MyToDo(Flutter)
Part1ͷ͓͞Β͍
Lintπʔϧ(੩తղੳ)Λ׆༻͢ΔϝϦοτྫ 1. જࡏతͳόάͷݕग़ 2. ϨϏϡʔ࡞ۀͷෛՙܰݮ 3. ΞϓϦͷύϑΥʔϚϯεվળ
Flutter͚Lintπʔϧ( fl utter_lints) https://pub.dev/packages/ fl utter_lints
Walking through “ fl utter_lints” ↑ඞཁʹԠͯ͡ɺ࠷৽൛ʹߋ৽
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
Walking through “Linter for Dart” https://dart-lang.github.io/linter/lints/ productionίʔυʹ͓͚Δprint੍
Example: “avoid_print”
͔͜͜ΒPart2
Customizing Rules https://github.com/ fl utter/samples
Walking through “Sample Rules” include: package: fl utter_lints/ fl
utter.yaml analyzer: language: strict-casts: true strict-inference: true 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 include: package:analysis_defaults/ fl utter.yaml ֤sampleͷanalysis_options.yaml
include: package: fl utter_lints/ fl utter.yaml analyzer: language: strict-casts:
true strict-inference: true 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 include: package:analysis_defaults/ fl utter.yaml ֤sampleͷanalysis_options.yaml Walking through “Sample Rules”
Customizing static analysis https://dart.dev/guides/language/analysis-options
Customizing Rules ↑ඞཁʹԠͯ͡ɺΧελϚΠζ
Example1 analyzer: errors: avoid_print: error ྫ.avoid_printҧΛΤϥʔʹ
Example2 linter: rules: avoid_print: false ྫ.avoid_printҧΛνΣοΫର֎
Example3 analyzer: exclude: - “**/*.g.dart" - "**/*.freezed.dart" - test/*.dart
ྫ.ରύεͷϑΝΠϧΛνΣοΫର֎
·ͱΊ •ެࣜϦϑΝϨϯεͷϓϥΫςΟεΛࢀߟʹʂ •Linter for DartɺݴޠֶशͷಡΈͱ͓ͯ͢͢͠Ίʂ •ඞཁʹԠͯ͡ɺϧʔϧΛదٓΧελϚΠζ
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