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 / Part2
Search
Kenichi Kambara
April 21, 2023
Technology
0
360
Writing better Flutter Code with Flutter Lint / Part2
#flutter
#flutterjp
#flutterdev
##shibuya_apk
Kenichi Kambara
April 21, 2023
Tweet
Share
More Decks by Kenichi Kambara
See All by Kenichi Kambara
[YUMEMI.grow Mobile #12]UX Improvements on Flutter Apps Part 2
korodroid
0
23
[potatotips #86]UX Improvements on Flutter Apps Part 1
korodroid
0
32
Supporting RTL on Flutter Apps 7 Development Tips
korodroid
0
35
[DevFestKC]Go Global with Flutter Apps 101
korodroid
0
38
[ABC2023A]Go Global with Flutter Apps
korodroid
0
27
[potatotips #85]Deep Dive into RTL on Flutter Apps (Short ver.)
korodroid
0
40
Supporting RTL on Flutter Apps
korodroid
0
38
[potatotips #84]Supporting Large Screen on Flutter
korodroid
0
86
7 Tips for Wear OS Apps Development
korodroid
0
42
Other Decks in Technology
See All in Technology
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
140
APIファーストなプロダクトマネジメントの実践 〜SaaSus Platformでの例〜 / "Practicing API-First Product Management - An Example with SaaSus Platform
oztick139
0
100
20240418_Google ColabにLLMが搭載されたようなのでPython x データ分析の勉強方法を考えてみる
doradora09
0
130
GraphQL 成熟度モデルの紹介と、プロダクトに当てはめた事例 / GraphQL maturity model
mh4gf
7
1.3k
Azure犬駆動開発の記録/GlobalAzureFukuoka2024_20240420
nina01
1
210
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
13k
GrafanaMeetup_AmazonManagedGrafanaのアクセス制御機能とマルチテナント環境下でのアクセス制御について
daitak
0
140
ChatworkのSRE部って実は 半分くらいPlatform Engineering部かもしれない
saramune
0
160
非同期推論システムによるコスト削減と信頼性向上
koki_nishihara
0
240
継続的な改善 x ⾮連続的な進化
sansantech
PRO
3
150
アクセシビリティを考慮したUI/CSSフレームワーク・ライブラリ選定
yajihum
2
1k
Gitlab本から学んだこと - そーだいなるプレイバック / gitlab-book
soudai
4
320
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
164
13k
GraphQLの誤解/rethinking-graphql
sonatard
50
9.2k
Adopting Sorbet at Scale
ufuk
68
8.6k
RailsConf 2023
tenderlove
4
540
Scaling GitHub
holman
457
140k
Design by the Numbers
sachag
274
18k
Debugging Ruby Performance
tmm1
70
11k
Thoughts on Productivity
jonyablonski
58
3.8k
Clear Off the Table
cherdarchuk
84
310k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Writing Fast Ruby
sferik
621
60k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
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