nc-photos/app/lib/size.dart

29 lines
604 B
Dart
Raw Normal View History

2023-08-14 17:07:09 +02:00
import 'package:flutter/material.dart';
import 'package:to_string/to_string.dart';
part 'size.g.dart';
/// Decimal size
@toString
class SizeInt {
const SizeInt(this.width, this.height);
SizeInt.square(int dimension) : this(dimension, dimension);
@override
bool operator ==(Object? other) {
return other is SizeInt && width == other.width && height == other.height;
}
@override
int get hashCode => Object.hash(width, height);
Size toSizeF() => Size(width.toDouble(), height.toDouble());
@override
String toString() => _$toString();
final int width;
final int height;
}