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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user