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
|
2024-09-01 19:19:19 +02:00
|
|
|
bool operator ==(Object other) {
|
2023-08-14 17:07:09 +02:00
|
|
|
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;
|
|
|
|
}
|