Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bambinoua opened this issue Feb 23, 2023 · 1 comment
Open

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

bambinoua opened this issue Feb 23, 2023 · 1 comment
Labels
Type: enhancement New feature or request
Milestone

Comments

@bambinoua
Copy link

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).

@CaiJingLong
Copy link
Owner

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.

@CaiJingLong CaiJingLong added this to the 2.0.0 milestone Mar 8, 2023
@CaiJingLong CaiJingLong added the Type: enhancement New feature or request label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants