79200432

Date: 2024-11-18 15:08:49
Score: 2.5
Natty:
Report link

After playing around a lot of time without getting didChangeDependencies to work I found out that didUpdateWidget did the trick. Do you think that this okay or is there another stumbling block that I overlooked?

  @override
  void didUpdateWidget(covariant SearchTermInputOneString oldWidget) {
    final log = getLogger();
    log.t("didUpdateWidget");

    // read apiEndpoint content
    currentContent = ref
        .read(widget.apiEndpointSearchTermInputContentProvider)
        .cast<String>();
    textEditingController.text =
        currentContent.isNotEmpty ? currentContent[0] : "";

    super.didUpdateWidget(oldWidget);
  }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user28298940