Prepare for updated avoid_classes_with_only_static_members lint (flutter/engine#27739)

This commit is contained in:
Michael Goderbauer
2021-07-27 13:39:01 -07:00
committed by GitHub
parent 35c602bb69
commit e17c107374
4 changed files with 24 additions and 5 deletions

View File

@@ -26,7 +26,11 @@ class SPathVerb {
static const int kClose = 5; // 0 points
}
class SPath {
abstract class SPath {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
SPath._();
static const int kMoveVerb = SPathVerb.kMove;
static const int kLineVerb = SPathVerb.kLine;
static const int kQuadVerb = SPathVerb.kQuad;

View File

@@ -9,9 +9,12 @@ import 'package:ui/ui.dart' as ui;
import '../../browser_detection.dart';
import 'shader_builder.dart';
// ignore: avoid_classes_with_only_static_members
/// Provides common shaders used for gradients and drawVertices APIs.
class VertexShaders {
abstract class VertexShaders {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
VertexShaders._();
static final Uint16List vertexIndicesForRect =
Uint16List.fromList(<int>[0, 1, 2, 2, 3, 0]);
@@ -70,7 +73,11 @@ class VertexShaders {
}
}
class FragmentShaders {
abstract class FragmentShaders {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
FragmentShaders._();
static String writeTextureFragmentShader(
bool isWebGl2, ui.TileMode? tileModeX, ui.TileMode? tileModeY) {
final ShaderBuilder builder = ShaderBuilder.fragment(webGLVersion);

View File

@@ -16,6 +16,10 @@ class _FindBreakDirection {
/// [WordBreaker] exposes static methods to identify word boundaries.
abstract class WordBreaker {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
WordBreaker._();
/// It starts from [index] and tries to find the next word boundary in [text].
static int nextBreakIndex(String text, int index) =>
_findBreakIndex(_FindBreakDirection.forward, text, index);

View File

@@ -13,7 +13,11 @@ const _HashEnd _hashEnd = _HashEnd();
// Jenkins hash function, optimized for small integers.
//
// Borrowed from the dart sdk: sdk/lib/math/jenkins_smi_hash.dart.
class _Jenkins {
abstract class _Jenkins {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
_Jenkins._();
static int combine(int hash, Object? o) {
assert(o is! Iterable);
hash = 0x1fffffff & (hash + o.hashCode);