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

Adding a decoration option to add an image as a background #10

Closed
wants to merge 1 commit into from

Conversation

freshteapot
Copy link

@freshteapot freshteapot commented Apr 10, 2019

Example usage:

controller.decorationForPainter = new BoxDecoration(
      image: new DecorationImage(
        image: ExactAssetImage('assets/bg.jpg'),
      ),
    );

I am not sure if this is the best approach, as I am still quite new to flutter. Equally this does not satisfy the issue request (#3 ) of using an image from the gallery.

@gedw99
Copy link

gedw99 commented Jul 29, 2019

Is this likely to be merged ?
I also need this functionality.

@EP-u-NW
Copy link
Collaborator

EP-u-NW commented Apr 20, 2020

Hi, after reviewing your code, I don't understand, how the decoration is actually applied.
You declare it, but where do you use it?

@EP-u-NW EP-u-NW added the invalid This doesn't seem right label Apr 20, 2020
@tmarzeion
Copy link
Collaborator

Actually what this PR do is adding Decoration field with proper setter/getter, but that's all.
There are 2 things that should be done to make it proper PR:

  1. Do something with _decorationForPainter in painter.dart, because its unused ATM.
  2. IMHO its much better to make some method that would take image as parameter (as asset path, as byte array or something like that) instead of Decorator so that logic is on library side.

@EP-u-NW EP-u-NW closed this Apr 23, 2020
@aravindhkumar23
Copy link

@gedw99

Here is my pull request for work around to set the background.

Hope this helps some one to achieve it.

@freshteapot
Copy link
Author

No problem for closing it, it was mostly to show a way to do it.
I am still far too new, to know how best to do it in flutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants