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
[potatotips #87]UX Improvements on Flutter Apps Part 3
korodroid
0
24
[YUMEMI.grow Mobile #12]UX Improvements on Flutter Apps Part 2
korodroid
0
26
[potatotips #86]UX Improvements on Flutter Apps Part 1
korodroid
0
34
Supporting RTL on Flutter Apps 7 Development Tips
korodroid
0
38
[DevFestKC]Go Global with Flutter Apps 101
korodroid
0
39
[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
87
Other Decks in Technology
See All in Technology
Babylon.js JAPAN活動紹介 (2024/4)
limes2018
1
120
DMM.com アルファ室採用案内資料
hsugita
1
230
本当のAWS基礎
toru_kubota
1
630
ゼロから始めるVue.jsコミュニティ貢献 / first-vuejs-community-contribution-link-and-motivation
lmi
1
150
MixIT 2024 - Pulumi : Gérer son infra avec son langage de programmation préféré
ju_hnny5
1
120
Cloud Service Mesh に触れ合う
phaya72
1
220
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
8
620
アクセス制御にまつわる改善 / Improving access control
itkq
0
590
Azureの基本的な権限管理の勉強会
yhana
1
2.1k
リテール金融(キャッシュレス・ネット銀行・ネット証券)の競争環境と経済圏
8maki
0
1.6k
M&A戦略を支えるデータマネジメント (MIDAS Tech Study #16 GENDA Komiyama)
kommy339
1
110
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
250
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
226
17k
Designing with Data
zakiwarfel
96
4.8k
Designing for humans not robots
tammielis
247
25k
Embracing the Ebb and Flow
colly
80
4.2k
For a Future-Friendly Web
brad_frost
172
9k
GraphQLとの向き合い方2022年版
quramy
33
12k
Music & Morning Musume
bryan
41
5.6k
What's in a price? How to price your products and services
michaelherold
238
11k
Become a Pro
speakerdeck
PRO
13
4.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
20
1.6k
GraphQLの誤解/rethinking-graphql
sonatard
55
9.3k
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