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

Not able display asset image from project #5

Closed
parteekpassi opened this issue Jun 3, 2021 · 9 comments
Closed

Not able display asset image from project #5

parteekpassi opened this issue Jun 3, 2021 · 9 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@parteekpassi
Copy link

parteekpassi commented Jun 3, 2021

I am trying to use this (EmptyWidget) package in my application to display widget with text and image, when there is no data available to display to the user.

I am using the following code, I do not want to use packageImage but instead i want to use asset image from my project.
I have also noticed if i don't use packageImage parameter or set it to null,
I get Error: Null check operator used on a null value.

EmptyWidget(
image: 'images/test.jpg',
packageImage: PackageImage.Image_3,
title: 'No Data Found',
);

Even if I specify my image path using image attribute, It doesn't display image at all and I can't ignore packageImage attribute. I don't know if its a bug , it seems like that it is mandatory to use packageImage attribute and use available images from it.
Could you please specify how could I use custom image from project and in some cases if i don't need to display image but text only, how could i do it.

Thanks,

@TheAlphamerc TheAlphamerc self-assigned this Jun 4, 2021
@TheAlphamerc TheAlphamerc added the bug Something isn't working label Jun 4, 2021
TheAlphamerc added a commit that referenced this issue Jun 4, 2021
@TheAlphamerc
Copy link
Owner

@parteekpassi thanks for let me know about this issue. Now I have fixed the issue and package v0.0.4 is pushed on pub with this fix. Now you can use project assets or package image assets.

@parteekpassi
Copy link
Author

@TheAlphamerc Thanks for fixing it. I have one more question is there any way that I can reduce the size of the image being displayed on this widget, Currently It occupies the whole screen with background circle. But I wanted to show small image size in the center of the screen not on the full screen, which looks weird. IS there a way I can control Image size and background circle.

@TheAlphamerc
Copy link
Owner

You can wrap the EmptyWidget in container or SizedBox widget and assign its width.

Container(
        alignment: Alignment.center,
        width:300,
        height:300,
        child: EmptyWidget(
          image: null,
          packageImage: PackageImage.Image_1,
          title: 'No Notification',
          subTitle: 'No  notification available yet',
          titleTextStyle: TextStyle(
            fontSize: 22,
            color: Color(0xff9da9c7),
            fontWeight: FontWeight.w500,
          ),
          subtitleTextStyle: TextStyle(
            fontSize: 14,
            color: Color(0xffabb8d6),
          ),
        ),
      ),
    )

@parteekpassi
Copy link
Author

Thankyou

@parteekpassi parteekpassi reopened this Jun 9, 2021
@parteekpassi
Copy link
Author

Hi,

When I use empty widget package, it shows crystal ball in the background.
Is that possible that you can add additional attribute which controls if crystal ball needs to display or not.
By default you can set it true and if developer doesn't want it developer can set it to false something like that.
Currently it adds crystal ball in the background and I don't need it in my case. I just need image and text below.
Screen Shot 2021-06-09 at 5 02 07 PM

Thank you,
Parteek

@TheAlphamerc
Copy link
Owner

@parteekpassi Yes, It can be possible. I'll implement this in new version of package.

@TheAlphamerc TheAlphamerc added the enhancement New feature or request label Jun 10, 2021
TheAlphamerc added a commit that referenced this issue Jun 10, 2021
✨ Add property to hide background ball animation.
Ref-> #5 (comment)
@TheAlphamerc
Copy link
Owner

@parteekpassi I have added a hideBackgroundAnimation property in widget. If you set it to true then background animation will no longer visible to you.

@parteekpassi
Copy link
Author

Thank You for making a change and for a quick response, I really appreciate it.
Now after setting hideBackgroundAnimation = true, i don't see this crystal ball background. But there seems to be a bug, image which i am using is flickering a bit, seems like it still have some animation component behind it.

@TheAlphamerc
Copy link
Owner

@parteekpassi The image have its own animation, which allows it to be remain in linear periodic motion.

Seven-112 pushed a commit to Seven-112/empty_widget that referenced this issue May 23, 2023
Seven-112 pushed a commit to Seven-112/empty_widget that referenced this issue May 23, 2023
✨ Add property to hide background ball animation.
Ref-> TheAlphamerc/empty_widget#5 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants