CaiJingLong/dart_image_size_getter

[Feature request] Replace your `Size` with some child of ui.Size

bambinoua opened this issue · 1 comments

Platforms

dart

Description

Now your Size interfere with dart:ui Size. It would be good to have your own class. For example:

class ImageSize extends Size {
  ...
}

Why

It will not confuses the user because Size is just a base object with width and height. You bring your own sense - it is image size (moreover with the additional boolean).

This problem occurs in actual use, mainly because Dart does not provide Size.
Size is defined in dart:ui in flutter, which is flutter only.

import 'package:image_size_getter/image_size_getter.dart' as getter;

foo(getter.ImageInput input) {
  getter.Size size = getter.ImageSizeGetter.getSize(input);

  print(size);
}
import 'package:image_size_getter/image_size_getter.dart' hide Size;

foo(ImageInput input) {
  final size = ImageSizeGetter.getSize(input);

  print(size);
}

I'll modify the class name of Size next major version.