what does Caret sign do in Dart

2019-08-01 19:22发布

问题:

I am looking at some Flutter projects and I notice this codes:

  @override
  int get hashCode => todos.hashCode ^ isLoading.hashCode;

What is this ^ sign doing here? This line of code is found in the AppState of Flutter projects. Is this used to compare the before and after State?

回答1:

It is the bitwise XOR operator

https://www.dartlang.org/guides/language/language-tour#operators



标签: dart flutter