What does Underscore “_” before variable name mean for Flutter

后端 未结 2 397
我在风中等你
我在风中等你 2020-12-13 23:31

with reference to the Flutter tutorial, I encountered an underscore, _.

I know that in Java, _ is used as a naming convention for a private

2条回答
  •  失恋的感觉
    2020-12-14 00:11

    From the Dart guide

    Unlike Java, Dart doesn’t have the keywords public, protected, and private. If an identifier starts with an underscore (_), it’s private to its library. For details, see Libraries and visibility.

提交回复
热议问题