Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxList extends List,not recommended #3133

Open
YueLiXing opened this issue Jun 25, 2024 · 0 comments
Open

RxList extends List,not recommended #3133

YueLiXing opened this issue Jun 25, 2024 · 0 comments

Comments

@YueLiXing
Copy link

class TempService extends GetxService {
  final message = <String>[].obs;
  
  setMessage(List<String> newMessages) {
    message.value = newMessages;
  }
  
  Future<void> loadMessage() async {
    final temp = ['123'].obs;
    setMessage(temp);
  }
}

When you use it this way, there will be no error or warning prompts, but exceptions will occur at runtime because assigning the value of one Rx object to another Rx value。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant