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