Как я могу проверить приватные функции / методы во Flutter?

Я предлагаю вам использовать stargazer следующим образом:

  • Использовать quote=FALSE
  • Обязательно укажите type="html"

Попробуйте следующее:

# stargazer

```{r, echo=TRUE, results='asis'}
stargazer(format(f, quote=FALSE, justify="right"), type="html")
```

enter image description here [/g0]

3
задан onthemoon 16 January 2019 в 15:00
поделиться

1 ответ

Вы не можете, но вы можете сделать их общедоступными и аннотировать их с помощью @visibleForTesting, чтобы получить предупреждение DartAnalyzer, когда к ним обращаются из кода, отсутствующего в той же библиотеке или в test/

[115 ] https://github.com/dart-lang/sdk/blob/master/pkg/meta/lib/meta.dart#L224-L233

/// Used to annotate a declaration was made public, so that it is more visible
/// than otherwise necessary, to make code testable.
///
/// Tools, such as the analyzer, can provide feedback if
///
/// * the annotation is associated with a declaration not in the `lib` folder
///   of a package, or
/// * the declaration is referenced outside of its the defining library or a
///   library which is in the `test` folder of the defining package.
0
ответ дан Günter Zöchbauer 16 January 2019 в 15:00
поделиться
Другие вопросы по тегам:

Похожие вопросы: