Complete migration to null safety in api documentation (#72939)

* Remove all usage of no_null_safety in API docs workflows
This commit is contained in:
Shi-Hao Hong
2021-01-06 08:27:34 +08:00
committed by GitHub
parent e8cf674082
commit 01d2325be1
21 changed files with 30 additions and 830 deletions

View File

@@ -6,7 +6,6 @@
// precise contents (including especially the comments) of this file.
// Examples can assume:
// // @dart = 2.9
// bool _visible = true;
// class _Text extends Text {
// const _Text(String text) : super(text);
@@ -35,7 +34,7 @@
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateless_widget_material_no_null_safety}
/// {@tool dartpad --template=stateless_widget_material}
/// Bla blabla blabla some [Text] when the `_blabla` blabla blabla is true, and
/// blabla it when it is blabla:
///
@@ -104,3 +103,32 @@
/// const text1 = _Text('Poor wandering ones!');
/// ```
/// {@end-tool}
///
/// {@tool snippet}
/// Snippet with null-safe syntax
///
/// ```dart
/// final String? bar = 'Hello';
/// final int foo = null;
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateless_widget_material}
/// Dartpad with null-safe syntax
///
/// ```dart preamble
/// bool? _visible = true;
/// final GlobalKey globalKey = GlobalKey();
/// ```
///
/// ```dart
/// Widget build(BuildContext context) {
/// final String title;
/// return Opacity(
/// key: globalKey,
/// opacity: _visible! ? 1.0 : 0.0,
/// child: Text(title),
/// );
/// }
/// ```
/// {@end-tool}