FlutterKaigi / conference-app-2023

The Official Conference Application for FlutterKaigi 2023
https://flutterkaigi.jp/conference-app-2023/
Apache License 2.0
133 stars 27 forks source link

refactor: dart 3 pattern #117

Closed JAICHANGPARK closed 1 year ago

JAICHANGPARK commented 1 year ago

What's changed?

koji-1009 commented 1 year ago

Hi, @JAICHANGPARK. Thank you for your contribution!

Could you tell us the main reason why you changed from ternary operator to switch? In the case of a nullable bool, I think it is a good idea to handle 3 cases with a switch statement. On the other hand, for non-nullable bool, it seems redundant to write true and false as cases in a switch statement.

I still have a lot to learn about switch expressions, so if you have any good references, please let me know! Thanks!

JAICHANGPARK commented 1 year ago

Hello @koji-1009

thanks for your great opinion. It's just for readability. lol

Thanks :)

koji-1009 commented 1 year ago

@JAICHANGPARK I strongly agree, readbility is important. However, I don't think we can decide that switch should be used at this time.

Sorry, I would like to close the PR 🙏 If Effective Dart (or others) introduce the use of ternary operators and Switch, please share and let's have a conversation!