When I use Image Widget, I want to initialize the image when creating it. How can I get the variables in AppState
Open
Nobody has claimed this yet.
question
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
I have a question. When I use Image Widget, I want to initialize the image to get the variables in ImageList when creating it. Thank you for your answer
`fn image_list() -> impl Widget{
let image_buf = ImageBuf::from_file("E:/bizhi/00.jpg").unwrap();
let image_show = Image::new(image_buf).fill_mode(FillStrat::Contain).controller(ImageController{});
let size_box_image = SizedBox::new(image_show).height(50.).width(50.);
Flex::row()
.with_flex_spacer(10.)
.with_child(size_box_image)
.with_flex_spacer(10.)
}`
Change the address E:/bizhi/00.jpg to the variable in ImageList
Thank you for your answer
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fn image_list() example and the ImageList, Image, ImageBuf, and ImageController types mentioned in the issue. Trace how AppState or ImageList data reaches widget construction. Done means the image path can come from ImageList instead of the hardcoded E:/bizhi/00.jpg path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100