Skip to content

Commit

Permalink
remove private constructor unreferenced as static utilities classes e…
Browse files Browse the repository at this point in the history
…nforcement.
  • Loading branch information
Roi Peker committed Mar 24, 2023
1 parent b2c08e0 commit 9526b98
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 26 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## [1.0.10] (current dev)
## [1.0.11]
- remove private constructors to pass Dart's static analysis

## [1.0.10]

- fix Color opacity 0 flickering in Graphics.
- new demo in example gallery "Connected" (node garden).
Expand Down
4 changes: 2 additions & 2 deletions lib/src/math.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class Math {
// * OLD code
// static final max = m.max as T Function<T extends num>(T, T);

/// Private constructor to prevent instantiation
Math._();
// Private constructor to prevent instantiation
// Math._();

/// Computes and returns an absolute value for the number specified by
/// [value].
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/color_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class ColorUtils {
);
}

/// Private constructor to prevent instantiation
ColorUtils._();
// Private constructor to prevent instantiation
// ColorUtils._();

/// Returns a color that is the analogous color of the given [color], with the
/// given hue shift [angle] (in degrees). Analogous colors are colors that are
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/context_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import '../../graphx.dart';

/// A utility class for handling [BuildContext] related operations.
class ContextUtils {
/// Private constructor to prevent instantiation
ContextUtils._();
// Private constructor to prevent instantiation
// ContextUtils._();

/// Factory constructor to ensure exception.
factory ContextUtils() {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/keyboard_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class GKeyboard {
);
}

/// Private constructor to prevent instantiation
GKeyboard._();
// Private constructor to prevent instantiation
//GKeyboard._();

/// Returns `true` if any of the specified [GKey] instances are currently
/// pressed.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/layout_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class LayoutUtils {
);
}

/// Private constructor to prevent instantiation
LayoutUtils._();
// Private constructor to prevent instantiation
//LayoutUtils._();

/// Arranges the [items] vertically in a single column, similar to Flutter's
/// [Column], with optional [gap] between them. The column will start at the
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/list_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class ListUtils {
);
}

/// Private constructor to prevent instantiation
ListUtils._();
// Private constructor to prevent instantiation
//ListUtils._();

/// Sorts the given list of [GDisplayObject]s using the merge sort algorithm.
/// The [compare] callback is used to determine the ordering of the elements.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/math_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class MathUtils {
);
}

/// Private constructor to prevent instantiation
MathUtils._();
// Private constructor to prevent instantiation
//MathUtils._();

/// Calculates the next power of two for the given [value].
/// If [value] is already a power of two, it is returned.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/matrix_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class MatrixUtils {
);
}

/// Private constructor to prevent instantiation
MatrixUtils._();
// Private constructor to prevent instantiation
//MatrixUtils._();

/// Returns the bounding rectangle of the specified [rect] after applying the
/// specified [matrix] transformation.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/painter_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ abstract class PainterUtils {
);
}

/// Private constructor to prevent instantiation
PainterUtils._();
// Private constructor to prevent instantiation
//PainterUtils._();

/// Returns a paint object with the specified [alpha] value.
///
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/string_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class StringUtils {
);
}

/// Private constructor to prevent instantiation
StringUtils._();
// Private constructor to prevent instantiation
// StringUtils._();

/// Parses a string value to become a boolean.
///
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/svg_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class SvgUtils {
);
}

/// Private constructor to prevent instantiation
SvgUtils._();
// Private constructor to prevent instantiation
//SvgUtils._();

/// Parses a raw SVG string into a [SvgData] object.
///
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/system_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class SystemUtils {
);
}

/// Private constructor to prevent instantiation
SystemUtils._();
// Private constructor to prevent instantiation
//SystemUtils._();

/// Initializes and returns the value of [_usesSkia] based on whether Skia can
/// be used without errors.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: graphx
description: Render API on top of CustomPainter to power-up your Flutter apps to the next level.
version: 1.0.10
version: 1.0.11
homepage: https://github.com/roipeker/graphx

environment:
Expand Down

0 comments on commit 9526b98

Please sign in to comment.