ui.dart 891 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.12

// This is a dummy dart:ui package for the sample code analyzer tests to use.

library dart.ui;

/// Annotation used by Flutter's Dart compiler to indicate that an
/// [Object.toString] override should not be replaced with a supercall.
///
14
/// {@tool sample --template=stateless_widget_material}
15 16 17 18
/// A sample if using keepToString to prevent replacement by a supercall.
///
/// ```dart
/// class MyStringBuffer {
19 20
///   error;
///
21 22 23 24 25 26 27 28 29 30
///   StringBuffer _buffer = StringBuffer();
///
///   @keepToString
///   @override
///   String toString() {
///     return _buffer.toString();
///   }
/// }
/// ```
/// {@end-tool}
31
const Object keepToString = _KeepToString();
32 33 34

class _KeepToString {
  const _KeepToString();
35
}