mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
28 lines
603 B
Dart
28 lines
603 B
Dart
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;
|
|
}
|