Unverified Commit 6ad6c0f4 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Migrate some sample code (#72558)

parent 2e8faec0
......@@ -93,7 +93,7 @@ class ContinuousRectangleBorder extends OutlinedBorder {
final double top = rrect.top;
final double bottom = rrect.bottom;
// Radii will be clamped to the value of the shortest side
/// of [rrect] to avoid strange tie-fighter shapes.
// of rrect to avoid strange tie-fighter shapes.
final double tlRadiusX =
math.max(0.0, _clampToShortest(rrect, rrect.tlRadiusX));
final double tlRadiusY =
......
......@@ -330,7 +330,7 @@ abstract class Gradient {
/// Typically this class is used with [BoxDecoration], which does the painting.
/// To use a [LinearGradient] to paint on a canvas directly, see [createShader].
///
/// {@tool dartpad --template=stateless_widget_material_no_null_safety}
/// {@tool dartpad --template=stateless_widget_material}
/// This sample draws a picture that looks like vertical window shades by having
/// a [Container] display a [BoxDecoration] with a [LinearGradient].
///
......
......@@ -9,9 +9,6 @@ import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
// Examples can assume:
// // @dart = 2.9
/// A [dart:ui.Image] object with its corresponding scale.
///
/// ImageInfo objects are used by [ImageStream] objects to represent the
......@@ -69,8 +66,8 @@ class ImageInfo {
/// [ImageInfo] reference refers to new image data or not.
///
/// ```dart
/// ImageInfo _imageInfo;
/// set imageInfo (ImageInfo value) {
/// ImageInfo? _imageInfo;
/// set imageInfo (ImageInfo? value) {
/// // If the image reference is exactly the same, do nothing.
/// if (value == _imageInfo) {
/// return;
......@@ -78,7 +75,7 @@ class ImageInfo {
/// // If it is a clone of the current reference, we must dispose of it and
/// // can do so immediately. Since the underlying image has not changed,
/// // We don't have any additional work to do here.
/// if (value != null && _imageInfo != null && value.isCloneOf(_imageInfo)) {
/// if (value != null && _imageInfo != null && value.isCloneOf(_imageInfo!)) {
/// value.dispose();
/// return;
/// }
......
......@@ -13,9 +13,6 @@ import 'inline_span.dart';
import 'text_painter.dart';
import 'text_style.dart';
// Examples can assume:
// // @dart = 2.9
/// An immutable span of text.
///
/// A [TextSpan] object can be styled using its [style] property. The style will
......@@ -128,7 +125,7 @@ class TextSpan extends InlineSpan {
/// }
///
/// class _BuzzingTextState extends State<BuzzingText> {
/// LongPressGestureRecognizer _longPressRecognizer;
/// late LongPressGestureRecognizer _longPressRecognizer;
///
/// @override
/// void initState() {
......
......@@ -25,8 +25,7 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
const double _kDefaultFontSize = 14.0;
// Examples can assume:
// // @dart = 2.9
// BuildContext context;
// late BuildContext context;
/// An immutable style describing how to format and paint text.
///
......@@ -205,7 +204,7 @@ const double _kDefaultFontSize = 14.0;
/// foreground: Paint()
/// ..style = PaintingStyle.stroke
/// ..strokeWidth = 6
/// ..color = Colors.blue[700],
/// ..color = Colors.blue[700]!,
/// ),
/// ),
/// // Solid text as fill.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment